ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
SparseMatrix< T > Class Template Reference

#include <SparseMatrix.h>

Public Member Functions

MatrixEntry< T > * operator[] (int idx)
 
const MatrixEntry< T > * operator[] (int idx) const
 
 SparseMatrix (void)
 
 SparseMatrix (int rows)
 
 SparseMatrix (int rows, int maxEntriesPerRow)
 
void Resize (int rows)
 
void Resize (int rows, int maxEntriesPerRow)
 
void SetRowSize (int row, int count)
 
int Entries (void) const
 
 SparseMatrix (const SparseMatrix &M)
 
 ~SparseMatrix ()
 
void SetZero ()
 
SparseMatrix< T > & operator= (const SparseMatrix< T > &M)
 
SparseMatrix< T > operator* (const T &V) const
 
SparseMatrix< T > & operator*= (const T &V)
 
template<class T2 >
void Multiply (const T2 *in, T2 *out, int threads=1) const
 
template<class T2 >
void MultiplyAndAddAverage (const T2 *in, T2 *out, int threads=1) const
 
bool write (FILE *fp) const
 
bool write (const char *fileName) const
 
bool read (FILE *fp)
 
bool read (const char *fileName)
 
template<class T2 >
void getDiagonal (T2 *diagonal, int threads=1) const
 

Static Public Member Functions

template<class T2 >
static int SolveJacobi (const SparseMatrix< T > &M, const T2 *b, T2 *x, T2 *Mx, T2 sor, int threads=1)
 
template<class T2 >
static int SolveJacobi (const SparseMatrix< T > &M, const T2 *diagonal, const T2 *b, T2 *x, T2 *Mx, T2 sor, int threads=1)
 
template<class T2 >
static int SolveGS (const SparseMatrix< T > &M, const T2 *b, T2 *x, bool forward)
 
template<class T2 >
static int SolveGS (const SparseMatrix< T > &M, const T2 *diagonal, const T2 *b, T2 *x, bool forward)
 
template<class T2 >
static int SolveGS (const std::vector< std::vector< int > > &mcIndices, const SparseMatrix< T > &M, const T2 *diagonal, const T2 *b, T2 *x, bool forward, int threads=1)
 
template<class T2 >
static int SolveGS (const std::vector< std::vector< int > > &mcIndices, const SparseMatrix< T > &M, const T2 *b, T2 *x, bool forward, int threads=1)
 
template<class T2 >
static int SolveCG (const SparseMatrix< T > &M, const T2 *b, int iters, T2 *x, T2 eps=1e-8, int reset=1, bool addDCTerm=false, bool solveNormal=false, int threads=1)
 

Public Attributes

int rows
 
int * rowSizes
 
MatrixEntry< T > ** m_ppElements
 

Detailed Description

template<class T>
class SparseMatrix< T >

Definition at line 48 of file SparseMatrix.h.

Constructor & Destructor Documentation

◆ SparseMatrix() [1/4]

template<class T >
SparseMatrix< T >::SparseMatrix ( void  )

◆ SparseMatrix() [2/4]

template<class T >
SparseMatrix< T >::SparseMatrix ( int  rows)

◆ SparseMatrix() [3/4]

template<class T >
SparseMatrix< T >::SparseMatrix ( int  rows,
int  maxEntriesPerRow 
)

◆ SparseMatrix() [4/4]

template<class T >
SparseMatrix< T >::SparseMatrix ( const SparseMatrix< T > &  M)

◆ ~SparseMatrix()

template<class T >
SparseMatrix< T >::~SparseMatrix ( )

Member Function Documentation

◆ Entries()

template<class T >
int SparseMatrix< T >::Entries ( void  ) const

◆ getDiagonal()

template<class T >
template<class T2 >
void SparseMatrix< T >::getDiagonal ( T2 *  diagonal,
int  threads = 1 
) const

◆ Multiply()

template<class T >
template<class T2 >
void SparseMatrix< T >::Multiply ( const T2 *  in,
T2 *  out,
int  threads = 1 
) const

◆ MultiplyAndAddAverage()

