10 for (index = 0; index < nb_cols; index++)
13 nnz += (M->
nz) ? M->
nz[col] : M->
p[col+1] - M->
p[col];
21 for (index = 0; index < nb_cols; index++)
26 M_sub->
i[nnz] = M->
i[index_M];
27 M_sub->
x[nnz] = M->
x[index_M];
30 M_sub->
p[index+1] = nnz;
#define FALSE
For booleans.
#define LADEL_FOR(index, M, col)
Loop through a column of a sparse matrix.
Memory allocation routines.
ladel_sparse_matrix * ladel_sparse_alloc(ladel_int nrow, ladel_int ncol, ladel_int nzmax, ladel_int symmetry, ladel_int values, ladel_int nz)
Allocate a sparse matrix.
ladel_sparse_matrix * ladel_sparse_alloc_empty(ladel_int nrow, ladel_int ncol, ladel_int symmetry, ladel_int values, ladel_int nz)
Allocate a sparse empty matrix (used in special cases).
ladel_sparse_matrix * ladel_column_submatrix(const ladel_sparse_matrix *M, const ladel_int *cols, ladel_int nb_cols)
Returns a matrix that is a selection of columns of M, that is .
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
Sparse matrix in compressed column storage.
ladel_int symmetry
type of symmetry (UNSYMMETRIC, UPPER or LOWER)
ladel_int ncol
number of columns
ladel_double * x
numerical values (size nzmax)
ladel_int * p
column pointers (size ncol+1)
ladel_int * nz
(optional) number of elements in each column (size ncol)
ladel_int values
has numerical values
ladel_int nrow
number of rows
ladel_int * i
row pointers (size nzmax)