29 #if defined (HAVE_CONFIG_H)
49 DEFUN (amd, args, nargout,
82 #if defined (HAVE_AMD)
84 int nargin = args.length ();
86 if (nargin < 1 || nargin > 2)
94 if (args(0).issparse ())
96 if (args(0).iscomplex ())
98 scm = args(0).sparse_complex_matrix_value ();
106 sm = args(0).sparse_matrix_value ();
115 if (args(0).iscomplex ())
130 AMD_NAME (_defaults) (Control);
133 octave_scalar_map arg1 = args(1).xscalar_map_value (
"amd: OPTS argument must be a scalar structure");
147 Matrix xinfo (AMD_INFO, 1);
152 SUITESPARSE_ASSIGN_FPTR (malloc_func, amd_malloc,
malloc);
153 SUITESPARSE_ASSIGN_FPTR (free_func, amd_free,
free);
154 SUITESPARSE_ASSIGN_FPTR (calloc_func, amd_calloc, calloc);
155 SUITESPARSE_ASSIGN_FPTR (realloc_func, amd_realloc, realloc);
156 SUITESPARSE_ASSIGN_FPTR (printf_func, amd_printf, printf);
158 octave_idx_type result = AMD_NAME (_order) (n_col, cidx, ridx, P, Control,
161 if (result == AMD_OUT_OF_MEMORY)
162 error (
"amd: out of memory");
163 else if (result == AMD_INVALID)
164 error (
"amd: matrix S is corrupted");
168 Pout.
xelem (i) = P[i] + 1;
171 return ovl (Pout, xinfo);
177 octave_unused_parameter (args);
178 octave_unused_parameter (nargout);
T & xelem(octave_idx_type n)
Size of the specified dimension.
const T * fortran_vec(void) const
Size of the specified dimension.
octave_idx_type cols(void) const
octave_idx_type * xridx(void)
octave_idx_type rows(void) const
octave_idx_type * xcidx(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)
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)
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.