CPPLapack
|
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class More...
#include <_dgsmatrix.hpp>
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
Definition at line 3 of file _dgsmatrix.hpp.
_dgsmatrix::_dgsmatrix | ( | ) | [inline] |
_dgsmatrix::_dgsmatrix | ( | const _dgsmatrix & | mat | ) | [inline] |
_dgsmatrix::~_dgsmatrix | ( | ) | [inline] |
_dgsmatrix destructor
Definition at line 31 of file _dgsmatrix-constructor.hpp.
_zgsmatrix _dgsmatrix::to_zgsmatrix | ( | ) | const [inline] |
cast to _zgsmatrix
Definition at line 3 of file _dgsmatrix-cast.hpp.
References _(), data, destroy(), m, n, and zgsmatrix::put().
_dgematrix _dgsmatrix::to_dgematrix | ( | ) | const [inline] |
convert to _dgematrix
Definition at line 21 of file _dgsmatrix-cast.hpp.
References _(), data, destroy(), m, n, and dgematrix::zero().
Referenced by operator+(), and operator-().
double _dgsmatrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for const object
Definition at line 3 of file _dgsmatrix-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 0.0; }
void _dgsmatrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 51 of file _dgsmatrix-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 << "#dgsmatrix" << " " << m << " " << n << 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 _dgsmatrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _dgsmatrix-misc.hpp.
References cols, data, m, n, and rows.
Referenced by _dgsmatrix(), dgsmatrix::dgsmatrix(), and dgsmatrix::shallow_copy().
void _dgsmatrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 14 of file _dgsmatrix-misc.hpp.
References cols, data, and rows.
Referenced by damax(), idamax(), operator*(), dgsmatrix::operator*=(), operator+(), dgsmatrix::operator+=(), operator-(), dgsmatrix::operator-=(), operator<<(), to_dgematrix(), to_zgsmatrix(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const _dgsmatrix & | mat | ||
) | [friend] |
Definition at line 28 of file _dgsmatrix-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; }
_dgsmatrix t | ( | const dgsmatrix & | mat | ) | [friend] |
search the index of element having the largest absolute value in 0-based numbering system
Definition at line 21 of file dgsmatrix-calc.hpp.
return its largest absolute value
Definition at line 37 of file dgsmatrix-calc.hpp.
const _dgsmatrix& operator+ | ( | const _dgsmatrix & | mat | ) | [friend] |
+_dgsmatrix operator
Definition at line 3 of file _dgsmatrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_dgsmatrix operator- | ( | const _dgsmatrix & | mat | ) | [friend] |
-_dgsmatrix operator
Definition at line 10 of file _dgsmatrix-unary.hpp.
_dgematrix operator+ | ( | const _dgsmatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgsmatrix+dgematrix operator
Definition at line 3 of file _dgsmatrix-dgematrix.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 dgematrix newmat(matB); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgsmatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgsmatrix+_dgematrix operator
Definition at line 3 of file _dgsmatrix-_dgematrix.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<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ matB(it->i,it->j) += it->v; } matA.destroy(); return matB; }
_dgematrix operator+ | ( | const _dgsmatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgsmatrix+dsymatrix operator
Definition at line 3 of file _dgsmatrix-dsymatrix.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 dgematrix newmat( matB.to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgsmatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgsmatrix+_dsymatrix operator
Definition at line 3 of file _dgsmatrix-_dsymatrix.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 dgematrix newmat( matB.to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgsmatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgsmatrix+dgbmatrix operator
Definition at line 3 of file _dgsmatrix-dgbmatrix.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 dgematrix newmat( matA.to_dgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(long(0),i-matB.kl); j<std::min(matB.n,i+matB.ku+1); j++){ newmat(i,j)+=matB(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgsmatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgsmatrix+_dgbmatrix operator
Definition at line 3 of file _dgsmatrix-_dgbmatrix.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 dgematrix newmat( matA.to_dgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(long(0),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); }
_dgsmatrix operator+ | ( | const _dgsmatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgsmatrix+dgsmatrix operator
Definition at line 3 of file _dgsmatrix-dgsmatrix.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 dgsmatrix 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); }
_dgsmatrix operator+ | ( | const _dgsmatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgsmatrix+_dgsmatrix operator
Definition at line 3 of file _dgsmatrix-_dgsmatrix.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 dgsmatrix 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); }
_dgsmatrix operator+ | ( | const _dgsmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgsmatrix operator+ | ( | const _dgsmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dgsmatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgsmatrix-dgematrix operator
Definition at line 25 of file _dgsmatrix-dgematrix.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 dgematrix newmat(-matB); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgsmatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgsmatrix-_dgematrix operator
Definition at line 24 of file _dgsmatrix-_dgematrix.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.m << "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]; } for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ matB(it->i,it->j) += it->v; } matA.destroy(); return matB; }
_dgematrix operator- | ( | const _dgsmatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgsmatrix-dsymatrix operator
Definition at line 25 of file _dgsmatrix-dsymatrix.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 dgematrix newmat( (-matB).to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgsmatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgsmatrix-_dsymatrix operator
Definition at line 26 of file _dgsmatrix-_dsymatrix.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.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG //// shallow copy to dgematrix //// dgematrix newmat( (-matB).to_dgematrix() ); //// add //// for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgsmatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgsmatrix-dgbmatrix operator
Definition at line 28 of file _dgsmatrix-dgbmatrix.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 dgematrix newmat( matA.to_dgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(long(0),i-matB.kl); j<std::min(matB.n,i+matB.ku+1); j++){ newmat(i,j)-=matB(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgsmatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgsmatrix-_dgbmatrix operator
Definition at line 28 of file _dgsmatrix-_dgbmatrix.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 dgematrix newmat( matA.to_dgematrix() ); for(long i=0; i<matB.m; i++){ for(long j=std::max(long(0),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); }
_dgsmatrix operator- | ( | const _dgsmatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgsmatrix-dgsmatrix operator
Definition at line 23 of file _dgsmatrix-dgsmatrix.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 dgsmatrix 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); }
_dgsmatrix operator- | ( | const _dgsmatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgsmatrix-_dgsmatrix operator
Definition at line 25 of file _dgsmatrix-_dgsmatrix.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 dgsmatrix 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); }
_dgsmatrix operator- | ( | const _dgsmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgsmatrix operator- | ( | const _dgsmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dcovector operator* | ( | const _dgsmatrix & | mat, |
const dcovector & | vec | ||
) | [friend] |
_dgsmatrix*dcovector operator
Definition at line 3 of file _dgsmatrix-dcovector.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 dcovector newvec(mat.m); newvec.zero(); for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->i) += it->v*vec(it->j); } mat.destroy(); return _(newvec); }
_dcovector operator* | ( | const _dgsmatrix & | mat, |
const _dcovector & | vec | ||
) | [friend] |
_dgsmatrix*_dcovector operator
Definition at line 3 of file _dgsmatrix-_dcovector.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 dcovector newvec(mat.m); newvec.zero(); for(std::vector<dcomponent>::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); }
_dgematrix operator* | ( | const _dgsmatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgsmatrix*dgematrix operator
Definition at line 47 of file _dgsmatrix-dgematrix.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 dgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<dcomponent>::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); }
_dgematrix operator* | ( | const _dgsmatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgsmatrix*_dgematrix operator
Definition at line 50 of file _dgsmatrix-_dgematrix.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 dgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<dcomponent>::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); }
_dgematrix operator* | ( | const _dgsmatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgsmatrix*dsymatrix operator
Definition at line 47 of file _dgsmatrix-dsymatrix.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 dgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<dcomponent>::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); }
_dgematrix operator* | ( | const _dgsmatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgsmatrix*_dsymatrix operator
Definition at line 52 of file _dgsmatrix-_dsymatrix.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 dgematrix newmat(matA.m, matB.n); newmat.zero(); for(std::vector<dcomponent>::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); }
_dgematrix operator* | ( | const _dgsmatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgsmatrix*dgbmatrix operator
Definition at line 53 of file _dgsmatrix-dgbmatrix.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 dgematrix newmat( matA.m, matB.n ); newmat.zero(); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long j=std::max(long(0),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); }
_dgematrix operator* | ( | const _dgsmatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgsmatrix*_dgbmatrix operator
Definition at line 53 of file _dgsmatrix-_dgbmatrix.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 dgematrix newmat( matA.m, matB.n ); newmat.zero(); for(std::vector<dcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){ for(long j=std::max(long(0),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); }
_dgsmatrix operator* | ( | const _dgsmatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgsmatrix*dgsmatrix operator
Definition at line 43 of file _dgsmatrix-dgsmatrix.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 dgsmatrix newmat( matA.m, matB.n ); for(std::vector<dcomponent>::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); }
_dgsmatrix operator* | ( | const _dgsmatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgsmatrix*_dgsmatrix operator
Definition at line 47 of file _dgsmatrix-_dgsmatrix.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 dgsmatrix newmat(matA.m, matB.n); for(std::vector<dcomponent>::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); }
_dgsmatrix operator* | ( | const _dgsmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgsmatrix operator* | ( | const _dgsmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgsmatrix operator* | ( | const _dgsmatrix & | mat, |
const double & | d | ||
) | [friend] |
_dgsmatrix*double operator
Definition at line 3 of file _dgsmatrix-double.hpp.
_dgsmatrix operator/ | ( | const _dgsmatrix & | mat, |
const double & | d | ||
) | [friend] |
_dgsmatrix/double operator
Definition at line 13 of file _dgsmatrix-double.hpp.
_dgsmatrix operator* | ( | const double & | d, |
const _dgsmatrix & | mat | ||
) | [friend] |
double*_dgsmatrix operator
Definition at line 3 of file double-_dgsmatrix.hpp.
long _dgsmatrix::m [mutable] |
matrix row size
Definition at line 9 of file _dgsmatrix.hpp.
Referenced by _(), _dgsmatrix(), dgsmatrix::dgsmatrix(), nullify(), operator()(), operator*(), dgsmatrix::operator*=(), operator+(), dgsmatrix::operator+=(), operator-(), dgsmatrix::operator-=(), operator<<(), dgsmatrix::shallow_copy(), to_dgematrix(), to_zgsmatrix(), and write().
long _dgsmatrix::n [mutable] |
matrix column size
Definition at line 10 of file _dgsmatrix.hpp.
Referenced by _(), _dgsmatrix(), dgsmatrix::dgsmatrix(), nullify(), operator()(), operator*(), dgsmatrix::operator*=(), operator+(), dgsmatrix::operator+=(), operator-(), dgsmatrix::operator-=(), operator<<(), dgsmatrix::shallow_copy(), to_dgematrix(), to_zgsmatrix(), and write().
std::vector<dcomponent> _dgsmatrix::data [mutable] |
matrix data
Definition at line 11 of file _dgsmatrix.hpp.
Referenced by _(), _dgsmatrix(), damax(), destroy(), dgsmatrix::dgsmatrix(), idamax(), nullify(), operator()(), operator*(), dgsmatrix::operator*=(), operator+(), dgsmatrix::operator+=(), operator-(), dgsmatrix::operator-=(), operator/(), operator<<(), dgsmatrix::shallow_copy(), t(), to_dgematrix(), to_zgsmatrix(), write(), and ~_dgsmatrix().
std::vector< std::vector<uint32_t> > _dgsmatrix::rows [mutable] |
array of vector to store the entry information of component for each row
Definition at line 12 of file _dgsmatrix.hpp.
Referenced by _(), _dgsmatrix(), destroy(), dgsmatrix::dgsmatrix(), nullify(), operator()(), operator*(), dgsmatrix::operator*=(), operator<<(), dgsmatrix::shallow_copy(), t(), and ~_dgsmatrix().
std::vector< std::vector<uint32_t> > _dgsmatrix::cols [mutable] |
array of vector to store the entry information of component for each column
Definition at line 13 of file _dgsmatrix.hpp.
Referenced by _(), _dgsmatrix(), destroy(), dgsmatrix::dgsmatrix(), nullify(), dgsmatrix::shallow_copy(), t(), and ~_dgsmatrix().