CPPLapack
 All Classes Files Functions Variables Friends
Functions
zgematrix-_zhematrix.hpp File Reference

Go to the source code of this file.

Functions

_zgematrix operator+ (const zgematrix &matA, const _zhematrix &matB)
_zgematrix operator- (const zgematrix &matA, const _zhematrix &matB)
_zgematrix operator* (const zgematrix &matA, const _zhematrix &matB)

Function Documentation

_zgematrix operator+ ( const zgematrix matA,
const _zhematrix matB 
) [inline]

zgematrix+_zhematrix operator

Definition at line 72 of file zgematrix-_zhematrix.hpp.

References _(), _zhematrix::destroy(), i(), zgematrix::m, zgematrix::n, and _zhematrix::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
  
  zgematrix newmat(matA);
  for(long i=0; i<matA.m; i++){ for(long j=0; j<matA.n; j++){
    newmat(i,j) +=matB(i,j);
  }}
  
  matB.destroy();
  return _(newmat);
}
_zgematrix operator- ( const zgematrix matA,
const _zhematrix matB 
) [inline]

zgematrix-_zhematrix operator

Definition at line 94 of file zgematrix-_zhematrix.hpp.

References _(), _zhematrix::destroy(), i(), zgematrix::m, zgematrix::n, and _zhematrix::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 subtraction." << 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);
  for(long i=0; i<matA.m; i++){ for(long j=0; j<matA.n; j++){
    newmat(i,j) -=matB(i,j);
  }}
  
  matB.destroy();
  return _(newmat);
}
_zgematrix operator* ( const zgematrix matA,
const _zhematrix matB 
) [inline]

zgematrix*_zhematrix operator

Definition at line 116 of file zgematrix-_zhematrix.hpp.

References _(), zgematrix::array, _zhematrix::array, _zhematrix::destroy(), zgematrix::m, zgematrix::n, and _zhematrix::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
  
  zgematrix newmat( matA.n, matB.n );
  
  zhemm_( 'R', 'l', matB.n, matA.n, comple(1.0,0.0), 
          matB.array, matB.n, matA.array, matA.m, 
          comple(0.0,0.0), newmat.array, newmat.m );
  
  matB.destroy();
  return _(newmat);
}
 All Classes Files Functions Variables Friends