CPPLapack
|
(DO NOT USE) Smart-temporary Real Double-precision Symmetric Sparse Matrix Class More...
#include <_dssmatrix.hpp>
(DO NOT USE) Smart-temporary Real Double-precision Symmetric Sparse Matrix Class
Definition at line 3 of file _dssmatrix.hpp.
_dssmatrix::_dssmatrix | ( | ) | [inline] |
_dssmatrix::_dssmatrix | ( | const _dssmatrix & | mat | ) | [inline] |
_dssmatrix::~_dssmatrix | ( | ) | [inline] |
_dssmatrix destructor
Definition at line 29 of file _dssmatrix-constructor.hpp.
_zhsmatrix _dssmatrix::to_zhsmatrix | ( | ) | const [inline] |
cast to _zhsmatrix
Definition at line 3 of file _dssmatrix-cast.hpp.
References _(), data, destroy(), n, and zhsmatrix::put().
_dgematrix _dssmatrix::to_dgematrix | ( | ) | const [inline] |
convert to _dgematrix
Definition at line 20 of file _dssmatrix-cast.hpp.
References _(), data, destroy(), m, n, and dgematrix::zero().
_dsymatrix _dssmatrix::to_dsymatrix | ( | ) | const [inline] |
convert to _dsymatrix
Definition at line 36 of file _dssmatrix-cast.hpp.
References _(), data, destroy(), n, and dsymatrix::zero().
_dgsmatrix _dssmatrix::to_dgsmatrix | ( | ) | const [inline] |
convert to _dgsmatrix
Definition at line 51 of file _dssmatrix-cast.hpp.
References _(), data, destroy(), m, n, dgsmatrix::put(), and dgsmatrix::zero().
double _dssmatrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for const object
Definition at line 3 of file _dssmatrix-io.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if( i<0 || j<0 || n<=i || n<=j ){ ERROR_REPORT; std::cerr << "The required component is out of the matrix size." << std::endl << "Your input was (" << i << "," << j << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG //// search (i,j) component //// const uint32_t ii(std::max(i,j)), jj(std::min(i,j)); for(std::vector<uint32_t>::iterator p=line[ii].begin(); p!=line[ii].end(); p++){ if(data[*p].i==ii && data[*p].j==jj){ return data[*p].v; } } //// (i,j) component was not found //// return 0.0; }
void _dssmatrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 62 of file _dssmatrix-io.hpp.
References data, and destroy().
{VERBOSE_REPORT; std::ofstream ofs(filename, std::ios::trunc); ofs.setf(std::cout.flags()); ofs.precision(std::cout.precision()); ofs.width(std::cout.width()); ofs.fill(std::cout.fill()); ofs << "#dssmatrix" << std::endl; for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){ ofs << it->i << " " << it->j << " " << it->v << std::endl; } ofs.close(); destroy(); }
void _dssmatrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _dssmatrix-misc.hpp.
Referenced by _dssmatrix(), dssmatrix::dssmatrix(), and dssmatrix::shallow_copy().
void _dssmatrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 12 of file _dssmatrix-misc.hpp.
Referenced by damax(), idamax(), operator*(), operator+(), dssmatrix::operator+=(), operator-(), dssmatrix::operator-=(), operator<<(), to_dgematrix(), to_dgsmatrix(), to_dsymatrix(), to_zhsmatrix(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const _dssmatrix & | mat | ||
) | [friend] |
Definition at line 29 of file _dssmatrix-io.hpp.
{VERBOSE_REPORT; for(long i=0; i<mat.n; i++){ for(long j=0; j<mat.n; j++){ if( i >= j ){ std::vector<uint32_t>::iterator q; for(q=mat.line[i].begin(); q!=mat.line[i].end(); q++){ if(long(mat.data[*q].j)==j){ break; } } if(q!=mat.line[i].end()){ s << " " << mat.data[*q].v << " "; } else{ s << " x "; } } else{//i<j std::vector<uint32_t>::iterator q; for(q=mat.line[i].begin(); q!=mat.line[i].end(); q++){ if(long(mat.data[*q].j)==j){ break; } } if(q!=mat.line[i].end()){ s << "{" << mat.data[*q].v << "}"; } else{ s << "{x}"; } } } s << std::endl; } mat.destroy(); return s; }
_dssmatrix t | ( | const dssmatrix & | mat | ) | [friend] |
return transposed dssmatrix
Definition at line 3 of file dssmatrix-calc.hpp.
search the index of element having the largest absolute value in 0-based numbering system
Definition at line 21 of file dssmatrix-calc.hpp.
return its largest absolute value
Definition at line 37 of file dssmatrix-calc.hpp.
const _dssmatrix& operator+ | ( | const _dssmatrix & | mat | ) | [friend] |
+_dssmatrix operator
Definition at line 3 of file _dssmatrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_dssmatrix operator- | ( | const _dssmatrix & | mat | ) | [friend] |
-_dssmatrix operator
Definition at line 10 of file _dssmatrix-unary.hpp.
_dgematrix operator+ | ( | const _dssmatrix & | , |
const dgematrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dssmatrix & | , |
const _dgematrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dssmatrix & | , |
const dsymatrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dssmatrix & | , |
const _dsymatrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dssmatrix & | , |
const dgbmatrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dssmatrix & | , |
const _dgbmatrix & | |||
) | [friend] |
_dgsmatrix operator+ | ( | const _dssmatrix & | , |
const dgsmatrix & | |||
) | [friend] |
_dgsmatrix operator+ | ( | const _dssmatrix & | , |
const _dgsmatrix & | |||
) | [friend] |
_dssmatrix operator+ | ( | const _dssmatrix & | matA, |
const dssmatrix & | matB | ||
) | [friend] |
_dssmatrix+dssmatrix operator
Definition at line 3 of file _dssmatrix-dssmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dssmatrix newmat(matA); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) +=it->v; } return _(newmat); }
_dssmatrix operator+ | ( | const _dssmatrix & | matA, |
const _dssmatrix & | matB | ||
) | [friend] |
_dssmatrix+_dssmatrix operator
Definition at line 3 of file _dssmatrix-_dssmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dssmatrix newmat(matA); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i, it->j) +=it->v; } matB.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dssmatrix & | , |
const dgematrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dssmatrix & | , |
const _dgematrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dssmatrix & | , |
const dsymatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dssmatrix & | , |
const _dsymatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dssmatrix & | , |
const dgbmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dssmatrix & | , |
const _dgbmatrix & | |||
) | [friend] |
_dgsmatrix operator- | ( | const _dssmatrix & | , |
const dgsmatrix & | |||
) | [friend] |
_dgsmatrix operator- | ( | const _dssmatrix & | , |
const _dgsmatrix & | |||
) | [friend] |
_dssmatrix operator- | ( | const _dssmatrix & | matA, |
const dssmatrix & | matB | ||
) | [friend] |
_dssmatrix-dssmatrix operator
Definition at line 25 of file _dssmatrix-dssmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dssmatrix newmat(matA); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) -=it->v; } return _(newmat); }
_dssmatrix operator- | ( | const _dssmatrix & | matA, |
const _dssmatrix & | matB | ||
) | [friend] |
_dssmatrix-_dssmatrix operator
Definition at line 26 of file _dssmatrix-_dssmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dssmatrix newmat(matA); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i, it->j) -=it->v; } matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dssmatrix & | , |
const dgematrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const _dgematrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const dsymatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const _dsymatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const dgbmatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const _dgbmatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const dgsmatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dssmatrix & | , |
const _dgsmatrix & | |||
) | [friend] |
_dssmatrix operator* | ( | const _dssmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dssmatrix operator* | ( | const _dssmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dssmatrix operator* | ( | const _dssmatrix & | mat, |
const double & | d | ||
) | [friend] |
_dssmatrix*double operator
Definition at line 3 of file _dssmatrix-double.hpp.
_dssmatrix operator/ | ( | const _dssmatrix & | mat, |
const double & | d | ||
) | [friend] |
_dssmatrix/double operator
Definition at line 14 of file _dssmatrix-double.hpp.
_dssmatrix operator* | ( | const double & | d, |
const _dssmatrix & | mat | ||
) | [friend] |
double*_dssmatrix operator
Definition at line 3 of file double-_dssmatrix.hpp.
long const& _dssmatrix::m [mutable] |
matrix row size
Definition at line 9 of file _dssmatrix.hpp.
Referenced by to_dgematrix(), and to_dgsmatrix().
long _dssmatrix::n [mutable] |
matrix column size
Definition at line 10 of file _dssmatrix.hpp.
Referenced by _(), _dssmatrix(), dssmatrix::dssmatrix(), nullify(), operator()(), operator*(), operator+(), dssmatrix::operator+=(), operator-(), dssmatrix::operator-=(), operator<<(), dssmatrix::shallow_copy(), to_dgematrix(), to_dgsmatrix(), to_dsymatrix(), and to_zhsmatrix().
std::vector<dcomponent> _dssmatrix::data [mutable] |
matrix data
Definition at line 11 of file _dssmatrix.hpp.
Referenced by _(), _dssmatrix(), damax(), destroy(), dssmatrix::dssmatrix(), idamax(), nullify(), operator()(), operator*(), operator+(), dssmatrix::operator+=(), operator-(), dssmatrix::operator-=(), operator/(), operator<<(), dssmatrix::shallow_copy(), to_dgematrix(), to_dgsmatrix(), to_dsymatrix(), to_zhsmatrix(), write(), and ~_dssmatrix().
std::vector< std::vector<uint32_t> > _dssmatrix::line [mutable] |
vector of vector to store the entry information of component for each row and column
Definition at line 12 of file _dssmatrix.hpp.
Referenced by _(), _dssmatrix(), destroy(), dssmatrix::dssmatrix(), nullify(), operator()(), operator<<(), dssmatrix::shallow_copy(), and ~_dssmatrix().