CPPLapack
Public Member Functions | Public Attributes | Friends
_zgematrix Class Reference

(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class More...

#include <_zgematrix.hpp>

List of all members.

Public Member Functions

 _zgematrix ()
 _zgematrix (const _zgematrix &)
 ~_zgematrix ()
comple & operator() (const long &, const long &) const
void write (const char *) const
void nullify () const
void destroy () const

Public Attributes

long m
 matrix row size
long n
 matrix column size
comple * array
 1D array to store matrix data
comple ** darray
 array of pointers of column head addresses

Friends

std::ostream & operator<< (std::ostream &, const zgematrix &)
_zgematrix t (const _zgematrix &)
_zgematrix i (const _zgematrix &)
_zgematrix conj (const _zgematrix &)
_zgematrix conjt (const _zgematrix &)
void idamax (long &, long &, const _zgematrix &)
comple damax (const _zgematrix &)
const _zgematrixoperator+ (const _zgematrix &)
_zgematrix operator- (const _zgematrix &)
_zgematrix operator+ (const _zgematrix &, const zgematrix &)
_zgematrix operator+ (const _zgematrix &, const _zgematrix &)
_zgematrix operator+ (const _zgematrix &, const zhematrix &)
_zgematrix operator+ (const _zgematrix &, const _zhematrix &)
_zgematrix operator+ (const _zgematrix &, const zgbmatrix &)
_zgematrix operator+ (const _zgematrix &, const _zgbmatrix &)
_zgematrix operator+ (const _zgematrix &, const zgsmatrix &)
_zgematrix operator+ (const _zgematrix &, const _zgsmatrix &)
_zgematrix operator+ (const _zgematrix &, const zhsmatrix &)
_zgematrix operator+ (const _zgematrix &, const _zhsmatrix &)
_zgematrix operator- (const _zgematrix &, const zgematrix &)
_zgematrix operator- (const _zgematrix &, const _zgematrix &)
_zgematrix operator- (const _zgematrix &, const zhematrix &)
_zgematrix operator- (const _zgematrix &, const _zhematrix &)
_zgematrix operator- (const _zgematrix &, const zgbmatrix &)
_zgematrix operator- (const _zgematrix &, const _zgbmatrix &)
_zgematrix operator- (const _zgematrix &, const zgsmatrix &)
_zgematrix operator- (const _zgematrix &, const _zgsmatrix &)
_zgematrix operator- (const _zgematrix &, const zhsmatrix &)
_zgematrix operator- (const _zgematrix &, const _zhsmatrix &)
_zcovector operator* (const _zgematrix &, const zcovector &)
_zcovector operator* (const _zgematrix &, const _zcovector &)
_zgematrix operator* (const _zgematrix &, const zgematrix &)
_zgematrix operator* (const _zgematrix &, const _zgematrix &)
_zgematrix operator* (const _zgematrix &, const zhematrix &)
_zgematrix operator* (const _zgematrix &, const _zhematrix &)
_zgematrix operator* (const _zgematrix &, const zgbmatrix &)
_zgematrix operator* (const _zgematrix &, const _zgbmatrix &)
_zgematrix operator* (const _zgematrix &, const zgsmatrix &)
_zgematrix operator* (const _zgematrix &, const _zgsmatrix &)
_zgematrix operator* (const _zgematrix &, const zhsmatrix &)
_zgematrix operator* (const _zgematrix &, const _zhsmatrix &)
_zgematrix operator* (const _zgematrix &, const double &)
_zgematrix operator* (const _zgematrix &, const comple &)
_zgematrix operator/ (const _zgematrix &, const double &)
_zgematrix operator/ (const _zgematrix &, const comple &)
_zgematrix operator* (const double &, const _zgematrix &)
_zgematrix operator* (const comple &, const _zgematrix &)

Detailed Description

(DO NOT USE) Smart-temporary Complex Double-precision General Dence Matrix Class

Definition at line 3 of file _zgematrix.hpp.


Constructor & Destructor Documentation

_zgematrix::_zgematrix ( ) [inline]

_zgematrix constructor without arguments

Definition at line 3 of file _zgematrix-constructor.hpp.

References array, darray, m, and n.

{VERBOSE_REPORT;
  //////// initialize ////////
  m =0;
  n =0;
  array =NULL;
  darray =NULL;
}
_zgematrix::_zgematrix ( const _zgematrix mat) [inline]

_zgematrix copy constructor

Definition at line 14 of file _zgematrix-constructor.hpp.

References array, darray, m, n, and nullify().

{VERBOSE_REPORT;
  //////// initialize ////////
  m =mat.m;
  n =mat.n;
  array =mat.array;
  darray =mat.darray;
  
  mat.nullify();
}

zgematrix destructor

Definition at line 31 of file _zgematrix-constructor.hpp.

References array, and darray.

{VERBOSE_REPORT;
  delete [] array;
  delete [] darray;
}

Member Function Documentation

comple & _zgematrix::operator() ( const long &  i,
const long &  j 
) const [inline]

operator() for object

Definition at line 3 of file _zgematrix-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
  
  //return array[i+m*j];
  return darray[j][i];
}
void _zgematrix::write ( const char *  filename) const [inline]

