25 for (index = 0; index < M->
ncol+1; index++) M_copy->
p[index] = M->
p[index];
27 if (M->
nz)
for (index = 0; index < M->
ncol; index++) M_copy->
nz[index] = M->
nz[index];
30 for (index = 0; index < M->
nzmax; index++)
32 M_copy->
i[index] = M->
i[index];
33 if (M->
values) M_copy->
x[index] = M->
x[index];
41 for (index = 0; index < size; index++)
50 for (index = 0; index < size; index++)
ladel_sparse_matrix * ladel_sparse_allocate_and_copy(ladel_sparse_matrix *M)
Copies a matrix into a newly allocated one.
void ladel_sparse_copy(ladel_sparse_matrix *M, ladel_sparse_matrix *M_copy)
Copies a matrix (preallocated)
void ladel_int_vector_copy(ladel_int *x, ladel_int size, ladel_int *y)
Copies an integer vector (preallocated)
void ladel_double_vector_copy(ladel_double *x, ladel_int size, ladel_double *y)
Copies a double vector (preallocated)
Routines to copy matrices and vectors.
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.
void * ladel_free(void *p)
Version of free (for mex or for regular C).
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
double ladel_double
Type for floating point numbers (default: double)
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 nzmax
number of nonzeros
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)