OOCholmod
 All Classes Functions
Public Member Functions | Friends | List of all members
oocholmod::SparseMatrix Class Reference

#include <sparse_matrix.h>

Public Member Functions

 SparseMatrix (unsigned int nrow=0, unsigned int ncol=1, bool symmetric=false, int initialNumberOfElements=200)
 
 SparseMatrix (cholmod_sparse *sparse)
 
 SparseMatrix (SparseMatrix &&move)
 
SparseMatrixoperator= (SparseMatrix &&other)
 
SparseMatrixIter begin ()
 
SparseMatrixIter end ()
 
void symmetrize ()
 
DenseMatrix toDense () const
 
MatrixState getMatrixState () const
 
bool hasElement (unsigned int row, unsigned int column) const
 
void append (const SparseMatrix &m)
 
double norm (int norm) const
 
void dropSmallEntries (double tol=1e-7f)
 
size_t getNumberOfElements ()
 
void multiply (bool transpose, double alpha, double beta, const DenseMatrix &X, DenseMatrix &Y)
 
DenseMatrix multiply (bool transpose, double alpha, const DenseMatrix &X)
 
void transpose ()
 
void sumRows (DenseMatrix &outVector)
 
void setNullSpace (DenseMatrix &N)
 
void build ()
 
SparseMatrix copy () const
 
Factor analyze () const
 
void zero ()
 
void setSymmetry (Symmetry symmetry)
 
Symmetry getSymmetry () const
 
unsigned int getRows () const
 
unsigned int getColumns () const
 
void swap (SparseMatrix &other)
 
double operator() (unsigned int row, unsigned int column=0) const
 
double & operator() (unsigned int row, unsigned int column=0)
 
bool operator== (const SparseMatrix &RHS) const
 
bool operator!= (const SparseMatrix &RHS) const
 

Friends

class Factor
 
class SparseMatrixIter
 
SparseMatrix operator+ (const SparseMatrix &LHS, const SparseMatrix &RHS)
 
SparseMatrix && operator+ (SparseMatrix &&LHS, const SparseMatrix &RHS)
 
SparseMatrix && operator+ (const SparseMatrix &LHS, SparseMatrix &&RHS)
 
SparseMatrix && operator+ (SparseMatrix &&LHS, SparseMatrix &&RHS)
 
SparseMatrix operator- (const SparseMatrix &M)
 
SparseMatrix && operator- (SparseMatrix &&M)
 
SparseMatrix operator- (const SparseMatrix &LHS, const SparseMatrix &RHS)
 
SparseMatrix && operator- (SparseMatrix &&LHS, const SparseMatrix &RHS)
 
SparseMatrix && operator- (const SparseMatrix &LHS, SparseMatrix &&RHS)
 
SparseMatrix && operator- (SparseMatrix &&LHS, SparseMatrix &&RHS)
 
SparseMatrix operator* (const SparseMatrix &LHS, double RHS)
 
SparseMatrix && operator* (SparseMatrix &&LHS, double RHS)
 
SparseMatrix operator* (double LHS, const SparseMatrix &RHS)
 
SparseMatrix && operator* (double LHS, SparseMatrix &&RHS)
 
SparseMatrix operator* (const SparseMatrix &LHS, const SparseMatrix &RHS)
 
DenseMatrix operator* (const DenseMatrix &LHS, const SparseMatrix &RHS)
 
DenseMatrix operator* (const SparseMatrix &LHS, const DenseMatrix &RHS)
 
std::ostream & operator<< (std::ostream &os, const SparseMatrix &A)
 
SparseMatrix transposed (const SparseMatrix &M)
 
SparseMatrix && transposed (SparseMatrix &&M)
 
DenseMatrix solve (const SparseMatrix &A, const DenseMatrix &b)
 
SparseMatrix solve (const SparseMatrix &A, const SparseMatrix &b)
 
SparseMatrix solve (const Factor &F, const SparseMatrix &b)
 

Detailed Description

The sparse matrix must be used in the following way:

  1. Fill the matrix elements using the (unsigned int row, unsigned int column) function operator
  2. Call build()
  3. Update matrix with elements using the (unsigned int row, unsigned int column) function operator

Constructor & Destructor Documentation

oocholmod::SparseMatrix::SparseMatrix ( unsigned int  nrow = 0,
unsigned int  ncol = 1,
bool  symmetric = false,
int  initialNumberOfElements = 200 
)

nrow # of rows of A ncol # of columns of A initialNumberOfElements. If exceeded (during initialization of the matrix) the number of elements will automatically grow with a factor of 1.5

Member Function Documentation

void oocholmod::SparseMatrix::append ( const SparseMatrix m)

append an another matrix in the init state useful for parallel matrix assembly

void oocholmod::SparseMatrix::dropSmallEntries ( double  tol = 1e-7f)

Drop small entries from A, and entries in the ignored part of A if A is symmetric. keep entries with absolute values > tol

double oocholmod::SparseMatrix::norm ( int  norm) const

Returns the infinity-norm or 1-norm of a sparse matrix. All xtypes are supported. type of norm: 0: inf. norm, 1: 1-norm


The documentation for this class was generated from the following files: