29 #if defined (HAVE_CONFIG_H)
51 DEFUN (amd, args, nargout,
84 #if defined (HAVE_AMD)
86 int nargin = args.length ();
88 if (nargin < 1 || nargin > 2)
96 if (args(0).issparse ())
98 if (args(0).iscomplex ())
100 scm = args(0).sparse_complex_matrix_value ();
108 sm = args(0).sparse_matrix_value ();
117 if (args(0).iscomplex ())
132 AMD_NAME (_defaults) (Control);
136 1).xscalar_map_value (
"amd: OPTS argument must be a scalar structure");
150 Matrix xinfo (AMD_INFO, 1);
155 SUITESPARSE_ASSIGN_FPTR (malloc_func, amd_malloc,
malloc);
156 SUITESPARSE_ASSIGN_FPTR (free_func, amd_free,
free);
157 SUITESPARSE_ASSIGN_FPTR (calloc_func, amd_calloc, calloc);
158 SUITESPARSE_ASSIGN_FPTR (realloc_func, amd_realloc, realloc);
159 SUITESPARSE_ASSIGN_FPTR (printf_func, amd_printf, printf);
161 octave_idx_type result = AMD_NAME (_order) (n_col, cidx, ridx, P, Control,
164 if (result == AMD_OUT_OF_MEMORY)
165 error (
"amd: out of memory");
166 else if (result == AMD_INVALID)
167 error (
"amd: matrix S is corrupted");
171 Pout.
xelem (i) = P[i] + 1;
174 return ovl (Pout, xinfo);
180 octave_unused_parameter (args);
181 octave_unused_parameter (nargout);
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type rows(void) const
octave_idx_type cols(void) const
octave_idx_type * xcidx(void)
octave_idx_type * xridx(void)
octave_value getfield(const std::string &key) const
bool is_defined(void) const
double double_value(bool frc_str_conv=false) const
ColumnVector real(const ComplexColumnVector &a)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
void err_square_matrix_required(const char *fcn, const char *name)
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
class OCTAVE_API SparseMatrix
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.