CPPLapack
|
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class More...
#include <_dgematrix.hpp>
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition at line 3 of file _dgematrix.hpp.
_dgematrix::_dgematrix | ( | ) | [inline] |
_dgematrix::_dgematrix | ( | const _dgematrix & | mat | ) | [inline] |
_dgematrix::~_dgematrix | ( | ) | [inline] |
_zgematrix _dgematrix::to_zgematrix | ( | ) | const [inline] |
double & _dgematrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for object
Definition at line 3 of file _dgematrix-io.hpp.
References darray, i, m, and n.
Referenced by write().
{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 //double val(array[i+m*j]); return darray[j][i]; }
void _dgematrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 41 of file _dgematrix-io.hpp.
References destroy(), i, 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 << "#dgematrix" << " " << m << " " << n << std::endl; for(long i=0; i<m; i++){ for(long j=0; j<n; j++ ){ ofs << operator()(i,j) << " "; } ofs << std::endl; } ofs.close(); destroy(); }
void _dgematrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _dgematrix-misc.hpp.
References array, darray, m, and n.
Referenced by _dgematrix(), dgematrix::dgematrix(), and dgematrix::shallow_copy().
void _dgematrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 13 of file _dgematrix-misc.hpp.
Referenced by damax(), idamax(), operator*(), dgematrix::operator*=(), operator+(), dgematrix::operator+=(), operator-(), dgematrix::operator-=(), operator<<(), t(), to_zgematrix(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const dgematrix & | mat | ||
) | [friend] |
_dgematrix t | ( | const _dgematrix & | mat | ) | [friend] |
_dgematrix i | ( | const _dgematrix & | mat | ) | [friend] |
return its inverse matrix
Definition at line 19 of file _dgematrix-calc.hpp.
Referenced by operator()(), 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 dgematrix mat_cp(mat); dgematrix mat_inv(mat_cp.m,mat_cp.n); mat_inv.identity(); mat_cp.dgesv(mat_inv); return _(mat_inv); }
void idamax | ( | long & | i, |
long & | j, | ||
const _dgematrix & | mat | ||
) | [friend] |
double damax | ( | const _dgematrix & | mat | ) | [friend] |
const _dgematrix& operator+ | ( | const _dgematrix & | mat | ) | [friend] |
+_dgematrix operator
Definition at line 3 of file _dgematrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_dgematrix operator- | ( | const _dgematrix & | mat | ) | [friend] |
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgematrix+dgematrix operator
Definition at line 3 of file _dgematrix-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*matA.n; i++){ matA.array[i]+=matB.array[i]; } return matA; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgematrix+_dgematrix operator
Definition at line 3 of file _dgematrix-_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*matA.n; i++){ matA.array[i]+=matB.array[i]; } matB.destroy(); return matA; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgematrix+dsymatrix operator
Definition at line 3 of file _dgematrix-dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=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 for(long i=0; i<matB.n; i++){ for(long j=0; j<matB.n; j++){ matA(i,j)+=matB(i,j); } } return matA; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgematrix+_dsymatrix operator
Definition at line 3 of file _dgematrix-_dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=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 for(long i=0; i<matB.n; i++) { for(long j=0; j<matB.n; j++) { matA(i,j)+=matB(i,j); } } matB.destroy(); return matA; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgematrix+dgbmatrix operator
Definition at line 3 of file _dgematrix-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 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; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgematrix+_dgbmatrix operator
Definition at line 3 of file _dgematrix-_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 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; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgematrix+dgsmatrix operator
Definition at line 3 of file _dgematrix-dgsmatrix.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=matB.data.begin(); it!=matB.data.end(); it++){ matA(it->i,it->j) += it->v; } return matA; }
_dgematrix operator+ | ( | const _dgematrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgematrix+_dgsmatrix operator
Definition at line 3 of file _dgematrix-_dgsmatrix.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=matB.data.begin(); it!=matB.data.end(); it++){ matA(it->i,it->j) += it->v; } matB.destroy(); return matA; }
_dgematrix operator+ | ( | const _dgematrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgematrix operator+ | ( | const _dgematrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dgematrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgematrix-dgematrix operator
Definition at line 21 of file _dgematrix-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 subtraction." << 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*matA.n; i++){ matA.array[i]-=matB.array[i]; } return matA; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgematrix-_dgematrix operator
Definition at line 22 of file _dgematrix-_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 subtraction." << 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*matA.n; i++){ matA.array[i]-=matB.array[i]; } matB.destroy(); return matA; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgematrix-dsymatrix operator
Definition at line 25 of file _dgematrix-dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=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 for(long i=0; i<matB.n; i++){ for(long j=0; j<matB.n; j++){ matA(i,j)-=matB(i,j); } } return matA; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgematrix-_dsymatrix operator
Definition at line 26 of file _dgematrix-_dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.m!=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 for(long i=0; i<matB.n; i++) { for(long j=0; j<matB.n; j++) { matA(i,j)-=matB(i,j); } } matB.destroy(); return matA; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgematrix-dgbmatrix operator
Definition at line 25 of file _dgematrix-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 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; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgematrix-_dgbmatrix operator
Definition at line 26 of file _dgematrix-_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 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; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgematrix-dgsmatrix operator
Definition at line 23 of file _dgematrix-dgsmatrix.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(long i=0; i<matA.m*matA.n; i++){ matA.array[i]=-matA.array[i]; } //// add //// for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ matA(it->i,it->j) += it->v; } return matA; }
_dgematrix operator- | ( | const _dgematrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgematrix-_dgsmatrix operator
Definition at line 24 of file _dgematrix-_dgsmatrix.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(long i=0; i<matA.m*matA.n; i++){ matA.array[i]=-matA.array[i]; } //// add //// for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ matA(it->i,it->j) += it->v; } matB.destroy(); return matA; }
_dgematrix operator- | ( | const _dgematrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dgematrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dcovector operator* | ( | const _dgematrix & | mat, |
const dcovector & | vec | ||
) | [friend] |
_dgematrix*dcovector operator
Definition at line 3 of file _dgematrix-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); dgemv_( 'n', mat.m, mat.n, 1.0, mat.array, mat.m, vec.array, 1, 0.0, newvec.array, 1 ); mat.destroy(); return _(newvec); }
_dcovector operator* | ( | const _dgematrix & | mat, |
const _dcovector & | vec | ||
) | [friend] |
_dgematrix*_dcovector operator
Definition at line 3 of file _dgematrix-_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); dgemv_( 'n', mat.m, mat.n, 1.0, mat.array, mat.m, vec.array, 1, 0.0, newvec.array, 1 ); mat.destroy(); vec.destroy(); return _(newvec); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dgematrix*dgematrix operator
Definition at line 39 of file _dgematrix-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 ); dgemm_( 'n', 'n', matA.m, matB.n, matA.n, 1.0, matA.array, matA.m, matB.array, matB.m, 0.0, newmat.array, matA.m ); matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgematrix*_dgematrix operator
Definition at line 41 of file _dgematrix-_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 ); dgemm_( 'n', 'n', matA.m, matB.n, matA.n, 1.0, matA.array, matA.m, matB.array, matB.m, 0.0, newmat.array, matA.m ); matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dgematrix*dsymatrix operator
Definition at line 47 of file _dgematrix-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 ); dsymm_( 'R', 'l', newmat.m, newmat.n, 1.0, matB.array, matB.n, matA.array, matA.m, 0.0, newmat.array, newmat.m ); matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dgematrix*_dsymatrix operator
Definition at line 49 of file _dgematrix-_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 ); dsymm_( 'R', 'l', newmat.m, newmat.n, 1.0, matB.array, matB.n, matA.array, matA.m, 0.0, newmat.array, newmat.m ); matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgematrix*dgbmatrix operator
Definition at line 47 of file _dgematrix-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(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ for(long k=std::max(long(0),j-matB.ku); k<std::min(matB.m,j+matB.kl+1); k++){ newmat(i,j)+=matA(i,k)*matB(k,j); } } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dgematrix*_dgbmatrix operator
Definition at line 49 of file _dgematrix-_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(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){ for(long k=std::max(long(0),j-matB.ku); k<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 _dgematrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dgematrix*dgsmatrix operator
Definition at line 49 of file _dgematrix-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=0; i<matA.m; i++){ newmat(i,it->j) += matA(i,it->i)*it->v; } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dgematrix*_dgsmatrix operator
Definition at line 51 of file _dgematrix-_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=0; i<matA.m; i++){ newmat(i,it->j) += matA(i,it->i)*it->v; } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | matA, |
const dssmatrix & | matB | ||
) | [friend] |
_dgematrix*dssmatrix operator
Definition at line 3 of file _dgematrix-dssmatrix.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=0; i<matA.m; i++){ newmat(i,it->j) +=matA(i,it->i)*it->v; } if(it->i!=it->j){ for(long i=0; i<matA.m; i++){ newmat(i,it->i) +=matA(i,it->j)*it->v; } } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dgematrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dgematrix & | mat, |
const double & | d | ||
) | [friend] |
_dgematrix*double operator
Definition at line 3 of file _dgematrix-double.hpp.
_dgematrix operator/ | ( | const _dgematrix & | mat, |
const double & | d | ||
) | [friend] |
_dgematrix/double operator
Definition at line 11 of file _dgematrix-double.hpp.
_dgematrix operator* | ( | const double & | d, |
const _dgematrix & | mat | ||
) | [friend] |
double*_dgematrix operator
Definition at line 3 of file double-_dgematrix.hpp.
long _dgematrix::m [mutable] |
matrix row size
Definition at line 9 of file _dgematrix.hpp.
Referenced by _(), _dgematrix(), damax(), dgematrix::dgematrix(), i(), idamax(), nullify(), operator()(), operator*(), dgematrix::operator*=(), operator+(), dgematrix::operator+=(), operator-(), dgematrix::operator-=(), operator/(), operator<<(), dgematrix::shallow_copy(), t(), to_zgematrix(), and write().
long _dgematrix::n [mutable] |
matrix column size
Definition at line 10 of file _dgematrix.hpp.
Referenced by _(), _dgematrix(), damax(), dgematrix::dgematrix(), i(), idamax(), nullify(), operator()(), operator*(), dgematrix::operator*=(), operator+(), dgematrix::operator+=(), operator-(), dgematrix::operator-=(), operator/(), operator<<(), dgematrix::shallow_copy(), t(), to_zgematrix(), and write().
double* _dgematrix::array [mutable] |
1D array to store matrix data
Definition at line 11 of file _dgematrix.hpp.
Referenced by _(), _dgematrix(), damax(), destroy(), dgematrix::dgematrix(), idamax(), nullify(), operator*(), dgematrix::operator*=(), operator+(), dgematrix::operator+=(), operator-(), dgematrix::operator-=(), operator/(), dgematrix::shallow_copy(), to_zgematrix(), and ~_dgematrix().
double** _dgematrix::darray [mutable] |
array of pointers of column head addresses
Definition at line 12 of file _dgematrix.hpp.
Referenced by _(), _dgematrix(), destroy(), dgematrix::dgematrix(), nullify(), operator()(), dgematrix::shallow_copy(), and ~_dgematrix().