H2Lib  3.0
Data Structures | Typedefs | Functions
sparsematrix.h File Reference
#include "basic.h"
#include "avector.h"
#include "sparsepattern.h"
#include "krylov.h"

Go to the source code of this file.

Data Structures

struct  _sparsematrix
 Representation of a sparse matrix in compressed row format. More...
 

Typedefs

typedef struct _sparsematrix sparsematrix
 Representation of a sparse matrix in compressed row format.
 
typedef sparsematrixpsparsematrix
 Pointer to sparsematrix object.
 
typedef const sparsematrixpcsparsematrix
 Pointer to constant sparsematrix object.
 

Functions

psparsematrix new_raw_sparsematrix (uint rows, uint cols, uint nz)
 Create a sparsematrix object without initializing its arrays. More...
 
psparsematrix new_identity_sparsematrix (uint rows, uint cols)
 Creates a new sparsematrix object and initializes it to the idenity matrix $I \in \mathbb R^{n \times m}$. More...
 
psparsematrix new_zero_sparsematrix (psparsepattern sp)
 Create a sparsematrix based on a sparsepattern. More...
 
void del_sparsematrix (psparsematrix a)
 Delete a sparsematrix object. More...
 
field addentry_sparsematrix (psparsematrix a, uint row, uint col, field x)
 Add to a matrix entry, $a_{ij} \gets a_{ij} + x$. More...
 
void setentry_sparsematrix (psparsematrix a, uint row, uint col, field x)
 Set a matrix entry, $a_{ij} \gets x$. More...
 
size_t getsize_sparsematrix (pcsparsematrix a)
 Get size of a given sparsematrix object. More...
 
void sort_sparsematrix (psparsematrix a)
 Sort non-zero entries to ensure that diagonal entries come first. More...
 
void clear_sparsematrix (psparsematrix a)
 Set a matrix to zero. More...
 
void print_sparsematrix (pcsparsematrix a)
 Print a sparse matrix. More...
 
void print_eps_sparsematrix (pcsparsematrix a, const char *filename, uint offset)
 Print matrix to a Postscript file. More...
 
void addeval_sparsematrix_avector (field alpha, pcsparsematrix a, pcavector x, pavector y)
 Multiply a matrix $A$ by a vector $x$, $y \gets y + \alpha A x$. More...
 
void addevaltrans_sparsematrix_avector (field alpha, pcsparsematrix a, pcavector x, pavector y)
 Multiply the adjoint of a matrix $A$ by a vector $x$, $y \gets y + \alpha A^* x$. More...
 
void mvm_sparsematrix_avector (field alpha, bool trans, pcsparsematrix a, pcavector x, pavector y)
 Multiply a matrix $A$ or its adjoint $A^*$ by a vector, $y \gets y + \alpha A x$ or $y \gets y + \alpha A^* x$. More...
 
real norm2_sparsematrix (pcsparsematrix S)
 Approximate the spectral norm $\|S\|_2$ of a matrix $S$. More...
 
real norm2diff_sparsematrix (pcsparsematrix a, pcsparsematrix b)
 Approximate the spectral norm $\|A-B\|_2$ of the difference of two matrices $A$ and $B$. More...
 
void add_sparsematrix_amatrix (field alpha, bool atrans, pcsparsematrix a, pamatrix b)
 Add a sparsematrix to an amatrix, $B \gets B + \alpha A$ or $B \gets B + \alpha^* A$. More...
 

Detailed Description

Author
Steffen Börm