CPPLapack
|
(DO NOT USE) Smart-temporary Real Double-precision Symmetric Matrix Class More...
#include <_dsymatrix.hpp>
(DO NOT USE) Smart-temporary Real Double-precision Symmetric Matrix Class
Definition at line 3 of file _dsymatrix.hpp.
_dsymatrix::_dsymatrix | ( | ) | [inline] |
_dsymatrix::_dsymatrix | ( | const _dsymatrix & | mat | ) | [inline] |
_dsymatrix::~_dsymatrix | ( | ) | [inline] |
_zhematrix _dsymatrix::to_zhematrix | ( | ) | const [inline] |
_dgematrix _dsymatrix::to_dgematrix | ( | ) | const [inline] |
convert to _dgematrix
Definition at line 22 of file _dsymatrix-cast.hpp.
References _(), destroy(), i, and n.
Referenced by operator+(), and operator-().
_dssmatrix _dsymatrix::to_dssmatrix | ( | const double | = DBL_MIN | ) | const [inline] |
double & _dsymatrix::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
operator() for object
Definition at line 3 of file _dsymatrix-io.hpp.
Referenced by write().
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if( i<0 || j<0 || n<=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 if( i >= j ){ //return array[i+n*j]; return darray[j][i]; } else { //return array[j+n*i]; return darray[i][j]; } }
void _dsymatrix::write | ( | const char * | filename | ) | const [inline] |
Definition at line 50 of file _dsymatrix-io.hpp.
References destroy(), i, 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 << "#dsymatrix" << " " << n << std::endl; for(long i=0; i<n; i++){ for(long j=0; j<=i; j++ ){ ofs << operator()(i,j) << " "; } ofs << std::endl; } ofs.close(); destroy(); }
void _dsymatrix::nullify | ( | ) | const [inline] |
nullify all the matrix data
Definition at line 3 of file _dsymatrix-misc.hpp.
References array, darray, and n.
Referenced by _dsymatrix(), dsymatrix::dsymatrix(), and dsymatrix::shallow_copy().
void _dsymatrix::destroy | ( | ) | const [inline] |
destroy all the matrix data
Definition at line 12 of file _dsymatrix-misc.hpp.
Referenced by operator*(), dgematrix::operator*=(), operator+(), dsymatrix::operator+=(), dgematrix::operator+=(), operator-(), dsymatrix::operator-=(), dgematrix::operator-=(), operator<<(), to_dgematrix(), to_zhematrix(), and write().
void _dsymatrix::complete | ( | ) | const [inline] |
std::ostream& operator<< | ( | std::ostream & | s, |
const dsymatrix & | mat | ||
) | [friend] |
_dsymatrix t | ( | const _dsymatrix & | mat | ) | [friend] |
return transposed _dsymatrix
Definition at line 3 of file _dsymatrix-calc.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG WARNING_REPORT; std::cerr << "This function call has no effect since the matrix is symmetric." << std::endl; #endif//CPPL_DEBUG return mat; }
_dsymatrix i | ( | const _dsymatrix & | mat | ) | [friend] |
return its inverse matrix
Definition at line 15 of file _dsymatrix-calc.hpp.
Referenced by complete(), operator()(), to_dgematrix(), to_zhematrix(), and write().
{VERBOSE_REPORT; dsymatrix mat_cp(mat); dsymatrix mat_inv(mat_cp.n); mat_inv.identity(); char UPLO('l'); long NRHS(mat.n), LDA(mat.n), *IPIV(new long[mat.n]), LDB(mat.n), LWORK(-1), INFO(1); double *WORK( new double[1] ); dsysv_(UPLO, mat_cp.n, NRHS, mat_cp.array, LDA, IPIV, mat_inv.array, LDB, WORK, LWORK, INFO); LWORK = long(WORK[0]); delete [] WORK; WORK = new double[LWORK]; dsysv_(UPLO, mat_cp.n, NRHS, mat_cp.array, LDA, IPIV, mat_inv.array, LDB, WORK, LWORK, INFO); delete [] WORK; delete [] IPIV; if(INFO!=0){ WARNING_REPORT; std::cerr << "Serious trouble happend. INFO = " << INFO << "." << std::endl; } return _(mat_inv); }
void idamax | ( | long & | i, |
long & | j, | ||
const _dsymatrix & | mat | ||
) | [friend] |
search the index of element having the largest absolute value in 0-based numbering system
Definition at line 44 of file _dsymatrix-calc.hpp.
double damax | ( | const _dsymatrix & | mat | ) | [friend] |
return its largest absolute value
Definition at line 52 of file _dsymatrix-calc.hpp.
const _dsymatrix& operator+ | ( | const _dsymatrix & | mat | ) | [friend] |
+_dsymatrix operator
Definition at line 3 of file _dsymatrix-unary.hpp.
{VERBOSE_REPORT;
return mat;
}
_dsymatrix operator- | ( | const _dsymatrix & | mat | ) | [friend] |
_dgematrix operator+ | ( | const _dsymatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dsymatrix+dgematrix operator
Definition at line 3 of file _dsymatrix-dgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matB); for(long i=0; i<matA.n; i++){ for(long j=0; j<matA.n; j++ ){ newmat(i,j)+=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dsymatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgematrix+dsymatrix operator
Definition at line 3 of file _dsymatrix-_dgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<matA.n; i++) { for(long j=0; j<matA.n; j++) { matB(i,j)+=matA(i,j); } } matA.destroy(); return matB; }
_dsymatrix operator+ | ( | const _dsymatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dsymatrix+dsymatrix operator
Definition at line 3 of file _dsymatrix-dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<matA.n; i++){ for(long j=0; j<=i; j++){ matA.darray[j][i] +=matB.darray[j][i]; } } return matA; }
_dsymatrix operator+ | ( | const _dsymatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dsymatrix+_dsymatrix operator
Definition at line 3 of file _dsymatrix-_dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<matA.n; i++){ for(long j=0; j<=i; j++){ matA.darray[j][i] +=matB.darray[j][i]; } } matB.destroy(); return matA; }
_dgematrix operator+ | ( | const _dsymatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dsymatrix+dgbmatrix operator
Definition at line 3 of file _dsymatrix-dgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matA.n, matA.n); for(long i=0; i<matB.m; i++){ for(long j=i; j<matA.n; j++){ newmat(i,j) = newmat(j,i) = 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); }
_dgematrix operator+ | ( | const _dsymatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dsymatrix+_dgbmatrix operator
Definition at line 3 of file _dsymatrix-_dgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matA.n, matA.n); for(long i=0; i<matB.m; i++){ for(long j=i; j<matA.n; j++){ newmat(i,j) = newmat(j,i) = 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 _dsymatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dsymatrix+dgsmatrix operator
Definition at line 3 of file _dsymatrix-dgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); return _(newmat); }
_dgematrix operator+ | ( | const _dsymatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dsymatrix+_dgsmatrix operator
Definition at line 3 of file _dsymatrix-_dgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) += it->v; } matA.destroy(); matB.destroy(); return _(newmat); }
_dsymatrix operator+ | ( | const _dsymatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dsymatrix operator+ | ( | const _dsymatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dgematrix operator- | ( | const _dsymatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dsymatrix-dgematrix operator
Definition at line 27 of file _dsymatrix-dgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(-matB); for(long i=0; i<matA.n; i++){ for(long j=0; j<matA.n; j++ ){ newmat(i,j)+=matA(i,j); } } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dsymatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dsymatrix-dgematrix operator
Definition at line 26 of file _dsymatrix-_dgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<matA.n; i++) { for(long j=0; j<matA.n; j++) { matB(i,j) =matA(i,j)-matB(i,j); } } matA.destroy(); return matB; }
_dsymatrix operator- | ( | const _dsymatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dsymatrix-dsymatrix operator
Definition at line 25 of file _dsymatrix-dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<matA.n; i++){ for(long j=0; j<=i; j++){ matA.darray[j][i] -=matB.darray[j][i]; } } return matA; }
_dsymatrix operator- | ( | const _dsymatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dsymatrix-_dsymatrix operator
Definition at line 26 of file _dsymatrix-_dsymatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<matA.n; i++){ for(long j=0; j<=i; j++){ matA.darray[j][i] -=matB.darray[j][i]; } } matB.destroy(); return matA; }
_dgematrix operator- | ( | const _dsymatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dsymatrix-dgbmatrix operator
Definition at line 30 of file _dsymatrix-dgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matA.n, matA.n); for(long i=0; i<matB.m; i++){ for(long j=i; j<matA.n; j++){ newmat(i,j) = newmat(j,i) = 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); }
_dgematrix operator- | ( | const _dsymatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dsymatrix-_dgbmatrix operator
Definition at line 31 of file _dsymatrix-_dgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.n || matA.n!=matB.m){ ERROR_REPORT; std::cerr << "These two matrises can not make a summation." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matA.n, matA.n); for(long i=0; i<matB.m; i++){ for(long j=i; j<matA.n; j++){ newmat(i,j) = newmat(j,i) = 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 _dsymatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dsymatrix-dgsmatrix operator
Definition at line 25 of file _dsymatrix-dgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) -= it->v; } matA.destroy(); return _(newmat); }
_dgematrix operator- | ( | const _dsymatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dsymatrix-_dgsmatrix operator
Definition at line 26 of file _dsymatrix-_dgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(matA.n!=matB.m || matA.n!=matB.n){ ERROR_REPORT; std::cerr << "These two matrises can not make a subtraction." << std::endl << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.to_dgematrix() ); for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){ newmat(it->i,it->j) -= it->v; } matA.destroy(); matB.destroy(); return _(newmat); }
_dsymatrix operator- | ( | const _dsymatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dsymatrix operator- | ( | const _dsymatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dcovector operator* | ( | const _dsymatrix & | mat, |
const dcovector & | vec | ||
) | [friend] |
_dsymatrix*dcovector operator
Definition at line 3 of file _dsymatrix-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.n << "x" << mat.n << ") * (" << vec.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dcovector newvec(mat.n); dsymv_( 'l', mat.n, 1.0, mat.array, mat.n, vec.array, 1, 0.0, newvec.array, 1 ); mat.destroy(); return _(newvec); }
_dcovector operator* | ( | const _dsymatrix & | mat, |
const _dcovector & | vec | ||
) | [friend] |
_dsymatrix*_dcovector operator
Definition at line 3 of file _dsymatrix-_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.n << "x" << mat.n << ") * (" << vec.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dcovector newvec(mat.n); dsymv_( 'l', mat.n, 1.0, mat.array, mat.n, vec.array, 1, 0.0, newvec.array, 1 ); mat.destroy(); vec.destroy(); return _(newvec); }
_dgematrix operator* | ( | const _dsymatrix & | matA, |
const dgematrix & | matB | ||
) | [friend] |
_dsymatrix*dgematrix operator
Definition at line 51 of file _dsymatrix-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.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.n, matB.n ); dsymm_( 'l', 'l', matA.n, matB.n, 1.0, matA.array, matA.n, matB.array, matB.m, 0.0, newmat.array, newmat.m ); matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dsymatrix & | matA, |
const _dgematrix & | matB | ||
) | [friend] |
_dgematrix*dgematrix operator
Definition at line 49 of file _dsymatrix-_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.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.n, matB.n ); dsymm_( 'l', 'l', matA.n, matB.n, 1.0, matA.array, matA.n, matB.array, matB.m, 0.0, newmat.array, newmat.m ); matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dsymatrix & | matA, |
const dsymatrix & | matB | ||
) | [friend] |
_dsymatrix*dsymatrix operator
Definition at line 47 of file _dsymatrix-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.n << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG matA.complete(); matB.complete(); dgematrix newmat(matA.n, matA.n); dgemm_( 'n', 'n', matA.n, matB.n, matA.n, 1.0, matA.array, matA.n, matB.array, matB.n, 0.0, newmat.array, matA.n ); matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dsymatrix & | matA, |
const _dsymatrix & | matB | ||
) | [friend] |
_dsymatrix*_dsymatrix operator
Definition at line 49 of file _dsymatrix-_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.n << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG matA.complete(); matB.complete(); dgematrix newmat(matA.n, matA.n); dgemm_( 'n', 'n', matA.n, matB.n, matA.n, 1.0, matA.array, matA.n, matB.array, matB.n, 0.0, newmat.array, matA.n ); matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dsymatrix & | matA, |
const dgbmatrix & | matB | ||
) | [friend] |
_dgematrix*dgbmatrix operator
Definition at line 57 of file _dsymatrix-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.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.n, 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 _dsymatrix & | matA, |
const _dgbmatrix & | matB | ||
) | [friend] |
_dsymatrix*_dgbmatrix operator
Definition at line 59 of file _dsymatrix-_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.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat( matA.n, 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 _dsymatrix & | matA, |
const dgsmatrix & | matB | ||
) | [friend] |
_dsymatrix*dgsmatrix operator
Definition at line 47 of file _dsymatrix-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.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matA.n, 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.n; i++){ newmat(i,it->j) += matB(i,it->i)*it->v; } } matA.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dsymatrix & | matA, |
const _dgsmatrix & | matB | ||
) | [friend] |
_dsymatrix*_dgsmatrix operator
Definition at line 49 of file _dsymatrix-_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.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG dgematrix newmat(matA.n, 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.n; i++){ newmat(i,it->j) += matB(i,it->i)*it->v; } } matA.destroy(); matB.destroy(); return _(newmat); }
_dgematrix operator* | ( | const _dsymatrix & | , |
const dssmatrix & | |||
) | [friend] |
_dgematrix operator* | ( | const _dsymatrix & | , |
const _dssmatrix & | |||
) | [friend] |
_dsymatrix operator* | ( | const _dsymatrix & | mat, |
const double & | d | ||
) | [friend] |
_dsymatrix operator/ | ( | const _dsymatrix & | mat, |
const double & | d | ||
) | [friend] |
_dsymatrix operator* | ( | const double & | d, |
const _dsymatrix & | mat | ||
) | [friend] |
long const& _dsymatrix::m [mutable] |
matrix row size
Definition at line 9 of file _dsymatrix.hpp.
Referenced by operator*(), operator+(), and operator-().
long _dsymatrix::n [mutable] |
matrix column size
Definition at line 10 of file _dsymatrix.hpp.
Referenced by _(), _dsymatrix(), complete(), dsymatrix::dsymatrix(), i(), nullify(), operator()(), operator*(), dgematrix::operator*=(), operator+(), dsymatrix::operator+=(), dgematrix::operator+=(), operator-(), dsymatrix::operator-=(), dgematrix::operator-=(), operator/(), operator<<(), dsymatrix::shallow_copy(), to_dgematrix(), to_zhematrix(), and write().
double* _dsymatrix::array [mutable] |
1D array to store matrix data
Definition at line 11 of file _dsymatrix.hpp.
Referenced by _(), _dsymatrix(), destroy(), dsymatrix::dsymatrix(), nullify(), operator*(), dgematrix::operator*=(), operator-(), dsymatrix::shallow_copy(), and ~_dsymatrix().
double** _dsymatrix::darray [mutable] |
array of pointers of column head addresses
Definition at line 12 of file _dsymatrix.hpp.
Referenced by _(), _dsymatrix(), complete(), destroy(), dsymatrix::dsymatrix(), nullify(), operator()(), operator*(), operator+(), dsymatrix::operator+=(), operator-(), dsymatrix::operator-=(), operator/(), dsymatrix::shallow_copy(), and ~_dsymatrix().