GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Macros | Functions
symrcm.cc File Reference
#include "ov.h"
#include "defun-dld.h"
#include "error.h"
#include "gripes.h"
#include "utils.h"
#include "oct-locbuf.h"
#include "ov-re-mat.h"
#include "ov-re-sparse.h"
#include "ov-cx-sparse.h"
#include "oct-sparse.h"
Include dependency graph for symrcm.cc:

Go to the source code of this file.

Classes

struct  CMK_Node

Macros

#define H_empty(H, h)   ((h) == 0)
#define LEFT(i)   (((i) << 1) + 1)
#define PARENT(i)   (((i) - 1) >> 1)
#define Q_empty(Q, N, qh, qt)   ((qh) == (qt))
#define RIGHT(i)   (((i) << 1) + 2)

Functions

static octave_idx_type calc_degrees (octave_idx_type N, const octave_idx_type *ridx, const octave_idx_type *cidx, octave_idx_type *D)
 DEFUN_DLD (symrcm, args,,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} symrcm (@var{S})\n\ Return the symmetric reverse Cuthill-McKee permutation of @var{S}.\n\ @var{p} is a permutation vector such that\n\ @code{@var{S}(@var{p}, @var{p})} tends to have its diagonal elements\n\ closer to the diagonal than @var{S}. This is a good preordering for LU\n\ or Cholesky@tie{}factorization of matrices that come from ``long, skinny''\n\ problems. It works for both symmetric and asymmetric @var{S}.\n\ \n\ The algorithm represents a heuristic approach to the NP-complete\n\ bandwidth minimization problem. The implementation is based in the\n\ descriptions found in\n\ \n\ E. Cuthill, J. McKee. @cite{Reducing the Bandwidth of Sparse Symmetric\n\ Matrices}. Proceedings of the 24th ACM National Conference, 157--172\n\ 1969, Brandon Press, New Jersey.\n\ \n\ A. George, J.W.H. Liu. @cite{Computer Solution of Large Sparse\n\ Positive Definite Systems}, Prentice Hall Series in Computational\n\ Mathematics, ISBN 0-13-165274-5, 1981.\n\ \n\ @seealso{colperm, colamd, symamd}\n\ @end deftypefn")
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 void H_heapify_min (CMK_Node *A, octave_idx_type i, octave_idx_type size)
static void H_insert (CMK_Node *H, octave_idx_type &h, const CMK_Node &o)
static CMK_Node H_remove_min (CMK_Node *H, octave_idx_type &h, int reorg)
static CMK_Node Q_deq (CMK_Node *Q, octave_idx_type N, octave_idx_type &qh)
static void Q_enq (CMK_Node *Q, octave_idx_type N, octave_idx_type &qt, const CMK_Node &o)
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)

Macro Definition Documentation

#define H_empty (   H,
 
)    ((h) == 0)

Definition at line 186 of file symrcm.cc.

Referenced by DEFUN_DLD().

#define LEFT (   i)    (((i) << 1) + 1)

Definition at line 109 of file symrcm.cc.

Referenced by H_heapify_min().

#define PARENT (   i)    (((i) - 1) >> 1)

Definition at line 113 of file symrcm.cc.

Referenced by H_insert().

#define Q_empty (   Q,
  N,
  qh,
  qt 
)    ((qh) == (qt))

Definition at line 104 of file symrcm.cc.

Referenced by DEFUN_DLD(), and find_starting_node().

#define RIGHT (   i)    (((i) << 1) + 2)

Definition at line 111 of file symrcm.cc.

Referenced by H_heapify_min().

Function Documentation

static octave_idx_type calc_degrees ( octave_idx_type  N,
const octave_idx_type ridx,
const octave_idx_type cidx,
octave_idx_type D 
)
static

Definition at line 330 of file symrcm.cc.

References N, and OCTAVE_QUIT.

Referenced by DEFUN_DLD().

DEFUN_DLD ( symrcm  ,
args   
)
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
static void H_heapify_min ( CMK_Node A,
octave_idx_type  i,
octave_idx_type  size 
)
static

Definition at line 119 of file symrcm.cc.

References LEFT, and RIGHT.

Referenced by H_remove_min().

static void H_insert ( CMK_Node H,
octave_idx_type h,
const CMK_Node o 
)
static

Definition at line 149 of file symrcm.cc.

References PARENT.

Referenced by DEFUN_DLD().

static CMK_Node H_remove_min ( CMK_Node H,
octave_idx_type h,
int  reorg 
)
inlinestatic

Definition at line 176 of file symrcm.cc.

References H_heapify_min().

Referenced by DEFUN_DLD().

static CMK_Node Q_deq ( CMK_Node Q,
octave_idx_type  N,
octave_idx_type qh 
)
inlinestatic

Definition at line 96 of file symrcm.cc.

Referenced by DEFUN_DLD(), and find_starting_node().

static void Q_enq ( CMK_Node Q,
octave_idx_type  N,
octave_idx_type qt,
const CMK_Node o 
)
inlinestatic

Definition at line 87 of file symrcm.cc.

Referenced by DEFUN_DLD(), and find_starting_node().

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 
)
static