CPPLapack
 All Classes Files Functions Variables Friends
Functions
_dgematrix-_dsymatrix.hpp File Reference

Go to the source code of this file.

Functions

_dgematrix operator+ (const _dgematrix &matA, const _dsymatrix &matB)
_dgematrix operator- (const _dgematrix &matA, const _dsymatrix &matB)
_dgematrix operator* (const _dgematrix &matA, const _dsymatrix &matB)

Function Documentation

_dgematrix operator+ ( const _dgematrix matA,
const _dsymatrix matB 
) [inline]

_dgematrix+_dsymatrix operator

Definition at line 3 of file _dgematrix-_dsymatrix.hpp.

References _dsymatrix::destroy(), i(), _dgematrix::m, _dgematrix::n, and _dsymatrix::n.

{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 _dsymatrix matB 
) [inline]

_dgematrix-_dsymatrix operator

Definition at line 26 of file _dgematrix-_dsymatrix.hpp.

References _dsymatrix::destroy(), i(), _dgematrix::m, _dgematrix::n, and _dsymatrix::n.

{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 _dsymatrix matB 
) [inline]

_dgematrix*_dsymatrix operator

Definition at line 49 of file _dgematrix-_dsymatrix.hpp.

References _(), _dsymatrix::array, dgematrix::array, _dgematrix::array, _dgematrix::destroy(), _dsymatrix::destroy(), dgematrix::m, _dgematrix::m, dgematrix::n, _dsymatrix::n, and _dgematrix::n.

{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);
}
 All Classes Files Functions Variables Friends