26 #if defined (HAVE_CONFIG_H) 136 #if defined (HAVE_CCOLAMD) 138 int nargin = args.length ();
147 static_assert (CCOLAMD_KNOBS <= 40,
"ccolamd: # of CCOLAMD_KNOBS exceeded. Please report this to bugs.octave.org");
148 double knob_storage[CCOLAMD_KNOBS];
149 double *knobs = &knob_storage[0];
155 NDArray User_knobs = args(1).array_value ();
156 int nel_User_knobs = User_knobs.
numel ();
158 if (nel_User_knobs > 0)
159 knobs[CCOLAMD_LU] = (User_knobs(0) != 0);
160 if (nel_User_knobs > 1)
161 knobs[CCOLAMD_DENSE_ROW] = User_knobs(1);
162 if (nel_User_knobs > 2)
163 knobs[CCOLAMD_DENSE_COL] = User_knobs(2);
164 if (nel_User_knobs > 3)
165 knobs[CCOLAMD_AGGRESSIVE] = (User_knobs(3) != 0);
166 if (nel_User_knobs > 4)
167 spumoni = (User_knobs(4) != 0);
172 octave_stdout <<
"\nccolamd version " << CCOLAMD_MAIN_VERSION <<
'.' 173 << CCOLAMD_SUB_VERSION <<
", " << CCOLAMD_DATE
174 <<
":\nknobs(1): " << User_knobs(0) <<
", order for ";
175 if (knobs[CCOLAMD_LU] != 0)
180 if (knobs[CCOLAMD_DENSE_ROW] >= 0)
182 <<
", rows with > max (16," 183 << knobs[CCOLAMD_DENSE_ROW]
184 <<
"*sqrt (size(A,2)))" 185 <<
" entries removed\n";
188 <<
", no dense rows removed\n";
190 if (knobs[CCOLAMD_DENSE_COL] >= 0)
192 <<
", cols with > max (16," 193 << knobs[CCOLAMD_DENSE_COL] <<
"*sqrt (size(A)))" 194 <<
" entries removed\n";
197 <<
", no dense columns removed\n";
199 if (knobs[CCOLAMD_AGGRESSIVE] != 0)
201 <<
", aggressive absorption: yes";
204 <<
", aggressive absorption: no";
207 <<
", statistics and knobs printed\n";
216 if (args(0).issparse ())
218 if (args(0).iscomplex ())
220 scm = args(0).sparse_complex_matrix_value ();
229 sm = args(0).sparse_matrix_value ();
240 if (args(0).iscomplex ())
262 static_assert (CCOLAMD_STATS <= 40,
"ccolamd: # of CCOLAMD_STATS exceeded. Please report this to bugs.octave.org");
268 NDArray in_cmember = args(2).array_value ();
273 cmember[
i] = static_cast<octave::suitesparse_integer>(in_cmember(
i) - 1);
276 error (
"ccolamd: CMEMBER must be of length equal to #cols of A");
279 if (!
CCOLAMD_NAME () (n_row, n_col, Alen,
A,
p, knobs, stats,cmember))
283 error (
"ccolamd: internal error!");
289 if (!
CCOLAMD_NAME () (n_row, n_col, Alen,
A,
p, knobs, stats,
nullptr))
293 error (
"ccolamd: internal error!");
300 out_perm(
i) =
p[
i] + 1;
313 out_stats(
i) = stats[
i];
319 out_stats(CCOLAMD_INFO1)++;
320 out_stats(CCOLAMD_INFO2)++;
327 octave_unused_parameter (args);
328 octave_unused_parameter (
nargout);
401 #if defined (HAVE_CCOLAMD) 403 int nargin = args.length ();
412 static_assert (CCOLAMD_KNOBS <= 40,
"csymamd: # of CCOLAMD_KNOBS exceeded. Please report this to bugs.octave.org");
413 double knob_storage[CCOLAMD_KNOBS];
414 double *knobs = &knob_storage[0];
420 NDArray User_knobs = args(1).array_value ();
421 int nel_User_knobs = User_knobs.
numel ();
423 if (nel_User_knobs > 0)
424 knobs[CCOLAMD_DENSE_ROW] = User_knobs(0);
425 if (nel_User_knobs > 0)
426 knobs[CCOLAMD_AGGRESSIVE] = User_knobs(1);
427 if (nel_User_knobs > 1)
428 spumoni =
static_cast<int> (User_knobs(2));
433 octave_stdout <<
"\ncsymamd version " << CCOLAMD_MAIN_VERSION
434 <<
'.' << CCOLAMD_SUB_VERSION
435 <<
", " << CCOLAMD_DATE <<
"\n";
437 if (knobs[CCOLAMD_DENSE_ROW] >= 0)
439 <<
", rows/cols with > max (16," 440 << knobs[CCOLAMD_DENSE_ROW]
441 <<
"*sqrt (size(A,2)))" 442 <<
" entries removed\n";
445 <<
", no dense rows/cols removed\n";
447 if (knobs[CCOLAMD_AGGRESSIVE] != 0)
449 <<
", aggressive absorption: yes";
452 <<
", aggressive absorption: no";
455 <<
", statistics and knobs printed\n";
464 if (args(0).issparse ())
466 if (args(0).iscomplex ())
468 scm = args(0).sparse_complex_matrix_value ();
476 sm = args(0).sparse_matrix_value ();
485 if (args(0).iscomplex ())
501 static_assert (CCOLAMD_STATS <= 40,
"csymamd: # of CCOLAMD_STATS exceeded. Please report this to bugs.octave.org");
507 NDArray in_cmember = args(2).array_value ();
512 cmember[
i] = static_cast<octave_idx_type>(in_cmember(
i) - 1);
515 error (
"csymamd: CMEMBER must be of length equal to #cols of A");
520 perm, knobs, stats, &calloc, &free, cmember, -1))
524 error (
"csymamd: internal error!");
532 perm, knobs, stats, &calloc, &free,
nullptr, -1))
536 error (
"csymamd: internal error!");
543 out_perm(
i) = perm[
i] + 1;
556 out_stats(
i) = stats[
i];
562 out_stats(CCOLAMD_INFO1)++;
563 out_stats(CCOLAMD_INFO2)++;
570 octave_unused_parameter (args);
571 octave_unused_parameter (
nargout);
OCTINTERP_API void print_usage(void)
void error(const char *fmt,...)
void err_square_matrix_required(const char *fcn, const char *name)
octave_idx_type nnz(void) const
Actual number of nonzero terms.
F77_RET_T const F77_INT F77_CMPLX * A
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
#define CCOLAMD_NAME(name)
#define CSYMAMD_NAME(name)
octave_idx_type * xridx(void)
octave_idx_type cols(void) const
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
Macro to define an at run time dynamically loadable builtin function.
octave_idx_type * xcidx(void)
octave_idx_type numel(void) const
Number of elements in the array.
ColumnVector real(const ComplexColumnVector &a)
Vector representing the dimensions (size) of an Array.
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
octave_idx_type rows(void) const
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)