CPPLapack
|
(DO NOT USE) Smart-temporary Real Double-precision General Band Matrix Class More...
#include <_dgbmatrix.hpp>
(DO NOT USE) Smart-temporary Real Double-precision General Band Matrix Class
Definition at line 3 of file _dgbmatrix.hpp.
_dgbmatrix::_dgbmatrix | ( | ) | [inline] |
_dgbmatrix::_dgbmatrix | ( | const _dgbmatrix & | mat | ) | [inline] |
_dgbmatrix::~_dgbmatrix | ( | ) | [inline] |
_dgbmatrix destructor
Definition at line 33 of file _dgbmatrix-constructor.hpp.
_zgbmatrix _dgbmatrix::to_zgbmatrix | ( | ) | const [inline] |
_dgematrix _dgbmatrix::to_dgematrix | ( | ) | const [inline] |
convert to _dgematrix
Definition at line 21 of file _dgbmatrix-cast.hpp.
double & _dgbmatrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for const object
Definition at line 3 of file _dgbmatrix-io.hpp.
References darray, i, kl, ku, and m.
Referenced by write().
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if( i<0 || j<0 || m<=i || n<=j || i-j>kl || j-i>ku ){ 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 //return array[ku+i+(kl+ku)*j]; return darray[j][ku-j+i]; }
void _dgbmatrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 42 of file _dgbmatrix-io.hpp.
References destroy(), i, kl, ku, m, n, and operator()().
{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 << "#dgbmatrix" << " " << m << " " << n << " " << kl << " " << ku << std::endl; for(long i=0; i<m; i++){ for(long j=std::max(long(0),i-kl); j<std::min(n,i+ku+1); j++){ ofs << operator()(i,j) << " "; } ofs << std::endl; } ofs.close(); destroy(); }
void _dgbmatrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _dgbmatrix-misc.hpp.
References array, darray, kl, ku, m, and n.
Referenced by _dgbmatrix(), dgbmatrix::dgbmatrix(), and dgbmatrix::shallow_copy().
void _dgbmatrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 15 of file _dgbmatrix-misc.hpp.
Referenced by operator*(), dgbmatrix::operator*=(), dgematrix::operator*=(), operator+(), dgbmatrix::operator+=(), dgematrix::operator+=(), operator-(), dgbmatrix::operator-=(), dgematrix::operator-=(), operator<<(), t(), to_dgematrix(), to_zgbmatrix(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const _dgbmatrix & | mat | ||
) | [friend] |
_dgbmatrix t | ( | const _dgbmatrix & | mat | ) | [friend] |
return its transposed dgbmatrix
Definition at line 3 of file _dgbmatrix-calc.hpp.
_dgematrix i | ( | const _dgbmatrix & | mat | ) | [friend] |
return its inverse matrix
Definition at line 19 of file _dgbmatrix-calc.hpp.
Referenced by operator()(), to_dgematrix(), to_zgbmatrix(), and write().
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(mat.m!=mat.n){ ERROR_REPORT; std::cerr << "This matrix is not square and has no inverse matrix." << std::endl << "Your input was (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgbmatrix mat_cp(mat); dgematrix mat_inv(mat_cp.m,mat_cp.n); mat_inv.identity(); mat_cp.dgbsv(mat_inv); return _(mat_inv); }
const _dgbmatrix& operator+ | ( | const _dgbmatrix & | mat | ) | [friend] |
+_dgbmatrix operator
Definition at line 3 of file _dgbmatrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_dgbmatrix operator- | ( | const _dgbmatrix & | mat | ) | [friend] |
_dgematrix operator+ | ( | const _dgbmatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgbmatrix+dgematrix operator
Definition at line 3 of file _dgbmatrix-dgematrix.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(matB); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgbmatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgbmatrix+_dgematrix operator
Definition at line 3 of file _dgbmatrix-_dgematrix.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 for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ matB(i,j)+=matA(i,j); } } matA.destroy(); return matB; }
_dgematrix operator+ | ( | const _dgbmatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgbmatrix+dsymatrix operator
Definition at line 3 of file _dgbmatrix-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(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j) +=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgbmatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgbmatrix+_dsymatrix operator
Definition at line 3 of file _dgbmatrix-_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.n, matB.n); for(long i=0; i<matA.m; i++){ for(long j=0; j<matB.n; j++){ newmat(i,j)=matB(i,j); } for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgbmatrix operator+ | ( | const _dgbmatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgbmatrix+dgbmatrix operator
Definition at line 3 of file _dgbmatrix-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 if(matA.kl>=matB.kl && matA.ku>=matB.ku){ 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++){ matA(i,j)+=matB(i,j); } } return matA; } else{ dgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku)); newmat.zero(); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } 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); } }
_dgbmatrix operator+ | ( | const _dgbmatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgbmatrix+_dgbmatrix operator
Definition at line 3 of file _dgbmatrix-_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 if(matA.kl>matB.kl && matA.ku>matB.ku){ 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++){ matA(i,j)+=matB(i,j); } } matB.destroy(); return matA; } else if(matB.kl>matA.kl && matB.ku>matA.ku){ for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ matB(i,j)+=matA(i,j); } } matA.destroy(); return matB; } else{ dgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku)); newmat.zero(); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } 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); } }
_dgematrix operator+ | ( | const _dgbmatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgbmatrix+dgsmatrix operator
Definition at line 3 of file _dgbmatrix-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 dgematrix newmat( matB.to_dgematrix() ); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgbmatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgbmatrix+_dgsmatrix operator
Definition at line 3 of file _dgbmatrix-_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 dgematrix newmat( matB.to_dgematrix() ); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dgbmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dgbmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dgbmatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgbmatrix-dgematrix operator
Definition at line 27 of file _dgbmatrix-dgematrix.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(-matB); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgbmatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgbmatrix-_dgematrix operator
Definition at line 26 of file _dgbmatrix-_dgematrix.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 for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ matB(i,j) =matA(i,j)-matB(i,j); } } matA.destroy(); return matB; }
_dgematrix operator- | ( | const _dgbmatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgbmatrix-dsymatrix operator
Definition at line 27 of file _dgbmatrix-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(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgbmatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgbmatrix-_dsymatrix operator
Definition at line 31 of file _dgbmatrix-_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.n, matB.n); for(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ newmat(i,j)=-matB(i,j); } for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgbmatrix operator- | ( | const _dgbmatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgbmatrix-dgbmatrix operator
Definition at line 44 of file _dgbmatrix-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 subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG if(matA.kl>=matB.kl && matA.ku>=matB.ku){ 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++){ matA(i,j)-=matB(i,j); } } return matA; } else{ dgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku)); newmat.zero(); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } 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); } } return _(newmat); } }
_dgbmatrix operator- | ( | const _dgbmatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgbmatrix-_dgbmatrix operator
Definition at line 57 of file _dgbmatrix-_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 subtraction." << std::endl << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG if(matA.kl>matB.kl && matA.ku>matB.ku){ 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++){ matA(i,j)-=matB(i,j); } } matB.destroy(); return matA; } else{ dgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku)); newmat.zero(); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)+=matA(i,j); } 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); } }
_dgematrix operator- | ( | const _dgbmatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgbmatrix-dgsmatrix operator
Definition at line 27 of file _dgbmatrix-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 dgematrix newmat( (-matB).to_dgematrix() ); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)-=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgbmatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgbmatrix-_dgsmatrix operator
Definition at line 28 of file _dgbmatrix-_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 dgematrix newmat( (-matB).to_dgematrix() ); for(long i=0; i<matA.m; i++){ for(long j=std::max(long(0),i-matA.kl); j<std::min(matA.n,i+matA.ku+1); j++){ newmat(i,j)-=matA(i,j); } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dgbmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dgbmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dcovector operator* | ( | const _dgbmatrix & | mat, |
const dcovector & | vec | ||
) | [friend] |
_dgbmatrix*dcovector operator
Definition at line 3 of file _dgbmatrix-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); dgbmv_( 'n', mat.m, mat.n, mat.kl, mat.ku, 1.0, mat.array, mat.kl+mat.ku+1, vec.array, 1, 0.0, newvec.array, 1 ); mat.destroy(); return _(newvec); }
_dcovector operator* | ( | const _dgbmatrix & | mat, |
const _dcovector & | vec | ||
) | [friend] |
_dgbmatrix*_dcovector operator
Definition at line 3 of file _dgbmatrix-_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); dgbmv_( 'n', mat.m, mat.n, mat.kl, mat.ku, 1.0, mat.array, mat.kl+mat.ku+1, vec.array, 1, 0.0, newvec.array, 1 ); mat.destroy(); vec.destroy(); return _(newvec); }
_dgematrix operator* | ( | const _dgbmatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgbmatrix*dgematrix operator
Definition at line 51 of file _dgbmatrix-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(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ for(long k=std::max(long(0),i-matA.kl); k<std::min(matA.n,i+matA.ku+1); k++){ newmat(i,j)+=matA(i,k)*matB(k,j); } } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgbmatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgbmatrix*_dgematrix operator
Definition at line 49 of file _dgbmatrix-_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(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ for(long k=std::max(long(0),i-matA.kl); k<std::min(matA.n,i+matA.ku+1); k++){ newmat(i,j)+=matA(i,k)*matB(k,j); } } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgbmatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgbmatrix*dgematrix operator
Definition at line 51 of file _dgbmatrix-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(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ for(long k=std::max(long(0),i-matA.kl); k<std::min(matA.n,i+matA.ku+1); k++){ newmat(i,j)+=matA(i,k)*matB(k,j); } } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgbmatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgbmatrix*_dsymatrix operator
Definition at line 59 of file _dgbmatrix-_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(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ for(long k=std::max(long(0),i-matA.kl); k<std::min(matA.n,i+matA.ku+1); k++){ newmat(i,j)+=matA(i,k)*matB(k,j); } } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgbmatrix operator* | ( | const _dgbmatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgbmatrix*dgbmatrix operator
Definition at line 84 of file _dgbmatrix-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 dgbmatrix newmat( matA.m, matB.n, std::min(matA.kl+matB.kl,matA.m-1), std::min(matA.ku+matB.ku,matB.n-1) ); newmat.zero(); for(long i=0; i<newmat.m; i++){ for(long j=std::max(long(0),i-newmat.kl); j<std::min(newmat.n,i+newmat.ku+1); j++){ for(long k=std::max( std::max(long(0),i-matA.kl), std::max(long(0),j-matB.ku) ); k< std::min( std::min(matA.n,i+matA.ku+1), std::min(matB.m,j+matB.kl+1) ); k++){ newmat(i,j)+= matA(i,k)*matB(k,j); } } } matA.destroy(); return _(newmat); }
_dgbmatrix operator* | ( | const _dgbmatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgbmatrix*_dgbmatrix operator
Definition at line 100 of file _dgbmatrix-_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 dgbmatrix newmat( matA.m, matB.n, std::min(matA.kl+matB.kl,matA.m-1), std::min(matA.ku+matB.ku,matB.n-1) ); newmat.zero(); for(long i=0; i<newmat.m; i++){ for(long j=std::max(long(0),i-newmat.kl); j<std::min(newmat.n,i+newmat.ku+1); j++){ for(long k=std::max( std::max(long(0),i-matA.kl), std::max(long(0),j-matB.ku) ); k< std::min( std::min(matA.n,i+matA.ku+1), std::min(matB.m,j+matB.kl+1) ); k++){ newmat(i,j)+= matA(i,k)*matB(k,j); } } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgbmatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgbmatrix*dgsmatrix operator
Definition at line 51 of file _dgbmatrix-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 dgematrix newmat( matA.m, matB.n ); newmat.zero(); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ for(long i=std::max(long(0),long(it->i)-(matA.ku+1)); i<std::min(matA.m,long(it->i)+matA.kl); i++){ newmat(i,it->j) += matA(i,it->i)*it->v; } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgbmatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgbmatrix*_dgsmatrix operator
Definition at line 53 of file _dgbmatrix-_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 dgematrix newmat( matA.m, matB.n ); newmat.zero(); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ for(long i=std::max(long(0),long(it->i)-(matA.ku+1)); i<std::min(matA.m,long(it->i)+matA.kl); i++){ newmat(i,it->j) += matA(i,it->i)*it->v; } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgbmatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dgbmatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgbmatrix operator* | ( | const _dgbmatrix & | mat, |
const double & | d | ||
) | [friend] |
_dgbmatrix operator/ | ( | const _dgbmatrix & | mat, |
const double & | d | ||
) | [friend] |
_dgbmatrix operator* | ( | const double & | d, |
const _dgbmatrix & | mat | ||
) | [friend] |
long _dgbmatrix::m [mutable] |
matrix row size
Definition at line 9 of file _dgbmatrix.hpp.
Referenced by _(), _dgbmatrix(), dgbmatrix::dgbmatrix(), i(), nullify(), operator()(), operator*(), dgbmatrix::operator*=(), dgematrix::operator*=(), operator+(), dgbmatrix::operator+=(), dgematrix::operator+=(), operator-(), dgbmatrix::operator-=(), dgematrix::operator-=(), operator<<(), dgbmatrix::shallow_copy(), t(), to_dgematrix(), to_zgbmatrix(), and write().
long _dgbmatrix::n [mutable] |
matrix column size
Definition at line 10 of file _dgbmatrix.hpp.
Referenced by _(), _dgbmatrix(), dgbmatrix::dgbmatrix(), i(), nullify(), operator*(), dgbmatrix::operator*=(), dgematrix::operator*=(), operator+(), dgbmatrix::operator+=(), dgematrix::operator+=(), operator-(), dgbmatrix::operator-=(), dgematrix::operator-=(), operator/(), operator<<(), dgbmatrix::shallow_copy(), t(), to_dgematrix(), to_zgbmatrix(), and write().
long _dgbmatrix::kl [mutable] |
lower band width
Definition at line 11 of file _dgbmatrix.hpp.
Referenced by _(), _dgbmatrix(), dgbmatrix::dgbmatrix(), nullify(), operator()(), operator*(), dgbmatrix::operator*=(), dgematrix::operator*=(), operator+(), dgbmatrix::operator+=(), dgematrix::operator+=(), operator-(), dgbmatrix::operator-=(), dgematrix::operator-=(), operator/(), operator<<(), dgbmatrix::shallow_copy(), t(), to_dgematrix(), to_zgbmatrix(), and write().
long _dgbmatrix::ku [mutable] |
upper band width
Definition at line 12 of file _dgbmatrix.hpp.
Referenced by _(), _dgbmatrix(), dgbmatrix::dgbmatrix(), nullify(), operator()(), operator*(), dgbmatrix::operator*=(), dgematrix::operator*=(), operator+(), dgbmatrix::operator+=(), dgematrix::operator+=(), operator-(), dgbmatrix::operator-=(), dgematrix::operator-=(), operator/(), operator<<(), dgbmatrix::shallow_copy(), t(), to_dgematrix(), to_zgbmatrix(), and write().
double* _dgbmatrix::array [mutable] |
1D array to store matrix data
Definition at line 13 of file _dgbmatrix.hpp.
Referenced by _(), _dgbmatrix(), destroy(), dgbmatrix::dgbmatrix(), nullify(), operator*(), operator-(), operator/(), dgbmatrix::shallow_copy(), to_zgbmatrix(), and ~_dgbmatrix().
double** _dgbmatrix::darray [mutable] |
array of pointers of column head addresses
Definition at line 14 of file _dgbmatrix.hpp.
Referenced by _(), _dgbmatrix(), destroy(), dgbmatrix::dgbmatrix(), nullify(), operator()(), dgbmatrix::shallow_copy(), and ~_dgbmatrix().