90 qt = (qt + 1) % (N + 1);
99 qh = (qh + 1) % (N + 1);
104 #define Q_empty(Q, N, qh, qt) ((qh) == (qt))
109 #define LEFT(i) (((i) << 1) + 1) // = (2*(i)+1)
111 #define RIGHT(i) (((i) << 1) + 2) // = (2*(i)+2)
113 #define PARENT(i) (((i) - 1) >> 1) // = floor(((i)-1)/2)
128 if (l < size && A[l].deg < A[j].deg)
133 if (r < size && A[r].deg < A[smallest].deg)
138 std::swap (A[j], A[smallest]);
160 if (H[i].deg < H[p].deg)
162 std::swap (H[i], H[p]);
186 #define H_empty(H, h) ((h) == 0)
231 while (j1 < cidx[i+1] || j2 < cidx2[i+1])
251 else if (j2 == cidx2[i+1])
307 if (max_dist < x.
dist)
362 else if (ridx[l] > j)
416 @deftypefn {Loadable Function} {@var{p} =} symrcm (@var{S})\n\
417 Return the symmetric reverse @nospell{Cuthill-McKee} permutation of @var{S}.\n\
419 @var{p} is a permutation vector such that\n\
420 @code{@var{S}(@var{p}, @var{p})} tends to have its diagonal elements closer\n\
421 to the diagonal than @var{S}. This is a good preordering for LU or\n\
422 Cholesky@tie{}factorization of matrices that come from ``long, skinny''\n\
423 problems. It works for both symmetric and asymmetric @var{S}.\n\
425 The algorithm represents a heuristic approach to the NP-complete bandwidth\n\
426 minimization problem. The implementation is based in the descriptions found\n\
429 @nospell{E. Cuthill, J. McKee}. @cite{Reducing the Bandwidth of Sparse\n\
430 Symmetric Matrices}. Proceedings of the 24th ACM National Conference,\n\
431 157--172 1969, Brandon Press, New Jersey.\n\
433 @nospell{A. George, J.W.H. Liu}. @cite{Computer Solution of Large Sparse\n\
434 Positive Definite Systems}, Prentice Hall Series in Computational\n\
435 Mathematics, ISBN 0-13-165274-5, 1981.\n\
437 @seealso{colperm, colamd, symamd}\n\
441 int nargin = args.
length ();
484 if (nr == 0 && nc == 0)
544 for (i = 0; i <
N; i++)
590 while (j1 < cidx[i+1] || j2 < cidx2[i+1])
606 else if (j2 == cidx2[i+1])
octave_idx_type * xridx(void)
static void Q_enq(CMK_Node *Q, octave_idx_type N, octave_idx_type &qt, const CMK_Node &o)
bool is_real_type(void) const
static octave_idx_type calc_degrees(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *D)
octave_idx_type rows(void) const
static void H_insert(CMK_Node *H, octave_idx_type &h, const CMK_Node &o)
OCTINTERP_API void print_usage(void)
F77_RET_T const octave_idx_type Complex * A
static void transpose(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *ridx2, octave_idx_type *cidx2)
octave_idx_type * xcidx(void)
T & elem(octave_idx_type n)
void gripe_square_matrix_required(const char *name)
static octave_idx_type find_starting_node(octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, const octave_idx_type *ridx2, const octave_idx_type *cidx2, octave_idx_type *D, octave_idx_type start)
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type r2
octave_idx_type columns(void) const
std::complex< double > w(std::complex< double > z, double relerr=0)
octave_idx_type length(void) const
size_t size(T const (&)[z])
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
F77_RET_T const octave_idx_type Complex const octave_idx_type Complex * B
F77_RET_T const octave_idx_type & N
#define Q_empty(Q, N, qh, qt)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
F77_RET_T const octave_idx_type const octave_idx_type const octave_idx_type double const octave_idx_type double const octave_idx_type double * Q
static CMK_Node Q_deq(CMK_Node *Q, octave_idx_type N, octave_idx_type &qh)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type r1
const T * fortran_vec(void) const
static CMK_Node H_remove_min(CMK_Node *H, octave_idx_type &h, int reorg)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
F77_RET_T const double * x
static void H_heapify_min(CMK_Node *A, octave_idx_type i, octave_idx_type size)