CPPLapack
|
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class More...
#include <_zgsmatrix.hpp>
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
Definition at line 3 of file _zgsmatrix.hpp.
_zgsmatrix::_zgsmatrix | ( | ) | [inline] |
_zgsmatrix::_zgsmatrix | ( | const _zgsmatrix & | mat | ) | [inline] |
_zgsmatrix::~_zgsmatrix | ( | ) | [inline] |
_zgsmatrix destructor
Definition at line 33 of file _zgsmatrix-constructor.hpp.
_zgematrix _zgsmatrix::to_zgematrix | ( | ) | const [inline] |
convert to _zgematrix
Definition at line 3 of file _zgsmatrix-cast.hpp.
References _(), data, destroy(), m, n, and zgematrix::zero().
Referenced by operator+(), and operator-().
comple _zgsmatrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for const object
Definition at line 3 of file _zgsmatrix-io.hpp.
References data, i(), m, n, and rows.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if( i<0 || j<0 || m<=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 //////// for(std::vector<uint32_t>::iterator p=rows[i].begin(); p!=rows[i].end(); p++){ if( long(data[*p].j)==j ){ return data[*p].v; } } //////// (i,j) component was not found //////// return comple(0.0,0.0); }
void _zgsmatrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 51 of file _zgsmatrix-io.hpp.
References data, destroy(), m, and n.
{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 << "#zgsmatrix" << " " << m << " " << n << std::endl; for(std::vector<zcomponent>::const_iterator it=data.begin(); it!=data.end(); it++){ ofs << it->i << " " << it->j << " " << it->v << std::endl; } ofs.close(); destroy(); }
void _zgsmatrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _zgsmatrix-misc.hpp.
References cols, data, m, n, and rows.
Referenced by _zgsmatrix(), zgsmatrix::shallow_copy(), and zgsmatrix::zgsmatrix().
void _zgsmatrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 14 of file _zgsmatrix-misc.hpp.
References cols, data, and rows.
Referenced by damax(), idamax(), operator*(), zgsmatrix::operator*=(), operator+(), zgsmatrix::operator+=(), operator-(), zgsmatrix::operator-=(), operator<<(), to_zgematrix(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const _zgsmatrix & | mat | ||
) | [friend] |
Definition at line 28 of file _zgsmatrix-io.hpp.
{VERBOSE_REPORT; for(long i=0; i<mat.m; i++){ for(long j=0; j<mat.n; j++){ std::vector<uint32_t>::iterator q; for(q=mat.rows[i].begin(); q!=mat.rows[i].end(); q++){ if( long(mat.data[*q].j)==j ){ break; } } if(q!=mat.rows[i].end()){ s << " " << mat.data[*q].v; } else{ s << " x"; } } s << std::endl; } mat.destroy(); return s; }
_zgsmatrix t | ( | const zgsmatrix & | mat | ) | [friend] |
search the index of element having the largest absolute value in 0-based numbering system
Definition at line 53 of file zgsmatrix-calc.hpp.
return its largest absolute value
Definition at line 69 of file zgsmatrix-calc.hpp.
const _zgsmatrix& operator+ | ( | const _zgsmatrix & | mat | ) | [friend] |
+_zgsmatrix operator
Definition at line 3 of file _zgsmatrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_zgsmatrix operator- | ( | const _zgsmatrix & | mat | ) | [friend] |
-_zgsmatrix operator
Definition at line 10 of file _zgsmatrix-unary.hpp.
_zgematrix operator+ | ( | const _zgsmatrix & | matA, |
const zgematrix & | matB | ||
) | [friend] |
_zgsmatrix+zgematrix operator
Definition at line 3 of file _zgsmatrix-zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matB); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_zgematrix operator+ | ( | const _zgsmatrix & | matA, |
const _zgematrix & | matB | ||
) | [friend] |
_zgsmatrix+_zgematrix operator
Definition at line 3 of file _zgsmatrix-_zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ matB(it->i,it->j) += it->v; } matA.destroy(); return matB; }
_zgematrix operator+ | ( | const _zgsmatrix & | matA, |
const zhematrix & | matB | ||
) | [friend] |
_zgsmatrix+zhematrix operator
Definition at line 3 of file _zgsmatrix-zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.n || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matB.to_zgematrix() ); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_zgematrix operator+ | ( | const _zgsmatrix & | matA, |
const _zhematrix & | matB | ||
) | [friend] |
_zgsmatrix+_zhematrix operator
Definition at line 3 of file _zgsmatrix-_zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.n || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matB.to_zgematrix() ); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); matB.destroy(); return _(newmat); }
_zgematrix operator+ | ( | const _zgsmatrix & | matA, |
const zgbmatrix & | matB | ||
) | [friend] |
_zgsmatrix+zgbmatrix operator
Definition at line 3 of file _zgsmatrix-zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matA.to_zgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(0l,i-matB.kl); j<std::min(matB.n,i+matB.ku+1); j++){ newmat(i,j) +=matB(i,j); } } matA.destroy(); return _(newmat); }
_zgematrix operator+ | ( | const _zgsmatrix & | matA, |
const _zgbmatrix & | matB | ||
) | [friend] |
_zgsmatrix+_zgbmatrix operator
Definition at line 3 of file _zgsmatrix-_zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matA.to_zgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(0l,i-matB.kl); j<std::min(matB.n,i+matB.ku+1); j++){ newmat(i,j) +=matB(i,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_zgsmatrix operator+ | ( | const _zgsmatrix & | matA, |
const zgsmatrix & | matB | ||
) | [friend] |
_zgsmatrix+zgsmatrix operator
Definition at line 3 of file _zgsmatrix-zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgsmatrix newmat(matA); for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i, it->j) +=it->v; } return _(newmat); }
_zgsmatrix operator+ | ( | const _zgsmatrix & | matA, |
const _zgsmatrix & | matB | ||
) | [friend] |
_zgsmatrix+_zgsmatrix operator
Definition at line 3 of file _zgsmatrix-_zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgsmatrix newmat(matA); for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) += it->v; } matB.destroy(); return _(newmat); }
_zgsmatrix operator+ | ( | const _zgsmatrix & | , |
const zhsmatrix & | |||
) | [friend] |
_zgsmatrix operator+ | ( | const _zgsmatrix & | , |
const _zhsmatrix & | |||
) | [friend] |
_zgematrix operator- | ( | const _zgsmatrix & | matA, |
const zgematrix & | matB | ||
) | [friend] |
_zgsmatrix-zgematrix operator
Definition at line 25 of file _zgsmatrix-zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(-matB); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_zgematrix operator- | ( | const _zgsmatrix & | matA, |
const _zgematrix & | matB | ||
) | [friend] |
_zgsmatrix-_zgematrix operator
Definition at line 24 of file _zgsmatrix-_zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG //// change sign //// for(int i=0; i<matB.m*matB.n; i++){ matB.array[i] = -matB.array[i]; } //// add //// for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ matB(it->i,it->j) += it->v; } matA.destroy(); return matB; }
_zgematrix operator- | ( | const _zgsmatrix & | matA, |
const zhematrix & | matB | ||
) | [friend] |
_zgsmatrix-zhematrix operator
Definition at line 26 of file _zgsmatrix-zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.n || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG //// shallow copy to zgematrix //// zgematrix newmat( (-matB).to_zgematrix() ); //// add //// for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } //// return //// matA.destroy(); return _(newmat); }
_zgematrix operator- | ( | const _zgsmatrix & | matA, |
const _zhematrix & | matB | ||
) | [friend] |
_zgsmatrix-_zhematrix operator
Definition at line 27 of file _zgsmatrix-_zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.m!=matB.n || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG //// shallow copy to zgematrix //// zgematrix newmat( (-matB).to_zgematrix() ); //// add //// for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } //////// matA.destroy(); matB.destroy(); return _(newmat); }
_zgematrix operator- | ( | const _zgsmatrix & | matA, |
const zgbmatrix & | matB | ||
) | [friend] |
_zgsmatrix-zgbmatrix operator
Definition at line 28 of file _zgsmatrix-zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matA.to_zgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(0l,i-matB.kl); j<std::min(matB.n,i+matB.ku+1); j++){ newmat(i,j) -=matB(i,j); } } matA.destroy(); return _(newmat); }
_zgematrix operator- | ( | const _zgsmatrix & | matA, |
const _zgbmatrix & | matB | ||
) | [friend] |
_zgsmatrix-_zgbmatrix operator
Definition at line 29 of file _zgsmatrix-_zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matA.to_zgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(0l,i-matB.kl); j<std::min(matB.n,i+matB.ku+1); j++){ newmat(i,j) -=matB(i,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_zgsmatrix operator- | ( | const _zgsmatrix & | matA, |
const zgsmatrix & | matB | ||
) | [friend] |
_zgsmatrix-zgsmatrix operator
Definition at line 25 of file _zgsmatrix-zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgsmatrix newmat(matA); for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i, it->j) -=it->v; } return _(newmat); }
_zgsmatrix operator- | ( | const _zgsmatrix & | matA, |
const _zgsmatrix & | matB | ||
) | [friend] |
_zgsmatrix-_zgsmatrix operator
Definition at line 26 of file _zgsmatrix-_zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgsmatrix newmat(matA); for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) -= it->v; } matB.destroy(); return _(newmat); }
_zgsmatrix operator- | ( | const _zgsmatrix & | , |
const zhsmatrix & | |||
) | [friend] |
_zgsmatrix operator- | ( | const _zgsmatrix & | , |
const _zhsmatrix & | |||
) | [friend] |
_zcovector operator* | ( | const _zgsmatrix & | mat, |
const zcovector & | vec | ||
) | [friend] |
_zgsmatrix*zcovector operator
Definition at line 3 of file _zgsmatrix-zcovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(mat.n!=vec.l){ ERROR_REPORT; std::cerr << "These matrix and vector can not make a product." << std::endl << "Your input was (" << mat.m << "x" << mat.n << ") * (" << vec.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zcovector newvec(mat.m); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->i) += it->v*vec(it->j); } mat.destroy(); return _(newvec); }
_zcovector operator* | ( | const _zgsmatrix & | mat, |
const _zcovector & | vec | ||
) | [friend] |
_zgsmatrix*_zcovector operator
Definition at line 3 of file _zgsmatrix-_zcovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(mat.n!=vec.l){ ERROR_REPORT; std::cerr << "These matrix and vector can not make a product." << std::endl << "Your input was (" << mat.m << "x" << mat.n << ") * (" << vec.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zcovector newvec(mat.m); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->i) += it->v*vec(it->j); } mat.destroy(); vec.destroy(); return _(newvec); }
_zgematrix operator* | ( | const _zgsmatrix & | matA, |
const zgematrix & | matB | ||
) | [friend] |
_zgsmatrix*zgematrix operator
Definition at line 47 of file _zgsmatrix-zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long j=0; j<matB.n; j++){ newmat(it->i,j) += it->v*matB(it->j,j); } } matA.destroy(); return _(newmat); }
_zgematrix operator* | ( | const _zgsmatrix & | matA, |
const _zgematrix & | matB | ||
) | [friend] |
_zgsmatrix*_zgematrix operator
Definition at line 51 of file _zgsmatrix-_zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long j=0; j<matB.n; j++){ newmat(it->i,j) += it->v *matB(it->j,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_zgematrix operator* | ( | const _zgsmatrix & | matA, |
const zhematrix & | matB | ||
) | [friend] |
_zgsmatrix*zhematrix operator
Definition at line 50 of file _zgsmatrix-zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long i=0; i<matB.n; i++){ newmat(it->i,i) += it->v*matB(it->j,i); } } matA.destroy(); return _(newmat); }
_zgematrix operator* | ( | const _zgsmatrix & | matA, |
const _zhematrix & | matB | ||
) | [friend] |
_zgsmatrix*_zhematrix operator
Definition at line 52 of file _zgsmatrix-_zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long i=0; i<matB.n; i++){ newmat(it->i,i) += it->v*matB(it->j,i); } } matA.destroy(); matB.destroy(); return _(newmat); }
_zgematrix operator* | ( | const _zgsmatrix & | matA, |
const zgbmatrix & | matB | ||
) | [friend] |
_zgsmatrix*zgbmatrix operator
Definition at line 53 of file _zgsmatrix-zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matA.m, matB.n ); newmat.zero(); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long j=std::max(0l,long(it->j)-matB.kl); j<std::min(matB.n,long(it->j)+matB.ku+1); j++){ newmat(it->i,j) += it->v*matB(it->j,j); } } matA.destroy(); return _(newmat); }
_zgematrix operator* | ( | const _zgsmatrix & | matA, |
const _zgbmatrix & | matB | ||
) | [friend] |
_zgsmatrix*_zgbmatrix operator
Definition at line 55 of file _zgsmatrix-_zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix newmat( matA.m, matB.n ); newmat.zero(); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long j=std::max(0l,long(it->j)-matB.kl); j<std::min(matB.n,long(it->j)+matB.ku+1); j++){ newmat(it->i,j) += it->v*matB(it->j,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_zgsmatrix operator* | ( | const _zgsmatrix & | matA, |
const zgsmatrix & | matB | ||
) | [friend] |
_zgsmatrix*zgsmatrix operator
Definition at line 47 of file _zgsmatrix-zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgsmatrix newmat(matA.m, matB.n); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ long k(it->j); std::vector<uint32_t>::const_iterator p; for(p=matB.rows[k].begin(); p!=matB.rows[k].end(); p++){ newmat(it->i,matB.data[*p].j) +=it->v*matB.data[*p].v; } } matA.destroy(); return _(newmat); }
_zgsmatrix operator* | ( | const _zgsmatrix & | matA, |
const _zgsmatrix & | matB | ||
) | [friend] |
_zgsmatrix*_zgsmatrix operator
Definition at line 49 of file _zgsmatrix-_zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a product." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgsmatrix newmat(matA.m, matB.n); for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ long k(it->j); std::vector<uint32_t>::iterator p; for(p=matB.rows[k].begin(); p!=matB.rows[k].end(); p++){ newmat(it->i,matB.data[*p].j) += it->v*matB.data[*p].v; } } matA.destroy(); matB.destroy(); return _(newmat); }
_zgsmatrix operator* | ( | const _zgsmatrix & | , |
const zhsmatrix & | |||
) | [friend] |
_zgsmatrix operator* | ( | const _zgsmatrix & | , |
const _zhsmatrix & | |||
) | [friend] |
_zgsmatrix operator* | ( | const _zgsmatrix & | mat, |
const double & | d | ||
) | [friend] |
_zgsmatrix*double operator
Definition at line 3 of file _zgsmatrix-double.hpp.
_zgsmatrix operator* | ( | const _zgsmatrix & | mat, |
const comple & | d | ||
) | [friend] |
_zgsmatrix*comple operator
Definition at line 3 of file _zgsmatrix-complex.hpp.
_zgsmatrix operator/ | ( | const _zgsmatrix & | mat, |
const double & | d | ||
) | [friend] |
_zgsmatrix/double operator
Definition at line 13 of file _zgsmatrix-double.hpp.
_zgsmatrix operator/ | ( | const _zgsmatrix & | mat, |
const comple & | d | ||
) | [friend] |
_zgsmatrix/comple operator
Definition at line 13 of file _zgsmatrix-complex.hpp.
_zgsmatrix operator* | ( | const double & | d, |
const _zgsmatrix & | mat | ||
) | [friend] |
double*_zgsmatrix operator
Definition at line 3 of file double-_zgsmatrix.hpp.
_zgsmatrix operator* | ( | const comple & | d, |
const _zgsmatrix & | mat | ||
) | [friend] |
complex*_zgsmatrix operator
Definition at line 3 of file complex-_zgsmatrix.hpp.
long _zgsmatrix::m [mutable] |
matrix row size
Definition at line 9 of file _zgsmatrix.hpp.
Referenced by _(), _zgsmatrix(), nullify(), operator()(), operator*(), zgsmatrix::operator*=(), operator+(), zgsmatrix::operator+=(), operator-(), zgsmatrix::operator-=(), operator<<(), zgsmatrix::shallow_copy(), to_zgematrix(), write(), and zgsmatrix::zgsmatrix().
long _zgsmatrix::n [mutable] |
matrix column size
Definition at line 10 of file _zgsmatrix.hpp.
Referenced by _(), _zgsmatrix(), nullify(), operator()(), operator*(), zgsmatrix::operator*=(), operator+(), zgsmatrix::operator+=(), operator-(), zgsmatrix::operator-=(), operator<<(), zgsmatrix::shallow_copy(), to_zgematrix(), write(), and zgsmatrix::zgsmatrix().
std::vector<zcomponent> _zgsmatrix::data [mutable] |
matrix data
Definition at line 11 of file _zgsmatrix.hpp.
Referenced by _(), _zgsmatrix(), damax(), destroy(), idamax(), nullify(), operator()(), operator*(), zgsmatrix::operator*=(), operator+(), zgsmatrix::operator+=(), operator-(), zgsmatrix::operator-=(), operator/(), operator<<(), zgsmatrix::shallow_copy(), t(), to_zgematrix(), write(), zgsmatrix::zgsmatrix(), and ~_zgsmatrix().
std::vector< std::vector<uint32_t> > _zgsmatrix::rows [mutable] |
array of vector to store the entry information of component for each row
Definition at line 12 of file _zgsmatrix.hpp.
Referenced by _(), _zgsmatrix(), destroy(), nullify(), operator()(), operator*(), zgsmatrix::operator*=(), operator<<(), zgsmatrix::shallow_copy(), t(), zgsmatrix::zgsmatrix(), and ~_zgsmatrix().
std::vector< std::vector<uint32_t> > _zgsmatrix::cols [mutable] |
array of vector to store the entry information of component for each column
Definition at line 13 of file _zgsmatrix.hpp.
Referenced by _(), _zgsmatrix(), destroy(), nullify(), zgsmatrix::shallow_copy(), t(), zgsmatrix::zgsmatrix(), and ~_zgsmatrix().