19 if (!A || !B)
return NULL;
28 for (col = 0; col < C_ncol; col++)
34 if (touched[row] != work->
flag)
36 touched[row] = work->
flag;
44 if (touched[row] != work->
flag)
46 touched[row] = work->
flag;
57 for (col = 0; col < C_ncol; col++)
63 if (touched[row] != work->
flag)
65 touched[row] = work->
flag;
69 if (C_values) temp[row] += A->
values ? alpha*A->
x[index] : 0;
74 if (touched[row] != work->
flag)
76 touched[row] = work->
flag;
80 if (C_values) temp[row] += B->
values ? beta*B->
x[index] : 0;
88 C->
x[index] = temp[row];
#define UNSYMMETRIC
No symmetry is assumed in the matrix.
#define TRUE
For booleans.
#define FALSE
For booleans.
#define LADEL_FOR(index, M, col)
Loop through a column of a sparse matrix.
#define LADEL_MAX(a, b)
Return the maximum of two numbers.
ladel_sparse_matrix * ladel_add_matrices_advanced(ladel_double alpha, const ladel_sparse_matrix *A, ladel_double beta, const ladel_sparse_matrix *B, ladel_int values, ladel_work *work)
Returns a sparse matrix if values==TRUE, or a pattern matrix that includes the patterns of A and B i...
ladel_sparse_matrix * ladel_add_matrices_pattern(const ladel_sparse_matrix *A, const ladel_sparse_matrix *B, ladel_work *work)
Returns a pattern matrix whose pattern includes the patterns of A and B.
ladel_sparse_matrix * ladel_add_matrices(ladel_double alpha, const ladel_sparse_matrix *A, ladel_double beta, const ladel_sparse_matrix *B, ladel_work *work)
Returns a sparse matrix .
Routines to add matrices.
Constants and macros used in LADEL.
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.
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 * p
column pointers (size ncol+1)
ladel_int values
has numerical values
ladel_int nrow
number of rows
ladel_int * i
row pointers (size nzmax)
Workspace required for various routines in LADEL.
ladel_int flag
Flag used to mark nodes, used in conjunction with array_int_ncol_flag.
ladel_int * array_int_ncol_flag
An array of ncol integers, assumed to be < flag.
ladel_double * array_double_all_zeros_ncol1
An array of ncol doubles, on input and output this should be all zeros.