27 #if defined (HAVE_CONFIG_H)
48 #if defined (OCTAVE_ENABLE_64)
49 # define COLAMD_NAME(name) colamd_l ## name
50 # define SYMAMD_NAME(name) symamd_l ## name
52 # define COLAMD_NAME(name) colamd ## name
53 # define SYMAMD_NAME(name) symamd ## name
84 for ( ; Flag[
i] !=
k ; i = Parent[
i])
134 postnum =
etdfs (
w, first_kid, next_kid, post, postnum);
156 next_kid[v] = first_kid[dad];
161 etdfs (n, first_kid, next_kid, post, 0);
181 if (firstcol[row] > col)
204 cset =
link (cset, rset, pp);
281 #if defined (HAVE_COLAMD)
285 if (nargin < 1 || nargin > 2)
299 int nel_User_knobs = User_knobs.
numel ();
301 if (nel_User_knobs > 0)
302 knobs[COLAMD_DENSE_ROW] = User_knobs(0);
303 if (nel_User_knobs > 1)
304 knobs[COLAMD_DENSE_COL] = User_knobs(1);
305 if (nel_User_knobs > 2)
306 spumoni =
static_cast<int> (User_knobs(2));
313 <<
"." << COLAMD_SUB_VERSION
314 <<
", " << COLAMD_DATE <<
":\n";
316 if (knobs[COLAMD_DENSE_ROW] >= 0)
318 <<
", rows with > max (16,"
319 << knobs[COLAMD_DENSE_ROW] <<
"*sqrt (size(A,2)))"
320 <<
" entries removed\n";
323 <<
", only completely dense rows removed\n";
325 if (knobs[COLAMD_DENSE_COL] >= 0)
327 <<
", cols with > max (16,"
328 << knobs[COLAMD_DENSE_COL] <<
"*sqrt (size(A)))"
329 <<
" entries removed\n";
332 <<
", only completely dense columns removed\n";
335 <<
", statistics and knobs printed\n";
345 if (
args(0).is_sparse_type ())
347 if (
args(0).is_complex_type ())
349 scm =
args(0).sparse_complex_matrix_value ();
358 sm =
args(0).sparse_matrix_value ();
369 if (
args(0).is_complex_type ())
393 if (!
COLAMD_NAME () (n_row, n_col, Alen,
A,
p, knobs, stats))
397 error (
"colamd: internal error!");
407 colbeg[
i] = cidx[
p[
i]];
408 colend[
i] = cidx[p[
i]+1];
411 coletree (ridx, colbeg, colend, etree, n_row, n_col);
419 out_perm(
i) =
p[colbeg[
i]] + 1;
432 out_stats(
i) = stats[
i];
438 out_stats(COLAMD_INFO1)++;
439 out_stats(COLAMD_INFO2)++;
446 octave_unused_parameter (
args);
447 octave_unused_parameter (
nargout);
519 #if defined (HAVE_COLAMD)
523 if (nargin < 1 || nargin > 2)
537 int nel_User_knobs = User_knobs.
numel ();
539 if (nel_User_knobs > 0)
540 knobs[COLAMD_DENSE_ROW] = User_knobs(COLAMD_DENSE_ROW);
541 if (nel_User_knobs > 1)
542 spumoni =
static_cast<int> (User_knobs (1));
548 << knobs[COLAMD_DENSE_ROW] << std::endl;
555 if (
args(0).is_sparse_type ())
557 if (
args(0).is_complex_type ())
559 scm =
args(0).sparse_complex_matrix_value ();
567 sm =
args(0).sparse_matrix_value ();
576 if (
args(0).is_complex_type ())
594 knobs, stats, &calloc, &
free))
598 error (
"symamd: internal error!");
603 symetree (ridx, cidx, etree, perm, n_col);
612 out_perm(
i) = perm[post[
i]] + 1;
625 out_stats(
i) = stats[
i];
631 out_stats(COLAMD_INFO1)++;
632 out_stats(COLAMD_INFO2)++;
639 octave_unused_parameter (
args);
640 octave_unused_parameter (
nargout);
665 int nargin =
args.length ();
667 if (nargin < 1 || nargin > 2)
677 if (
args(0).is_sparse_type ())
678 error (
"etree: S must be a sparse matrix");
680 if (
args(0).is_complex_type ())
704 if (str.find (
"C") == 0 || str.find (
"c") == 0)
714 error (
"etree: S is marked as symmetric, but is not square");
716 symetree (ridx, cidx, etree, 0, n_col);
726 colend[
i] = cidx[
i+1];
729 coletree (ridx, colbeg, colend, etree, n_row, n_col);
736 if (etree[
i] == n_col)
751 postorder(
i) = post[
i] + 1;
octave_idx_type * xridx(void)
octave_idx_type cols(void) const
octave_idx_type rows(void) const
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
octave_idx_type * xcidx(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)
octave_idx_type nnz(void) const
Actual number of nonzero terms.
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_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)
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
=val(i)}if ode{val(i)}occurs in table i
#define SYMAMD_NAME(name)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
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)
#define COLAMD_NAME(name)
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
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
F77_RET_T const F77_INT F77_CMPLX * A