Definition at line 41 of file _zgematrix-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 << "#zgematrix" << " " << 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 _zgematrix::nullify ( ) const [inline]

nullify all the matrix data

Definition at line 3 of file _zgematrix-misc.hpp.

References array, darray, m, and n.

Referenced by _zgematrix(), zgematrix::shallow_copy(), and zgematrix::zgematrix().

{VERBOSE_REPORT;
  m=0;
  n=0;
  array=NULL;
  darray=NULL;
}
void _zgematrix::destroy ( ) const [inline]

destroy all the matrix data

Definition at line 13 of file _zgematrix-misc.hpp.

References array, and darray.

Referenced by conjt(), damax(), idamax(), operator*(), zgematrix::operator*=(), operator+(), zgematrix::operator+=(), operator-(), zgematrix::operator-=(), operator<<(), t(), and write().

{VERBOSE_REPORT;
  delete [] array;
  delete [] darray;
  array=NULL;
  darray=NULL;
}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const zgematrix mat 
) [friend]

Definition at line 63 of file zgematrix-io.hpp.

{VERBOSE_REPORT;
  for(long i=0; i<mat.m; i++){
    for(long j=0; j<mat.n; j++){
      s << " " << mat(i,j);
    }
    s << std::endl;
  }
  return s;
}
_zgematrix t ( const _zgematrix mat) [friend]

return transposed zgematrix

Definition at line 3 of file _zgematrix-calc.hpp.

{VERBOSE_REPORT;
  zgematrix newmat(mat.n,mat.m);
  
  for(long i=0; i<newmat.m; i++){
    for(long j=0; j<newmat.n; j++){
      newmat(i,j) =mat(j,i);
    }
  }
  
  mat.destroy();
  return _(newmat);
}
_zgematrix i ( const _zgematrix mat) [friend]

return its inverse matrix

Definition at line 19 of file _zgematrix-calc.hpp.

Referenced by operator()(), 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
  zgematrix mat_cp(mat);
  zgematrix mat_inv(mat_cp.m,mat_cp.n);
  mat_inv.identity();
  mat_cp.zgesv(mat_inv);
  
  return _(mat_inv);
}
_zgematrix conj ( const _zgematrix mat) [friend]

return its conjugate matrix

Definition at line 43 of file _zgematrix-calc.hpp.

{VERBOSE_REPORT;
  for(long i=0; i<mat.m; i++){ for(long j=0; j<mat.n; j++){
    mat(i,j) =std::conj(mat(i,j));
  }}
  
  return mat;
}
_zgematrix conjt ( const _zgematrix mat) [friend]

return its conjugate transposed matrix

Definition at line 54 of file _zgematrix-calc.hpp.

{VERBOSE_REPORT;
  zgematrix newmat(mat.n,mat.m);
  for(long i=0; i<newmat.m; i++){
    for(long j=0; j<newmat.n; j++){
      newmat(i,j) =std::conj(mat(j,i));
    }
  }
  
  mat.destroy();
  return _(newmat);
}
void idamax ( long &  i,
long &  j,
const _zgematrix mat 
) [friend]