template<class T >
template<class T2 >
void SparseMatrix< T >::MultiplyAndAddAverage ( const T2 *  in,
T2 *  out,
int  threads = 1 
) const

◆ operator*()

template<class T >
SparseMatrix<T> SparseMatrix< T >::operator* ( const T &  V) const

◆ operator*=()

template<class T >
SparseMatrix<T>& SparseMatrix< T >::operator*= ( const T &  V)

◆ operator=()

template<class T >
SparseMatrix<T>& SparseMatrix< T >::operator= ( const SparseMatrix< T > &  M)

◆ operator[]() [1/2]

template<class T >
MatrixEntry< T >* SparseMatrix< T >::operator[] ( int  idx)
inline

Definition at line 58 of file SparseMatrix.h.

References SparseMatrix< T >::m_ppElements.

◆ operator[]() [2/2]

template<class T >
const MatrixEntry< T >* SparseMatrix< T >::operator[] ( int  idx) const
inline

Definition at line 59 of file SparseMatrix.h.

References SparseMatrix< T >::m_ppElements.

◆ read() [1/2]

template<class T >
bool SparseMatrix< T >::read ( const char *  fileName)

◆ read() [2/2]

template<class T >
bool SparseMatrix< T >::read ( FILE *  fp)

◆ Resize() [1/2]

template<class T >
void SparseMatrix< T >::Resize ( int  rows)

◆ Resize() [2/2]

template<class T >
void SparseMatrix< T >::Resize ( int  rows,
int  maxEntriesPerRow 
)

◆ SetRowSize()

template<class T >
void SparseMatrix< T >::SetRowSize ( int  row,
int  count 
)

◆ SetZero()

template<class T >
void SparseMatrix< T >::SetZero ( )

◆ SolveCG()

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveCG ( const SparseMatrix< T > &  M,
const T2 *  b,
int  iters,
T2 *  x,
T2  eps = 1e-8,
int  reset = 1,
bool  addDCTerm = false,
bool  solveNormal = false,
int  threads = 1 
)
static

◆ SolveGS() [1/4]

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveGS ( const SparseMatrix< T > &  M,
const T2 *  b,
T2 *  x,
bool  forward 
)
static

◆ SolveGS() [2/4]

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveGS ( const SparseMatrix< T > &  M,
const T2 *  diagonal,
const T2 *  b,
T2 *  x,
bool  forward 
)
static

◆ SolveGS() [3/4]

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveGS ( const std::vector< std::vector< int > > &  mcIndices,
const SparseMatrix< T > &  M,
const T2 *  b,
T2 *  x,
bool  forward,
int  threads = 1 
)
static

◆ SolveGS() [4/4]

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveGS ( const std::vector< std::vector< int > > &  mcIndices,
const SparseMatrix< T > &  M,
const T2 *  diagonal,
const T2 *  b,
T2 *  x,
bool  forward,
int  threads = 1 
)
static

◆ SolveJacobi() [1/2]

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveJacobi ( const SparseMatrix< T > &  M,
const T2 *  b,
T2 *  x,
T2 *  Mx,
T2  sor,
int  threads = 1 
)
static

◆ SolveJacobi() [2/2]

template<class T >
template<class T2 >
static int SparseMatrix< T >::SolveJacobi ( const SparseMatrix< T > &  M,
const T2 *  diagonal,
const T2 *  b,
T2 *  x,
T2 *  Mx,
T2  sor,
int  threads = 1 
)
static

◆ write() [1/2]

template<class T >
bool SparseMatrix< T >::write ( const char *  fileName) const

◆ write() [2/2]

template<class T >
bool SparseMatrix< T >::write ( FILE *  fp) const

Member Data Documentation

◆ m_ppElements

template<class T >
MatrixEntry< T >* * SparseMatrix< T >::m_ppElements

Definition at line 57 of file SparseMatrix.h.

Referenced by SparseMatrix< T >::operator[]().

◆ rows

template<class T >
int SparseMatrix< T >::rows

Definition at line 55 of file SparseMatrix.h.

◆ rowSizes

template<class T >
int* SparseMatrix< T >::rowSizes

Definition at line 56 of file SparseMatrix.h.


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