A.I.M.S


aims::SparseMatrix Class Reference

#include <aims/sparsematrix/sparseMatrix.h>

Inheritance diagram for aims::SparseMatrix:
Collaboration diagram for aims::SparseMatrix:

Public Types

typedef
boost_sparse_matrix::reference 
reference
 
typedef
boost_sparse_matrix::const_reference 
const_reference
 
typedef
boost_sparse_matrix::iterator1 
iterator1
 
typedef
boost_sparse_matrix::iterator2 
iterator2
 
typedef
boost_sparse_matrix::const_iterator1 
const_iterator1
 
typedef
boost_sparse_matrix::const_iterator2 
const_iterator2
 

Public Member Functions

 SparseMatrix (int32_t size1=1, int32_t size2=1)
 
 SparseMatrix (const SparseMatrix &other)
 
virtual ~SparseMatrix ()
 
SparseMatrixoperator= (const SparseMatrix &other)
 
void reallocate (int32_t size1, int32_t size2)
 
iterator1 begin1 ()
 
iterator1 end1 ()
 
const_iterator1 begin1 () const
 
const_iterator1 end1 () const
 
iterator2 begin2 ()
 
iterator2 end2 ()
 
const_iterator2 begin2 () const
 
const_iterator2 end2 () const
 
int32_t getSize1 () const
 
int32_t getSize2 () const
 
int32_t getNonZeroElementCount () const
 
bool hasElement (int32_t i, int32_t j) const
 
const_reference operator() (int32_t i, int32_t j) const
 
reference operator() (int32_t i, int32_t j)
 
bool isSquare () const
 
void setZero ()
 
void setIdentity ()
 
void setRow (int32_t s1, const std::vector< double > &row)
 
void setColumn (int32_t s2, const std::vector< double > &column)
 
void fill (const double &value)
 
void fill (int32_t offset1, int32_t offset2, int32_t size1, int32_t size2, const double &value)
 
void fill (int32_t offset1, int32_t offset2, const SparseMatrix &other, int32_t size1=0, int32_t size2=0)
 
void setDiagonal (const double &value)
 
void transpose ()
 
double getTrace () const
 
SparseMatrix getTransposition () const
 
SparseMatrix getComposition (const SparseMatrix &other) const
 
std::vector< double > getComposition (const std::vector< double > &other) const
 
std::vector< double > toVector () const
 
std::vector< double > getRow (int32_t i) const
 
std::vector< double > getColumn (int32_t j) const
 
template<typename VectorType >
VectorType getSparseRow (int32_t i) const
 
template<typename VectorType >
VectorType getSparseColumn (int32_t i) const
 
void erase_element (int32_t i, int32_t j)
 
void read (const std::string &filename, const std::string &openmode="binar", bool bswap=false)
 Avoid using this function, prefer the more standard Reader<SparseMatrix> instead. More...
 
void write (const std::string &filename, const std::string &openmode="binar", bool bswap=false) const
 Avoid using this function, prefer the more standard Writer<SparseMatrix> instead. More...
 
aims::SparseMatrixoperator+= (const aims::SparseMatrix &thing)
 
aims::SparseMatrixoperator-= (const aims::SparseMatrix &thing)
 
aims::SparseMatrixoperator*= (double x)
 
aims::SparseMatrixoperator/= (double x)
 
boost_sparse_matrixboostMatrix ()
 for low-level boost operations More...
 
const boost_sparse_matrixboostMatrix () const
 
carto::Object header ()
 
const carto::Object header () const
 
void setHeader (carto::Object ph)
 

Protected Attributes

boost_sparse_matrix _matrix
 
carto::Object _header
 

Detailed Description

Definition at line 57 of file sparseMatrix.h.

Member Typedef Documentation

typedef boost_sparse_matrix::const_iterator1 aims::SparseMatrix::const_iterator1

Definition at line 71 of file sparseMatrix.h.

typedef boost_sparse_matrix::const_iterator2 aims::SparseMatrix::const_iterator2

Definition at line 73 of file sparseMatrix.h.

typedef boost_sparse_matrix::const_reference aims::SparseMatrix::const_reference

Definition at line 65 of file sparseMatrix.h.

typedef boost_sparse_matrix::iterator1 aims::SparseMatrix::iterator1

Definition at line 67 of file sparseMatrix.h.

typedef boost_sparse_matrix::iterator2 aims::SparseMatrix::iterator2

Definition at line 68 of file sparseMatrix.h.

typedef boost_sparse_matrix::reference aims::SparseMatrix::reference

Definition at line 63 of file sparseMatrix.h.

Constructor & Destructor Documentation

aims::SparseMatrix::SparseMatrix ( int32_t  size1 = 1,
int32_t  size2 = 1 
)
aims::SparseMatrix::SparseMatrix ( const SparseMatrix other)
virtual aims::SparseMatrix::~SparseMatrix ( )
virtual

