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);
135 octave_scalar_map arg1 = args(1).xscalar_map_value (
"amd: OPTS argument must be a scalar structure");
149 Matrix xinfo (AMD_INFO, 1);
154 SUITESPARSE_ASSIGN_FPTR (malloc_func, amd_malloc,
malloc);
155 SUITESPARSE_ASSIGN_FPTR (free_func, amd_free,
free);
156 SUITESPARSE_ASSIGN_FPTR (calloc_func, amd_calloc, calloc);
157 SUITESPARSE_ASSIGN_FPTR (realloc_func, amd_realloc, realloc);
158 SUITESPARSE_ASSIGN_FPTR (printf_func, amd_printf, printf);
160 octave_idx_type result = AMD_NAME (_order) (n_col, cidx, ridx, P, Control,
163 if (result == AMD_OUT_OF_MEMORY)
164 error (
"amd: out of memory");
165 else if (result == AMD_INVALID)
166 error (
"amd: matrix S is corrupted");
170 Pout.
xelem (i) = P[i] + 1;
173 return ovl (Pout, xinfo);
179 octave_unused_parameter (args);
180 octave_unused_parameter (nargout);
206 OCTAVE_END_NAMESPACE(
octave)
T * fortran_vec()
Size of the specified dimension.
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type cols() const
octave_idx_type * xcidx()
octave_idx_type rows() const
octave_idx_type * xridx()
octave_value getfield(const std::string &key) const
double double_value(bool frc_str_conv=false) const
ColumnVector real(const ComplexColumnVector &a)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#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)
#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.