9 ladel_int index, row, col, Mptemp, nzM = 0;
18 for (col = 0; col < M->
ncol; col++)
22 for (index = Mptemp; index < ((M->
nz) ? Mptemp + M->
nz[col] : M->
p[col+1]); index++)
28 if (M->
values) M->
x[nzM] = M->
x[index];
#define TRUE
For booleans.
#define LOWER
Use only lower part of matrix.
#define UPPER
Use only upper part of matrix.
void ladel_sparse_copy(ladel_sparse_matrix *M, ladel_sparse_matrix *M_copy)
Copies a matrix (preallocated)
Routines to print out matrices and vectors.
Memory allocation routines.
ladel_int ladel_sparse_realloc(ladel_sparse_matrix *M, ladel_int nzmax)
Reallocate a sparse matrix with a new size.
ladel_sparse_matrix * ladel_sparse_free(ladel_sparse_matrix *M)
Free a sparse matrix (and return NULL).
Routine to compute the transpose of a matrix.
ladel_sparse_matrix * ladel_transpose(ladel_sparse_matrix *M, ladel_int values, ladel_work *work)
Returns the transpose of a matrix, that is .
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
void ladel_to_upper_diag(ladel_sparse_matrix *M)
Return , that is the upper diagonal elements of M.
Routine to keep only the upper diagonal elements of a (symmetric) matrix.
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 * i
row pointers (size nzmax)