Member Function Documentation

iterator1 aims::SparseMatrix::begin1 ( )
const_iterator1 aims::SparseMatrix::begin1 ( ) const
iterator2 aims::SparseMatrix::begin2 ( )
const_iterator2 aims::SparseMatrix::begin2 ( ) const
boost_sparse_matrix& aims::SparseMatrix::boostMatrix ( )
inline

for low-level boost operations

Definition at line 162 of file sparseMatrix.h.

References _matrix.

const boost_sparse_matrix& aims::SparseMatrix::boostMatrix ( ) const
inline

Definition at line 163 of file sparseMatrix.h.

References _matrix.

iterator1 aims::SparseMatrix::end1 ( )
const_iterator1 aims::SparseMatrix::end1 ( ) const
iterator2 aims::SparseMatrix::end2 ( )
const_iterator2 aims::SparseMatrix::end2 ( ) const
void aims::SparseMatrix::erase_element ( int32_t  i,
int32_t  j 
)
void aims::SparseMatrix::fill ( const double &  value)
void aims::SparseMatrix::fill ( int32_t  offset1,
int32_t  offset2,
int32_t  size1,
int32_t  size2,
const double &  value 
)
void aims::SparseMatrix::fill ( int32_t  offset1,
int32_t  offset2,
const SparseMatrix other,
int32_t  size1 = 0,
int32_t  size2 = 0 
)
std::vector<double> aims::SparseMatrix::getColumn ( int32_t  j) const
SparseMatrix aims::SparseMatrix::getComposition ( const SparseMatrix other) const
std::vector<double> aims::SparseMatrix::getComposition ( const std::vector< double > &  other) const
int32_t aims::SparseMatrix::getNonZeroElementCount ( ) const
std::vector<double> aims::SparseMatrix::getRow ( int32_t  i) const
int32_t aims::SparseMatrix::getSize1 ( ) const
int32_t aims::SparseMatrix::getSize2 ( ) const
template<typename VectorType >
VectorType aims::SparseMatrix::getSparseColumn ( int32_t  i) const
inline

Definition at line 211 of file sparseMatrix.h.

template<typename VectorType >
VectorType aims::SparseMatrix::getSparseRow ( int32_t  i) const
inline

Definition at line 179 of file sparseMatrix.h.

double aims::SparseMatrix::getTrace ( ) const
SparseMatrix aims::SparseMatrix::getTransposition ( ) const
bool aims::SparseMatrix::hasElement ( int32_t  i,
int32_t  j 
) const
carto::Object aims::SparseMatrix::header ( )
inline

Definition at line 165 of file sparseMatrix.h.

References _header.

const carto::Object aims::SparseMatrix::header ( ) const
inline

Definition at line 166 of file sparseMatrix.h.

References _header.

bool aims::SparseMatrix::isSquare ( ) const
const_reference aims::SparseMatrix::operator() ( int32_t  i,
int32_t  j 
) const
reference aims::SparseMatrix::operator() ( int32_t  i,
int32_t  j 
)
aims::SparseMatrix& aims::SparseMatrix::operator*= ( double  x)
aims::SparseMatrix& aims::SparseMatrix::operator+= ( const aims::SparseMatrix thing)
aims::SparseMatrix& aims::SparseMatrix::operator-= ( const aims::SparseMatrix thing)
aims::SparseMatrix& aims::SparseMatrix::operator/= ( double  x)
SparseMatrix& aims::SparseMatrix::operator= ( const SparseMatrix other)
void aims::SparseMatrix::read ( const std::string &  filename,
const std::string &  openmode = "binar",
bool  bswap = false 
)

Avoid using this function, prefer the more standard Reader<SparseMatrix> instead.

void aims::SparseMatrix::reallocate ( int32_t  size1,
int32_t  size2 
)
void aims::SparseMatrix::setColumn ( int32_t  s2,
const std::vector< double > &  column 
)
void aims::SparseMatrix::setDiagonal ( const double &  value)
void aims::SparseMatrix::setHeader ( carto::Object  ph)
void aims::SparseMatrix::setIdentity ( )
void aims::SparseMatrix::setRow ( int32_t  s1,
const std::vector< double > &  row 
)
void aims::SparseMatrix::setZero ( )
std::vector<double> aims::SparseMatrix::toVector ( ) const
void aims::SparseMatrix::transpose ( )
void aims::SparseMatrix::write ( const std::string &  filename,
const std::string &  openmode = "binar",
bool  bswap = false 
) const

Avoid using this function, prefer the more standard Writer<SparseMatrix> instead.

Member Data Documentation

carto::Object aims::SparseMatrix::_header
protected

Definition at line 172 of file sparseMatrix.h.

Referenced by header().

boost_sparse_matrix aims::SparseMatrix::_matrix
protected

Definition at line 171 of file sparseMatrix.h.

Referenced by boostMatrix().


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