search the index of element having the largest absolute value in 0-based numbering system

Definition at line 74 of file _zgematrix-calc.hpp.

{VERBOSE_REPORT;
  long index( izamax_(mat.m*mat.n, mat.array, 1) -1 );
  i =index%mat.m;
  j =index/mat.m;
  
  mat.destroy();
}
comple damax ( const _zgematrix mat) [friend]

return its largest absolute value

Definition at line 85 of file _zgematrix-calc.hpp.

{VERBOSE_REPORT;
  comple val( mat.array[izamax_(mat.m*mat.n, mat.array, 1) -1] );
  
  mat.destroy();
  return val;
}
const _zgematrix& operator+ ( const _zgematrix mat) [friend]

+_zgematrix operator

Definition at line 3 of file _zgematrix-unary.hpp.

{VERBOSE_REPORT;
  return mat;
}
_zgematrix operator- ( const _zgematrix mat) [friend]

-_zgematrix operator

Definition at line 10 of file _zgematrix-unary.hpp.

{VERBOSE_REPORT;
  for(long i=0; i<mat.m*mat.n; i++){ mat.array[i]=-mat.array[i]; }
  return mat;
}
_zgematrix operator+ ( const _zgematrix matA,
const zgematrix matB 
) [friend]

_zgematrix+zgematrix operator

Definition at line 3 of file _zgematrix-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*matA.n; i++){ matA.array[i]+=matB.array[i]; }
  
  return matA;
}
_zgematrix operator+ ( const _zgematrix matA,
const _zgematrix matB 
) [friend]

_zgematrix+_zgematrix operator

Definition at line 3 of file _zgematrix-_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*matA.n; i++){ matA.array[i]+=matB.array[i]; }

  matB.destroy();
  return matA;
}
_zgematrix operator+ ( const _zgematrix matA,
const zhematrix matB 
) [friend]

_zgematrix+zhematrix operator

Definition at line 3 of file _zgematrix-zhematrix.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;
}
_zgematrix operator+ ( const _zgematrix matA,
const _zhematrix matB 
) [friend]

_zgematrix+_zhematrix operator

Definition at line 3 of file _zgematrix-_zhematrix.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;
}
_zgematrix operator+ ( const _zgematrix matA,
const zgbmatrix matB 
) [friend]

_zgematrix+zgbmatrix operator

Definition at line 3 of file _zgematrix-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
  
  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;
}
_zgematrix operator+ ( const _zgematrix matA,
const _zgbmatrix matB 
) [friend]

_zgematrix+_zgbmatrix operator

Definition at line 3 of file _zgematrix-_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
  
  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;
}
_zgematrix operator+ ( const _zgematrix matA,
const zgsmatrix matB 
) [friend]

_zgematrix+zgsmatrix operator

Definition at line 3 of file _zgematrix-zgsmatrix.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(size_t c=0; c<matB.data.size(); c++){
    const zcomponent& z =matB.data[c];
    matA(z.i,z.j) += z.v;
  }
  
  return matA;
}
_zgematrix operator+ ( const _zgematrix matA,
const _zgsmatrix matB 
) [friend]

_zgematrix+_zgsmatrix operator

Definition at line 3 of file _zgematrix-_zgsmatrix.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(size_t c=0; c<matB.data.size(); c++){
    const zcomponent& z =matB.data[c];
    matA(z.i,z.j) += z.v;
  }
  
  matB.destroy();
  return matA;
}
_zgematrix operator+ ( const _zgematrix ,
const zhsmatrix  
) [friend]
_zgematrix operator+ ( const _zgematrix ,
const _zhsmatrix  
) [friend]
_zgematrix operator- ( const _zgematrix matA,
const zgematrix matB 
) [friend]

_zgematrix-zgematrix operator

Definition at line 21 of file _zgematrix-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 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;
}
_zgematrix operator- ( const _zgematrix matA,
const _zgematrix matB 
) [friend]

_zgematrix-_zgematrix operator

Definition at line 22 of file _zgematrix-_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 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;
}
_zgematrix operator- ( const _zgematrix matA,
const zhematrix matB 
) [friend]

_zgematrix-zhematrix operator

