26 #if defined (HAVE_CONFIG_H)
47 #if defined (OCTAVE_ENABLE_64)
48 # define CCOLAMD_NAME(name) ccolamd_l ## name
49 # define CSYMAMD_NAME(name) csymamd_l ## name
51 # define CCOLAMD_NAME(name) ccolamd ## name
52 # define CSYMAMD_NAME(name) csymamd ## name
147 #if defined (HAVE_CCOLAMD)
151 if (nargin < 1 || nargin > 3)
165 int nel_User_knobs = User_knobs.
numel ();
167 if (nel_User_knobs > 0)
168 knobs[CCOLAMD_LU] = (User_knobs(0) != 0);
169 if (nel_User_knobs > 1)
170 knobs[CCOLAMD_DENSE_ROW] = User_knobs(1);
171 if (nel_User_knobs > 2)
172 knobs[CCOLAMD_DENSE_COL] = User_knobs(2);
173 if (nel_User_knobs > 3)
174 knobs[CCOLAMD_AGGRESSIVE] = (User_knobs(3) != 0);
175 if (nel_User_knobs > 4)
176 spumoni = (User_knobs(4) != 0);
181 octave_stdout <<
"\nccolamd version " << CCOLAMD_MAIN_VERSION <<
"."
182 << CCOLAMD_SUB_VERSION <<
", " << CCOLAMD_DATE
183 <<
":\nknobs(1): " << User_knobs(0) <<
", order for ";
184 if (knobs[CCOLAMD_LU] != 0)
189 if (knobs[CCOLAMD_DENSE_ROW] >= 0)
191 <<
", rows with > max (16,"
192 << knobs[CCOLAMD_DENSE_ROW]
193 <<
"*sqrt (size(A,2)))"
194 <<
" entries removed\n";
197 <<
", no dense rows removed\n";
199 if (knobs[CCOLAMD_DENSE_COL] >= 0)
201 <<
", cols with > max (16,"
202 << knobs[CCOLAMD_DENSE_COL] <<
"*sqrt (size(A)))"
203 <<
" entries removed\n";
206 <<
", no dense columns removed\n";
208 if (knobs[CCOLAMD_AGGRESSIVE] != 0)
210 <<
", aggressive absorption: yes";
213 <<
", aggressive absorption: no";
216 <<
", statistics and knobs printed\n";
225 if (
args(0).is_sparse_type ())
227 if (
args(0).is_complex_type ())
229 scm =
args(0).sparse_complex_matrix_value ();
238 sm =
args(0).sparse_matrix_value ();
249 if (
args(0).is_complex_type ())
280 cmember[
i] = static_cast<octave_idx_type>(in_cmember(
i) - 1);
283 error (
"ccolamd: CMEMBER must be of length equal to #cols of A");
286 if (!
CCOLAMD_NAME () (n_row, n_col, Alen,
A,
p, knobs, stats, cmember))
290 error (
"ccolamd: internal error!");
296 if (!
CCOLAMD_NAME () (n_row, n_col, Alen,
A,
p, knobs, stats, 0))
300 error (
"ccolamd: internal error!");
307 out_perm(
i) =
p[
i] + 1;
320 out_stats(
i) = stats[
i];
326 out_stats(CCOLAMD_INFO1)++;
327 out_stats(CCOLAMD_INFO2)++;
334 octave_unused_parameter (
args);
335 octave_unused_parameter (
nargout);
408 #if defined (HAVE_CCOLAMD)
412 if (nargin < 1 || nargin > 3)
426 int nel_User_knobs = User_knobs.
numel ();
428 if (nel_User_knobs > 0)
429 knobs[CCOLAMD_DENSE_ROW] = User_knobs(0);
430 if (nel_User_knobs > 0)
431 knobs[CCOLAMD_AGGRESSIVE] = User_knobs(1);
432 if (nel_User_knobs > 1)
433 spumoni =
static_cast<int> (User_knobs(2));
438 octave_stdout <<
"\ncsymamd version " << CCOLAMD_MAIN_VERSION
439 <<
"." << CCOLAMD_SUB_VERSION
440 <<
", " << CCOLAMD_DATE <<
"\n";
442 if (knobs[CCOLAMD_DENSE_ROW] >= 0)
444 <<
", rows/cols with > max (16,"
445 << knobs[CCOLAMD_DENSE_ROW]
446 <<
"*sqrt (size(A,2)))"
447 <<
" entries removed\n";
450 <<
", no dense rows/cols removed\n";
452 if (knobs[CCOLAMD_AGGRESSIVE] != 0)
454 <<
", aggressive absorption: yes";
457 <<
", aggressive absorption: no";
460 <<
", statistics and knobs printed\n";
469 if (
args(0).is_sparse_type ())
471 if (
args(0).is_complex_type ())
473 scm =
args(0).sparse_complex_matrix_value ();
481 sm =
args(0).sparse_matrix_value ();
490 if (
args(0).is_complex_type ())
515 cmember[
i] = static_cast<octave_idx_type>(in_cmember(
i) - 1);
518 error (
"csymamd: CMEMBER must be of length equal to #cols of A");
520 if (!
CSYMAMD_NAME () (n_col, ridx, cidx, perm, knobs, stats,
521 &calloc, &
free, cmember, -1))
525 error (
"csymamd: internal error!");
530 if (!
CSYMAMD_NAME () (n_col, ridx, cidx, perm, knobs, stats,
531 &calloc, &
free, 0, -1))
535 error (
"csymamd: internal error!");
542 out_perm(
i) = perm[
i] + 1;
555 out_stats(
i) = stats[
i];
561 out_stats(CCOLAMD_INFO1)++;
562 out_stats(CCOLAMD_INFO2)++;
569 octave_unused_parameter (
args);
570 octave_unused_parameter (
nargout);
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,...)
void err_square_matrix_required(const char *fcn, const char *name)
octave_idx_type nnz(void) const
Actual number of nonzero terms.
#define CSYMAMD_NAME(name)
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)
=val(i)}if ode{val(i)}occurs in table i
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
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)
#define CCOLAMD_NAME(name)
F77_RET_T const F77_INT F77_CMPLX * A