Sparse matrix implementation. More...
#include <sparse_mat.h>
Public Member Functions | |
void | clear () |
Clear memory of matrix (=set to zero) | |
void | deleteColumn (int j) |
Delete column at index j (= set to zero) | |
void | deleteRow (int i) |
Delete row at index i (= set to zero) | |
void | get (std::vector< int > &i, std::vector< int > &j, std::vector< double > &v) |
Get a set of values defined by index vectors. | |
double | get (int i, int j) |
Get matrix values at index pair (i,j) | |
int | nonzeros () |
Get number of non-zero entries in matrix. | |
void | print () |
Print indices and values of non-zero entries. | |
void | printLong () |
Print all matrix entries with respect to size. | |
void | set (int i, int j, double v) |
Set matrix values at index pair (i,j) | |
void | size (int &si, int &sj) |
Get size of matrix with respect to last non-zero entries. | |
SparseMat () | |
Constructor clearing memory of matrix (=set to zero) | |
Protected Attributes | |
std::map< int, std::map< int, double > > | m_mat |
Sparse matrix implementation.
Definition at line 51 of file sparse_mat.h.
pcl::on_nurbs::SparseMat::SparseMat | ( | ) | [inline] |
Constructor clearing memory of matrix (=set to zero)
Definition at line 58 of file sparse_mat.h.
void pcl::on_nurbs::SparseMat::clear | ( | void | ) | [inline] |
Clear memory of matrix (=set to zero)
Definition at line 91 of file sparse_mat.h.
void SparseMat::deleteColumn | ( | int | j | ) |
Delete column at index j (= set to zero)
Definition at line 140 of file sparse_mat.cpp.
void SparseMat::deleteRow | ( | int | i | ) |
Delete row at index i (= set to zero)
Definition at line 128 of file sparse_mat.cpp.
void SparseMat::get | ( | std::vector< int > & | i, |
std::vector< int > & | j, | ||
std::vector< double > & | v | ||
) |
Get a set of values defined by index vectors.
[in] | i | vector of row indices |
[in] | j | vector of column indices |
[out] | v | vector of matrix entries at (i,j) |
Definition at line 44 of file sparse_mat.cpp.
double SparseMat::get | ( | int | i, |
int | j | ||
) |
Get matrix values at index pair (i,j)
[in] | i | row index |
[in] | j | column index return v matrix value at (i,j) |
Definition at line 70 of file sparse_mat.cpp.
int SparseMat::nonzeros | ( | ) |
Get number of non-zero entries in matrix.
Definition at line 190 of file sparse_mat.cpp.
void SparseMat::print | ( | ) |
Print indices and values of non-zero entries.
Definition at line 227 of file sparse_mat.cpp.
void SparseMat::printLong | ( | ) |
Print all matrix entries with respect to size.
Definition at line 208 of file sparse_mat.cpp.
void SparseMat::set | ( | int | i, |
int | j, | ||
double | v | ||
) |
Set matrix values at index pair (i,j)
[in] | i | row index |
[in] | j | column index |
[in] | v | matrix value at (i,j) |
Definition at line 88 of file sparse_mat.cpp.
void SparseMat::size | ( | int & | si, |
int & | sj | ||
) |
Get size of matrix with respect to last non-zero entries.
Definition at line 157 of file sparse_mat.cpp.
std::map<int, std::map<int, double> > pcl::on_nurbs::SparseMat::m_mat [protected] |
Definition at line 54 of file sparse_mat.h.