CPPLapack
|
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class More...
#include <_zgbmatrix.hpp>
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
Definition at line 3 of file _zgbmatrix.hpp.
_zgbmatrix::_zgbmatrix | ( | ) | [inline] |
_zgbmatrix::_zgbmatrix | ( | const _zgbmatrix & | mat | ) | [inline] |
_zgbmatrix::~_zgbmatrix | ( | ) | [inline] |
_zgbmatrix destructor
Definition at line 34 of file _zgbmatrix-constructor.hpp.
_zgematrix _zgbmatrix::to_zgematrix | ( | ) | const [inline] |
convert to _zgematrix
Definition at line 3 of file _zgbmatrix-cast.hpp.
comple & _zgbmatrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for const object
Definition at line 3 of file _zgbmatrix-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 _zgbmatrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 42 of file _zgbmatrix-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 << "#zgbmatrix" << " " << 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 _zgbmatrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _zgbmatrix-misc.hpp.
References array, darray, kl, ku, m, and n.
Referenced by _zgbmatrix(), zgbmatrix::shallow_copy(), and zgbmatrix::zgbmatrix().
void _zgbmatrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 16 of file _zgbmatrix-misc.hpp.
Referenced by conjt(), operator*(), zgbmatrix::operator*=(), zgematrix::operator*=(), operator+(), zgbmatrix::operator+=(), zgematrix::operator+=(), operator-(), zgbmatrix::operator-=(), zgematrix::operator-=(), operator<<(), t(), to_zgematrix(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const _zgbmatrix & | mat | ||
) | [friend] |
_zgbmatrix t | ( | const _zgbmatrix & | mat | ) | [friend] |
return its transposed zgbmatrix
Definition at line 3 of file _zgbmatrix-calc.hpp.
_zgematrix i | ( | const _zgbmatrix & | mat | ) | [friend] |
return its inverse matrix
Definition at line 18 of file _zgbmatrix-calc.hpp.
Referenced by operator()(), to_zgematrix(), 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 zgbmatrix mat_cp(mat); zgematrix mat_inv(mat_cp.m,mat_cp.n); mat_inv.identity(); mat_cp.zgbsv(mat_inv); return _(mat_inv); }
_zgbmatrix conj | ( | const _zgbmatrix & | mat | ) | [friend] |
_zgbmatrix conjt | ( | const _zgbmatrix & | mat | ) | [friend] |
return its conjugate transposed zgbmatrix
Definition at line 56 of file _zgbmatrix-calc.hpp.
const _zgbmatrix& operator+ | ( | const _zgbmatrix & | mat | ) | [friend] |
+_zgbmatrix operator
Definition at line 3 of file _zgbmatrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_zgbmatrix operator- | ( | const _zgbmatrix & | mat | ) | [friend] |
_zgematrix operator+ | ( | const _zgbmatrix & | matA, |
const zgematrix & | matB | ||
) | [friend] |
_zgbmatrix+zgematrix operator
Definition at line 3 of file _zgbmatrix-zgematrix.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(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); }
_zgematrix operator+ | ( | const _zgbmatrix & | matA, |
const _zgematrix & | matB | ||
) | [friend] |
_zgbmatrix+_zgematrix operator
Definition at line 3 of file _zgbmatrix-_zgematrix.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; }
_zgematrix operator+ | ( | const _zgbmatrix & | matA, |
const zhematrix & | matB | ||
) | [friend] |
_zgbmatrix+zhematrix operator
Definition at line 3 of file _zgbmatrix-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(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); }
_zgematrix operator+ | ( | const _zgbmatrix & | matA, |
const _zhematrix & | matB | ||
) | [friend] |
_zgbmatrix+_zhematrix operator
Definition at line 3 of file _zgbmatrix-_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.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); }
_zgbmatrix operator+ | ( | const _zgbmatrix & | matA, |
const zgbmatrix & | matB | ||
) | [friend] |
_zgbmatrix+zgbmatrix operator
Definition at line 3 of file _zgbmatrix-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 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{ zgbmatrix 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); } }
_zgbmatrix operator+ | ( | const _zgbmatrix & | matA, |
const _zgbmatrix & | matB | ||
) | [friend] |
_zgbmatrix+_zgbmatrix operator
Definition at line 3 of file _zgbmatrix-_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 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{ zgbmatrix 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); } }
_zgematrix operator+ | ( | const _zgbmatrix & | , |
const zgsmatrix & | |||
) | [friend] |
_zgematrix operator+ | ( | const _zgbmatrix & | , |
const _zgsmatrix & | |||
) | [friend] |
_zgematrix operator+ | ( | const _zgbmatrix & | , |
const zhsmatrix & | |||
) | [friend] |
_zgematrix operator+ | ( | const _zgbmatrix & | , |
const _zhsmatrix & | |||
) | [friend] |
_zgematrix operator- | ( | const _zgbmatrix & | matA, |
const zgematrix & | matB | ||
) | [friend] |
_zgbmatrix-zgematrix operator
Definition at line 27 of file _zgbmatrix-zgematrix.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(-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); }
_zgematrix operator- | ( | const _zgbmatrix & | matA, |
const _zgematrix & | matB | ||
) | [friend] |
_zgbmatrix-_zgematrix operator
Definition at line 26 of file _zgbmatrix-_zgematrix.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; }
_zgematrix operator- | ( | const _zgbmatrix & | matA, |
const zhematrix & | matB | ||
) | [friend] |
_zgbmatrix-zgematrix operator
_zgbmatrix-zhematrix operator
Definition at line 27 of file _zgbmatrix-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(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); }
_zgematrix operator- | ( | const _zgbmatrix & | matA, |
const _zhematrix & | matB | ||
) | [friend] |
_zgbmatrix-_zhematrix operator
Definition at line 31 of file _zgbmatrix-_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.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); }
_zgbmatrix operator- | ( | const _zgbmatrix & | matA, |
const zgbmatrix & | matB | ||
) | [friend] |
_zgbmatrix-zgbmatrix operator
Definition at line 44 of file _zgbmatrix-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 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{ zgbmatrix 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); } }
_zgbmatrix operator- | ( | const _zgbmatrix & | matA, |
const _zgbmatrix & | matB | ||
) | [friend] |
_zgbmatrix-_zgbmatrix operator
Definition at line 57 of file _zgbmatrix-_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 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{ zgbmatrix 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); } }
_zgematrix operator- | ( | const _zgbmatrix & | , |
const zgsmatrix & | |||
) | [friend] |
_zgematrix operator- | ( | const _zgbmatrix & | , |
const _zgsmatrix & | |||
) | [friend] |
_zgematrix operator- | ( | const _zgbmatrix & | , |
const zhsmatrix & | |||
) | [friend] |
_zgematrix operator- | ( | const _zgbmatrix & | , |
const _zhsmatrix & | |||
) | [friend] |
_zcovector operator* | ( | const _zgbmatrix & | mat, |
const zcovector & | vec | ||
) | [friend] |
_zgbmatrix*zcovector operator
Definition at line 3 of file _zgbmatrix-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); zgbmv_( 'n', mat.m, mat.n, mat.kl, mat.ku, comple(1.0,0.0), mat.array, mat.kl+mat.ku+1, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); mat.destroy(); return _(newvec); }
_zcovector operator* | ( | const _zgbmatrix & | mat, |
const _zcovector & | vec | ||
) | [friend] |
_zgbmatrix*_zcovector operator
Definition at line 3 of file _zgbmatrix-_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); zgbmv_( 'n', mat.m, mat.n, mat.kl, mat.ku, comple(1.0,0.0), mat.array, mat.kl+mat.ku+1, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); mat.destroy(); vec.destroy(); return _(newvec); }
_zgematrix operator* | ( | const _zgbmatrix & | matA, |
const zgematrix & | matB | ||
) | [friend] |
_zgbmatrix*zgematrix operator
Definition at line 51 of file _zgbmatrix-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.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix 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); }
_zgematrix operator* | ( | const _zgbmatrix & | matA, |
const _zgematrix & | matB | ||
) | [friend] |
_zgbmatrix*_zgematrix operator
Definition at line 49 of file _zgbmatrix-_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.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zgematrix 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); }
_zgematrix operator* | ( | const _zgbmatrix & | matA, |
const zhematrix & | matB | ||
) | [friend] |
_zgbmatrix*zgematrix operator
_zgbmatrix*zhematrix operator
Definition at line 51 of file _zgbmatrix-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(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); }
_zgematrix operator* | ( | const _zgbmatrix & | matA, |
const _zhematrix & | matB | ||
) | [friend] |
_zgbmatrix*_zhematrix operator
Definition at line 59 of file _zgbmatrix-_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(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); }
_zgbmatrix operator* | ( | const _zgbmatrix & | matA, |
const zgbmatrix & | matB | ||
) | [friend] |
_zgbmatrix*zgbmatrix operator
Definition at line 84 of file _zgbmatrix-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 zgbmatrix 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); }
_zgbmatrix operator* | ( | const _zgbmatrix & | matA, |
const _zgbmatrix & | matB | ||
) | [friend] |
_zgbmatrix*_zgbmatrix operator
Definition at line 100 of file _zgbmatrix-_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 zgbmatrix 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); }
_zgematrix operator* | ( | const _zgbmatrix & | , |
const zgsmatrix & | |||
) | [friend] |
_zgematrix operator* | ( | const _zgbmatrix & | , |
const _zgsmatrix & | |||
) | [friend] |
_zgematrix operator* | ( | const _zgbmatrix & | , |
const zhsmatrix & | |||
) | [friend] |
_zgematrix operator* | ( | const _zgbmatrix & | , |
const _zhsmatrix & | |||
) | [friend] |
_zgbmatrix operator* | ( | const _zgbmatrix & | mat, |
const double & | d | ||
) | [friend] |
_zgbmatrix operator* | ( | const _zgbmatrix & | mat, |
const comple & | d | ||
) | [friend] |
_zgbmatrix operator/ | ( | const _zgbmatrix & | mat, |
const double & | d | ||
) | [friend] |
_zgbmatrix operator/ | ( | const _zgbmatrix & | mat, |
const comple & | d | ||
) | [friend] |
_zgbmatrix operator* | ( | const double & | d, |
const _zgbmatrix & | mat | ||
) | [friend] |
_zgbmatrix operator* | ( | const comple & | d, |
const _zgbmatrix & | mat | ||
) | [friend] |
long _zgbmatrix::m [mutable] |
matrix row size
Definition at line 9 of file _zgbmatrix.hpp.
Referenced by _(), _zgbmatrix(), conj(), conjt(), i(), nullify(), operator()(), operator*(), zgbmatrix::operator*=(), zgematrix::operator*=(), operator+(), zgbmatrix::operator+=(), zgematrix::operator+=(), operator-(), zgbmatrix::operator-=(), zgematrix::operator-=(), operator<<(), zgbmatrix::shallow_copy(), t(), to_zgematrix(), write(), and zgbmatrix::zgbmatrix().
long _zgbmatrix::n [mutable] |
matrix column size
Definition at line 10 of file _zgbmatrix.hpp.
Referenced by _(), _zgbmatrix(), conj(), conjt(), i(), nullify(), operator*(), zgbmatrix::operator*=(), zgematrix::operator*=(), operator+(), zgbmatrix::operator+=(), zgematrix::operator+=(), operator-(), zgbmatrix::operator-=(), zgematrix::operator-=(), operator/(), operator<<(), zgbmatrix::shallow_copy(), t(), to_zgematrix(), write(), and zgbmatrix::zgbmatrix().
long _zgbmatrix::kl [mutable] |
lower band width
Definition at line 11 of file _zgbmatrix.hpp.
Referenced by _(), _zgbmatrix(), conj(), conjt(), nullify(), operator()(), operator*(), zgbmatrix::operator*=(), zgematrix::operator*=(), operator+(), zgbmatrix::operator+=(), zgematrix::operator+=(), operator-(), zgbmatrix::operator-=(), zgematrix::operator-=(), operator/(), operator<<(), zgbmatrix::shallow_copy(), t(), to_zgematrix(), write(), and zgbmatrix::zgbmatrix().
long _zgbmatrix::ku [mutable] |
upper band width
Definition at line 12 of file _zgbmatrix.hpp.
Referenced by _(), _zgbmatrix(), conj(), conjt(), nullify(), operator()(), operator*(), zgbmatrix::operator*=(), zgematrix::operator*=(), operator+(), zgbmatrix::operator+=(), zgematrix::operator+=(), operator-(), zgbmatrix::operator-=(), zgematrix::operator-=(), operator/(), operator<<(), zgbmatrix::shallow_copy(), t(), to_zgematrix(), write(), and zgbmatrix::zgbmatrix().
comple* _zgbmatrix::array [mutable] |
1D array to store matrix data
Definition at line 13 of file _zgbmatrix.hpp.
Referenced by _(), _zgbmatrix(), destroy(), nullify(), operator*(), operator-(), operator/(), zgbmatrix::shallow_copy(), zgbmatrix::zgbmatrix(), and ~_zgbmatrix().
comple** _zgbmatrix::darray [mutable] |
array of pointers of column head addresses
Definition at line 14 of file _zgbmatrix.hpp.
Referenced by _(), _zgbmatrix(), destroy(), nullify(), operator()(), zgbmatrix::shallow_copy(), zgbmatrix::zgbmatrix(), and ~_zgbmatrix().