Definition at line 25 of file _zgematrix-zhematrix.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;
}
_zgematrix operator- ( const _zgematrix matA,
const _zhematrix matB 
) [friend]

_zgematrix-_zhematrix operator

Definition at line 24 of file _zgematrix-_zhematrix.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;
}
_zgematrix operator- ( const _zgematrix matA,
const zgbmatrix matB 
) [friend]

_zgematrix-zgbmatrix operator

Definition at line 25 of file _zgematrix-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
  
  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;
}
_zgematrix operator- ( const _zgematrix matA,
const _zgbmatrix matB 
) [friend]

_zgematrix-_zgbmatrix operator

Definition at line 26 of file _zgematrix-_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
  
  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;
}
_zgematrix operator- ( const _zgematrix matA,
const zgsmatrix matB 
) [friend]

_zgematrix-zgsmatrix operator

Definition at line 24 of file _zgematrix-zgsmatrix.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.n << "x" << matB.n << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(size_t c=0; c<matB.data.size(); c++){
    const zcomponent& z =matB.data[c];
    matA(z.i,z.j) -= z.v;
  }
  
  return matA;
}
_zgematrix operator- ( const _zgematrix matA,
const _zgsmatrix matB 
) [friend]

_zgematrix-_zgsmatrix operator

Definition at line 25 of file _zgematrix-_zgsmatrix.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.n << "x" << matB.n << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(size_t c=0; c<matB.data.size(); c++){
    const zcomponent& z =matB.data[c];
    matA(z.i,z.j) -= z.v;
  }
  
  matB.destroy();
  return matA;
}
_zgematrix operator- ( const _zgematrix ,
const zhsmatrix  
) [friend]
_zgematrix operator- ( const _zgematrix ,
const _zhsmatrix  
) [friend]
_zcovector operator* ( const _zgematrix mat,
const zcovector vec 
) [friend]

_zgematrix*zcovector operator

Definition at line 3 of file _zgematrix-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);
  zgemv_( 'n', mat.m, mat.n, comple(1.0,0.0), mat.array, mat.m,
          vec.array, 1, comple(0.0,0.0), newvec.array, 1 );
  
  mat.destroy();
  return _(newvec);
}
_zcovector operator* ( const _zgematrix mat,
const _zcovector vec 
) [friend]

_zgematrix*_zcovector operator

Definition at line 3 of file _zgematrix-_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);
  zgemv_( 'n', mat.m, mat.n, comple(1.0,0.0), mat.array, mat.m,
          vec.array, 1, comple(0.0,0.0), newvec.array, 1 );
  
  mat.destroy();
  vec.destroy();
  return _(newvec);
}
_zgematrix operator* ( const _zgematrix matA,
const zgematrix matB 
) [friend]

_zgematrix*zgematrix operator

Definition at line 39 of file _zgematrix-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 );
  zgemm_( 'n', 'n', matA.m, matB.n, matA.n, comple(1.0,0.0),
          matA.array, matA.m, matB.array, matB.m,
          comple(0.0,0.0), newmat.array, matA.m );
  
  matA.destroy();
  return _(newmat);
}
_zgematrix operator* ( const _zgematrix matA,
const _zgematrix matB 
) [friend]

_zgematrix*_zgematrix operator

Definition at line 41 of file _zgematrix-_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 );
  zgemm_( 'n', 'n', matA.m, matB.n, matA.n, comple(1.0,0.0),
          matA.array, matA.m, matB.array, matB.m, 
          comple(0.0,0.0), newmat.array, matA.m );
  
  matA.destroy();
  matB.destroy();
  return _(newmat);
}
_zgematrix operator* ( const _zgematrix matA,
const zhematrix matB 
) [friend]

_zgematrix*zhematrix operator

Definition at line 47 of file _zgematrix-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.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 );
  
  matA.destroy();
  return _(newmat);
}
_zgematrix operator* ( const _zgematrix matA,
const _zhematrix matB 
) [friend]

_zgematrix*_zhematrix operator

Definition at line 45 of file _zgematrix-_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.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 );
  
  matA.destroy();
  matB.destroy();
  return _(newmat);
}
_zgematrix operator* ( const _zgematrix matA,
const zgbmatrix matB 
) [friend]

