40 #ifdef USE_64_BIT_IDX_T
41 #define CXSPARSE_NAME(name) cs_dl ## name
43 #define CXSPARSE_NAME(name) cs_di ## name
51 ret.
xelem (i) = p[i] + 1;
87 if (nargout <= 1 || rank)
89 #if defined(CS_VER) && (CS_VER >= 2)
98 if (jmatch[nr+i] >= 0)
100 retval(0) =
static_cast<double>(r);
103 retval(0) =
put_int (jmatch + nr, nc);
108 #if defined(CS_VER) && (CS_VER >= 2)
116 #if defined(CS_VER) && (CS_VER >= 2)
117 retval(3) =
put_int (dm->s, dm->nb+1);
118 retval(2) =
put_int (dm->r, dm->nb+1);
119 retval(1) =
put_int (dm->q, nc);
120 retval(0) =
put_int (dm->p, nr);
122 retval(3) =
put_int (dm->S, dm->nb+1);
123 retval(2) =
put_int (dm->R, dm->nb+1);
124 retval(1) =
put_int (dm->Q, nc);
125 retval(0) =
put_int (dm->P, nr);
136 @deftypefn {Loadable Function} {@var{p} =} dmperm (@var{S})\n\
137 @deftypefnx {Loadable Function} {[@var{p}, @var{q}, @var{r}, @var{S}] =} dmperm (@var{S})\n\
139 @cindex @nospell{Dulmage-Mendelsohn} decomposition\n\
140 Perform a @nospell{Dulmage-Mendelsohn} permutation of the sparse matrix\n\
143 With a single output argument @code{dmperm} performs the row permutations\n\
144 @var{p} such that @code{@var{S}(@var{p},:)} has no zero elements on the\n\
147 Called with two or more output arguments, returns the row and column\n\
148 permutations, such that @code{@var{S}(@var{p}, @var{q})} is in block\n\
149 triangular form. The values of @var{r} and @var{S} define the boundaries\n\
150 of the blocks. If @var{S} is square then @code{@var{r} == @var{S}}.\n\
152 The method used is described in: @nospell{A. Pothen & C.-J. Fan.}\n\
153 @cite{Computing the Block Triangular Form of a Sparse Matrix}.\n\
154 ACM Trans. Math. Software, 16(4):303-324, 1990.\n\
155 @seealso{colamd, ccolamd}\n\
158 int nargin = args.length ();
170 error (
"dmperm: not available in this version of Octave");
194 @deftypefn {Loadable Function} {@var{p} =} sprank (@var{S})\n\
195 @cindex structural rank\n\
197 Calculate the structural rank of the sparse matrix @var{S}.\n\
199 Note that only the structure of the matrix is used in this calculation based\n\
200 on a @nospell{Dulmage-Mendelsohn} permutation to block triangular form. As\n\
201 such the numerical rank of the matrix @var{S} is bounded by\n\
202 @code{sprank (@var{S}) >= rank (@var{S})}. Ignoring floating point errors\n\
203 @code{sprank (@var{S}) == rank (@var{S})}.\n\
207 int nargin = args.length ();
219 error (
"sprank: not available in this version of Octave");
octave_idx_type * xridx(void)
bool is_real_type(void) const
octave_idx_type rows(void) const
OCTINTERP_API void print_usage(void)
octave_idx_type * xcidx(void)
void error(const char *fmt,...)
F77_RET_T const double const double double * d
#define CXSPARSE_NAME(name)
octave_idx_type nnz(void) const
octave_idx_type nzmax(void) const
octave_idx_type columns(void) const
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
T & xelem(octave_idx_type n)
#define DEFUN_DLD(name, args_name, nargout_name, doc)
static RowVector put_int(octave_idx_type *p, octave_idx_type n)
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
static octave_value_list dmperm_internal(bool rank, const octave_value arg, int nargout)