CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
zgematrix-zssmatrix.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 3 of file zgematrix-zssmatrix.hpp.

References _(), zhematrix::array, zgematrix::m, zhematrix::m, zgematrix::n, and zhematrix::n.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.m!=matB.m || matA.n!=matB.n){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zgematrix newmat(matA);
15  for(CPPL_INT c=0; c<matB.vol; c++){
16  newmat(matB.indx[c],matB.jndx[c]) += matB.array[c];
17  }
18 
19  return _(newmat);
20 }
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
CPPL_INT const & m
matrix row size
Definition: zhematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)
_zgematrix operator- ( const zgematrix matA,
const zhematrix matB 
)
inline

zgematrix-zhematrix operator

Definition at line 24 of file zgematrix-zssmatrix.hpp.

References _(), zhematrix::array, zgematrix::m, zhematrix::m, zgematrix::n, and zhematrix::n.

25 {CPPL_VERBOSE_REPORT;
26 #ifdef CPPL_DEBUG
27  if(matA.m!=matB.m || matA.n!=matB.n){
28  ERROR_REPORT;
29  std::cerr << "These two matrises can not make a subtraction." << std::endl
30  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
31  exit(1);
32  }
33 #endif//CPPL_DEBUG
34 
35  zgematrix newmat(matA);
36  for(CPPL_INT c=0; c<matB.vol; c++){
37  newmat(matB.indx[c],matB.jndx[c]) -= matB.array[c];
38  }
39 
40  return _(newmat);
41 }
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
CPPL_INT const & m
matrix row size
Definition: zhematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)
_zgematrix operator* ( const zgematrix matA,
const zhematrix matB 
)
inline

zgematrix*zhematrix operator

Definition at line 45 of file zgematrix-zssmatrix.hpp.

References _(), zhematrix::array, i(), zgematrix::m, zhematrix::m, zgematrix::n, zhematrix::n, and zgematrix::zero().

46 {CPPL_VERBOSE_REPORT;
47 #ifdef CPPL_DEBUG
48  if(matA.n!=matB.m){
49  ERROR_REPORT;
50  std::cerr << "These two matrises can not make a product." << std::endl
51  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
52  exit(1);
53  }
54 #endif//CPPL_DEBUG
55 
56  zgematrix newmat(matA.m, matB.n);
57  newmat.zero();
58 
59  for(CPPL_INT c=0; c<matB.vol; c++){
60  for(CPPL_INT i=0; i<matA.m; i++){
61  newmat(i,matB.jndx[c]) += matA(i,matB.indx[c])*matB.array[c];
62  }
63  }
64 
65  return _(newmat);
66 }
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
CPPL_INT const & m
matrix row size
Definition: zhematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)