![]() |
Prev | Next |
matrix = module_ref sparse_rcv(pattern)
nr = matrix.nr()
nc = matrix.nc()
nnz = matrix.nnz()
matrix.put(k, v)
row = matrix.row()
col = matrix.col()
val = matrix.val()
row_major = matrix.row_major()
col_major = matrix.col_major()
const sparse_rc& pattern
It specifies the number of rows, number of columns and
the possibly non-zero entries in the
matrix
.
pattern
.
Only the
val
vector can be changed. All other values returned by
matrix
are fixed during the constructor and constant there after.
The
val
vector is only changed by the constructor
and the set
function.
int nr
and is the number of rows in the matrix.
int nc
and is the number of columns in the matrix.
int nnz
and is the number of possibly non-zero values in the matrix.
val[k] = v
(The name set
is used by Cppad, but not used here,
because set
it is a built-in name in Python.)
int k
and must be less than
nnz
.
double v
It specifies the value assigned to
val[k]
.
vec_int row
and its size is
nnz
.
For
k = 0, ..., nnz-1
,
row[k]
is the row index for the k
-th possibly non-zero
entry in the matrix.
vec_int col
and its size is
nnz
.
For
k = 0, ..., nnz-1
,
col[k]
is the column index for the k
-th possibly non-zero
entry in the matrix.
vec_double val
and its size is
nnz
.
For
k = 0, ..., nnz-1
,
val[k]
is the value of the k
-th possibly non-zero
entry in the matrix (the value may be zero).
vec_int row_major
and its size
nnz
.
It sorts the sparsity pattern in row-major order.
To be specific,
col[ row_major[k] ] <= col[ row_major[k+1] ]
and if
col[ row_major[k] ] == col[ row_major[k+1] ]
,
row[ row_major[k] ] < row[ row_major[k+1] ]
This routine generates an assert if there are two entries with the same
row and column values (if NDEBUG
is not defined).
vec_int col_major
and its size
nnz
.
It sorts the sparsity pattern in column-major order.
To be specific,
row[ col_major[k] ] <= row[ col_major[k+1] ]
and if
row[ col_major[k] ] == row[ col_major[k+1] ]
,
col[ col_major[k] ] < col[ col_major[k+1] ]
This routine generates an assert if there are two entries with the same
row and column values (if NDEBUG
is not defined).