11 #ifndef SPARSEMATRIX_H 12 #define SPARSEMATRIX_H void addeval_sparsematrix_avector(field alpha, pcsparsematrix a, pcavector x, pavector y)
Multiply a matrix by a vector , .
void mvm_sparsematrix_avector(field alpha, bool trans, pcsparsematrix a, pcavector x, pavector y)
Multiply a matrix or its adjoint by a vector, or .
size_t getsize_sparsematrix(pcsparsematrix a)
Get size of a given sparsematrix object.
real norm2_sparsematrix(pcsparsematrix S)
Approximate the spectral norm of a matrix .
void clear_sparsematrix(psparsematrix a)
Set a matrix to zero.
void add_sparsematrix_amatrix(field alpha, bool atrans, pcsparsematrix a, pamatrix b)
Add a sparsematrix to an amatrix, or .
uint nz
Number of non-zero entries.
Definition: sparsematrix.h:48
void del_sparsematrix(psparsematrix a)
Delete a sparsematrix object.
unsigned uint
Unsigned integer type.
Definition: settings.h:70
pfield coeff
Coefficients of non-zero entries.
Definition: sparsematrix.h:56
double _Complex field
Field type.
Definition: settings.h:171
void sort_sparsematrix(psparsematrix a)
Sort non-zero entries to ensure that diagonal entries come first.
const sparsematrix * pcsparsematrix
Pointer to constant sparsematrix object.
Definition: sparsematrix.h:34
sparsematrix * psparsematrix
Pointer to sparsematrix object.
Definition: sparsematrix.h:31
real norm2diff_sparsematrix(pcsparsematrix a, pcsparsematrix b)
Approximate the spectral norm of the difference of two matrices and .
void print_eps_sparsematrix(pcsparsematrix a, const char *filename, uint offset)
Print matrix to a Postscript file.
field addentry_sparsematrix(psparsematrix a, uint row, uint col, field x)
Add to a matrix entry, .
Representation of the sparsity pattern of a matrix.
Definition: sparsepattern.h:43
void print_sparsematrix(pcsparsematrix a)
Print a sparse matrix.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
double real
real floating point type.
Definition: settings.h:97
psparsematrix new_raw_sparsematrix(uint rows, uint cols, uint nz)
Create a sparsematrix object without initializing its arrays.
void setentry_sparsematrix(psparsematrix a, uint row, uint col, field x)
Set a matrix entry, .
uint cols
Number of columns.
Definition: sparsematrix.h:46
uint * row
Starting indices for row representations in col and coeff.
Definition: sparsematrix.h:52
uint * col
Column indices of non-zero entries.
Definition: sparsematrix.h:54
field * pfield
Pointer to field array.
Definition: settings.h:185
Representation of a sparse matrix in compressed row format.
Definition: sparsematrix.h:42
Representation of a matrix as an array in column-major order.
Definition: amatrix.h:43
psparsematrix new_identity_sparsematrix(uint rows, uint cols)
Creates a new sparsematrix object and initializes it to the idenity matrix .
void addevaltrans_sparsematrix_avector(field alpha, pcsparsematrix a, pcavector x, pavector y)
Multiply the adjoint of a matrix by a vector , .
uint rows
Number of rows.
Definition: sparsematrix.h:44
psparsematrix new_zero_sparsematrix(psparsepattern sp)
Create a sparsematrix based on a sparsepattern.