KrisLibrary  1.0.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Math::SparseMatrixTemplate_CR< T > Class Template Reference

Row-major, compressed-row sparse matrix. More...

#include <SparseMatrixTemplate.h>

Public Types

typedef SparseMatrixTemplate_CR< T > MyT
 
typedef VectorTemplate< T > VectorT
 
typedef MatrixTemplate< T > MatrixT
 

Public Member Functions

void initialize (int m, int n, int num_entries)
 
void resize (int m, int n, int num_entries)
 
void clear ()
 
T * getEntry (int i, int j)
 
const T * getEntry (int i, int j) const
 
void copy (const MyT &)
 
template<class T2 >
void copy (const SparseMatrixTemplate_CR< T2 > &)
 
void set (const MatrixT &, T zeroTol=Zero)
 
void getCopy (MyT &m) const
 
void get (MatrixT &) const
 
void mul (const MyT &, T s)
 
void mul (const VectorT &y, VectorT &x) const
 
void mulTranspose (const VectorT &y, VectorT &x) const
 
void madd (const VectorT &y, VectorT &x) const
 
void maddTranspose (const VectorT &y, VectorT &x) const
 
void mul (const MatrixT &w, MatrixT &v) const
 
void mulTranspose (const MatrixT &w, MatrixT &v) const
 
dotRow (int i, const VectorT &) const
 
dotCol (int j, const VectorT &) const
 
dotSymmL (int i, const VectorT &) const
 
void inplaceMul (T c)
 
void inplaceDiv (T c)
 
void inplaceMulRow (int i, T c)
 
void inplaceMulCol (int i, T c)
 
bool isValid () const
 
bool isEmpty () const
 
bool hasDims (int M, int N) const
 
bool isSquare () const
 
bool isValidRow (int i) const
 
bool isValidCol (int j) const
 
bool isValidIndex (int i, int j) const
 
int * rowIndices (int i) const
 
T * rowValues (int i) const
 
int numRowEntries (int i) const
 

Static Public Member Functions

static void self_test ()
 
static void self_test (int m, int n, int nnz)
 

Public Attributes

int * row_offsets
 
int * col_indices
 
T * val_array
 
int m
 
int n
 
int num_entries
 

Detailed Description

template<class T>
class Math::SparseMatrixTemplate_CR< T >

Row-major, compressed-row sparse matrix.

Like the above, except the rows are all fixed in a compressed, contiguous block of index/value pairs. The number of nonzero entries (and their locations) must be known in advance.


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