_zgematrix*zgbmatrix operator

Definition at line 47 of file _zgematrix-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
  
  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),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);
}
_zgematrix operator* ( const _zgematrix matA,
const _zgbmatrix matB 
) [friend]

_zgematrix*_zgbmatrix operator

Definition at line 49 of file _zgematrix-_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
  
  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),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);
}
_zgematrix operator* ( const _zgematrix matA,
const zgsmatrix matB 
) [friend]

_zgematrix*zgsmatrix operator

Definition at line 45 of file _zgematrix-zgsmatrix.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.n << "x" << matB.n << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  zgematrix newmat(matA.m, matB.n);
  newmat.zero();
  
  for(size_t c=0; c<matB.data.size(); c++){
    const zcomponent& z =matB.data[c];
    for(long i=0; i<matA.m; i++){
      newmat(i,z.j) += matA(i,z.i)*z.v;
    }
  }
  
  matA.destroy();
  return _(newmat);
}
_zgematrix operator* ( const _zgematrix matA,
const _zgsmatrix matB 
) [friend]

_zgematrix*_zgsmatrix operator

Definition at line 47 of file _zgematrix-_zgsmatrix.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.n << "x" << matB.n << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  zgematrix newmat(matA.m, matB.n);
  newmat.zero();
  
  for(size_t c=0; c<matB.data.size(); c++){
    const zcomponent& z =matB.data[c];
    for(long i=0; i<matA.m; i++){
      newmat(i,z.j) += matA(i,z.i)*z.v;
    }
  }
  
  matA.destroy();
  matB.destroy();
  return _(newmat);
}
_zgematrix operator* ( const _zgematrix ,
const zhsmatrix  
) [friend]
_zgematrix operator* ( const _zgematrix ,
const _zhsmatrix  
) [friend]
_zgematrix operator* ( const _zgematrix mat,
const double &  d 
) [friend]

_zgematrix*double operator

Definition at line 3 of file _zgematrix-double.hpp.

{VERBOSE_REPORT;
  zdscal_(mat.m*mat.n, d, mat.array, 1);
  return mat;
}
_zgematrix operator* ( const _zgematrix mat,
const comple &  d 
) [friend]

_zgematrix*comple operator

Definition at line 3 of file _zgematrix-complex.hpp.

{VERBOSE_REPORT;
  zscal_(mat.m*mat.n, d, mat.array, 1);
  return mat;
}
_zgematrix operator/ ( const _zgematrix mat,
const double &  d 
) [friend]

_zgematrix/double operator

Definition at line 11 of file _zgematrix-double.hpp.

{VERBOSE_REPORT;
  zdscal_(mat.m*mat.n, 1./d, mat.array, 1);
  return mat;
}
_zgematrix operator/ ( const _zgematrix mat,
const comple &  d 
) [friend]

_zgematrix/comple operator

Definition at line 11 of file _zgematrix-complex.hpp.

{VERBOSE_REPORT;
  zscal_(mat.m*mat.n, 1./d, mat.array, 1);
  return mat;
}
_zgematrix operator* ( const double &  d,
const _zgematrix mat 
) [friend]

double*_zgematrix operator

Definition at line 3 of file double-_zgematrix.hpp.

{VERBOSE_REPORT;
  zdscal_(mat.m*mat.n, d, mat.array, 1);
  return mat;
}
_zgematrix operator* ( const comple &  d,
const _zgematrix mat 
) [friend]

comple*_zgematrix operator

Definition at line 3 of file complex-_zgematrix.hpp.

{VERBOSE_REPORT;
  zscal_(mat.m*mat.n, d, mat.array, 1);  
  return mat;
}

Member Data Documentation

long _zgematrix::m [mutable]
long _zgematrix::n [mutable]
comple* _zgematrix::array [mutable]
comple** _zgematrix::darray [mutable]

array of pointers of column head addresses

Definition at line 12 of file _zgematrix.hpp.

Referenced by _(), _zgematrix(), destroy(), nullify(), operator()(), zgematrix::shallow_copy(), zgematrix::zgematrix(), and ~_zgematrix().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Friends