27 #if defined (HAVE_CONFIG_H) 75 for ( ; Flag[
i] !=
k ;
i = Parent[
i])
125 postnum =
etdfs (
w, first_kid, next_kid, post, postnum);
147 next_kid[v] = first_kid[dad];
152 etdfs (n, first_kid, next_kid, post, 0);
172 if (firstcol[
row] > col)
195 cset =
link (cset, rset, pp);
272 #if defined (HAVE_COLAMD) 274 int nargin = args.length ();
283 static_assert (COLAMD_KNOBS <= 40,
"colamd: # of COLAMD_KNOBS exceeded. Please report this to bugs.octave.org");
284 double knob_storage[COLAMD_KNOBS];
285 double *knobs = &knob_storage[0];
286 COLAMD_NAME (_set_defaults) (knobs);
291 NDArray User_knobs = args(1).array_value ();
292 int nel_User_knobs = User_knobs.
numel ();
294 if (nel_User_knobs > 0)
295 knobs[COLAMD_DENSE_ROW] = User_knobs(0);
296 if (nel_User_knobs > 1)
297 knobs[COLAMD_DENSE_COL] = User_knobs(1);
298 if (nel_User_knobs > 2)
299 spumoni =
static_cast<int> (User_knobs(2));
306 <<
'.' << COLAMD_SUB_VERSION
307 <<
", " << COLAMD_DATE <<
":\n";
309 if (knobs[COLAMD_DENSE_ROW] >= 0)
311 <<
", rows with > max (16," 312 << knobs[COLAMD_DENSE_ROW] <<
"*sqrt (size(A,2)))" 313 <<
" entries removed\n";
316 <<
", only completely dense rows removed\n";
318 if (knobs[COLAMD_DENSE_COL] >= 0)
320 <<
", cols with > max (16," 321 << knobs[COLAMD_DENSE_COL] <<
"*sqrt (size(A)))" 322 <<
" entries removed\n";
325 <<
", only completely dense columns removed\n";
328 <<
", statistics and knobs printed\n";
338 if (args(0).issparse ())
340 if (args(0).iscomplex ())
342 scm = args(0).sparse_complex_matrix_value ();
351 sm = args(0).sparse_matrix_value ();
362 if (args(0).iscomplex ())
385 static_assert (COLAMD_STATS <= 40,
"colamd: # of COLAMD_STATS exceeded. Please report this to bugs.octave.org");
388 if (! COLAMD_NAME () (n_row, n_col, Alen,
A,
p, knobs, stats))
390 COLAMD_NAME (_report)(stats);
392 error (
"colamd: internal error!");
402 colbeg[
i] = cidx[
p[
i]];
403 colend[
i] = cidx[
p[
i]+1];
406 coletree (ridx, colbeg, colend, etree, n_row, n_col);
414 out_perm(
i) =
p[colbeg[
i]] + 1;
420 COLAMD_NAME (_report)(stats);
427 out_stats(
i) = stats[
i];
433 out_stats(COLAMD_INFO1)++;
434 out_stats(COLAMD_INFO2)++;
441 octave_unused_parameter (args);
442 octave_unused_parameter (
nargout);
514 #if defined (HAVE_COLAMD) 516 int nargin = args.length ();
525 static_assert (COLAMD_KNOBS <= 40,
"symamd: # of COLAMD_KNOBS exceeded. Please report this to bugs.octave.org");
526 double knob_storage[COLAMD_KNOBS];
527 double *knobs = &knob_storage[0];
528 COLAMD_NAME (_set_defaults) (knobs);
533 NDArray User_knobs = args(1).array_value ();
534 int nel_User_knobs = User_knobs.
numel ();
536 if (nel_User_knobs > 0)
537 knobs[COLAMD_DENSE_ROW] = User_knobs(COLAMD_DENSE_ROW);
538 if (nel_User_knobs > 1)
539 spumoni =
static_cast<int> (User_knobs (1));
545 << knobs[COLAMD_DENSE_ROW] << std::endl;
552 if (args(0).issparse ())
554 if (args(0).iscomplex ())
556 scm = args(0).sparse_complex_matrix_value ();
564 sm = args(0).sparse_matrix_value ();
573 if (args(0).iscomplex ())
589 static_assert (COLAMD_STATS <= 40,
"symamd: # of COLAMD_STATS exceeded. Please report this to bugs.octave.org");
595 knobs, stats, &calloc, &free))
597 SYMAMD_NAME (_report)(stats);
599 error (
"symamd: internal error!");
604 symetree (ridx, cidx, etree, perm, n_col);
613 out_perm(
i) = perm[post[
i]] + 1;
619 SYMAMD_NAME (_report)(stats);
626 out_stats(
i) = stats[
i];
632 out_stats(COLAMD_INFO1)++;
633 out_stats(COLAMD_INFO2)++;
640 octave_unused_parameter (args);
641 octave_unused_parameter (
nargout);
666 int nargin = args.length ();
678 if (args(0).issparse ())
679 error (
"etree: S must be a sparse matrix");
681 if (args(0).iscomplex ())
704 std::string str = args(1).xstring_value (
"etree: TYP must be a string");
705 if (
str.find (
'C') == 0 ||
str.find (
'c') == 0)
715 error (
"etree: S is marked as symmetric, but is not square");
717 symetree (ridx, cidx, etree,
nullptr, n_col);
727 colend[
i] = cidx[
i+1];
730 coletree (ridx, colbeg, colend, etree, n_row, n_col);
737 if (etree[
i] == n_col)
740 tree(
i) = etree[
i] + 1;
752 postorder(
i) = post[
i] + 1;
OCTINTERP_API void print_usage(void)
void error(const char *fmt,...)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
void err_square_matrix_required(const char *fcn, const char *name)
static void coletree(const octave_idx_type *ridx, const octave_idx_type *colbeg, octave_idx_type *colend, octave_idx_type *parent, octave_idx_type nr, octave_idx_type nc)
static void tree_postorder(octave_idx_type n, octave_idx_type *parent, octave_idx_type *post)
static octave_idx_type make_set(octave_idx_type i, octave_idx_type *pp)
static octave_idx_type link(octave_idx_type s, octave_idx_type t, octave_idx_type *pp)
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)
std::complex< double > w(std::complex< double > z, double relerr=0)
octave_idx_type * xridx(void)
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
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.
static void symetree(const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *Parent, octave_idx_type *P, octave_idx_type n)
octave_idx_type * xcidx(void)
octave_idx_type numel(void) const
Number of elements in the array.
ColumnVector real(const ComplexColumnVector &a)
static octave_idx_type etdfs(octave_idx_type v, octave_idx_type *first_kid, octave_idx_type *next_kid, octave_idx_type *post, octave_idx_type postnum)
Vector representing the dimensions (size) of an Array.
void err_disabled_feature(const std::string &fcn, const std::string &feature, const std::string &pkg)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
octave_idx_type rows(void) const
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)