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 Cuthill-McKee permutation of @var{S}.\n\
418 @var{p} is a permutation vector such that\n\
419 @code{@var{S}(@var{p}, @var{p})} tends to have its diagonal elements\n\
420 closer to the diagonal than @var{S}. This is a good preordering for LU\n\
421 or Cholesky@tie{}factorization of matrices that come from ``long, skinny''\n\
422 problems. It works for both symmetric and asymmetric @var{S}.\n\
424 The algorithm represents a heuristic approach to the NP-complete\n\
425 bandwidth minimization problem. The implementation is based in the\n\
426 descriptions found in\n\
428 E. Cuthill, J. McKee. @cite{Reducing the Bandwidth of Sparse Symmetric\n\
429 Matrices}. Proceedings of the 24th ACM National Conference, 157--172\n\
430 1969, Brandon Press, New Jersey.\n\
432 A. George, J.W.H. Liu. @cite{Computer Solution of Large Sparse\n\
433 Positive Definite Systems}, Prentice Hall Series in Computational\n\
434 Mathematics, ISBN 0-13-165274-5, 1981.\n\
436 @seealso{colperm, colamd, symamd}\n\
440 int nargin = args.
length ();
483 if (nr == 0 && nc == 0)
542 for (i = 0; i <
N; i++)
588 while (j1 < cidx[i+1] || j2 < cidx2[i+1])
604 else if (j2 == cidx2[i+1])