CPPLapack
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Public Attributes | Friends | List of all members
_zgematrix Class Reference

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

#include <_zgematrix.hpp>

Public Member Functions

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

Public Attributes

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

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 (CPPL_INT &, CPPL_INT &, 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.

4 {CPPL_VERBOSE_REPORT;
5  //////// initialize ////////
6  m =0;
7  n =0;
8  array =NULL;
9  darray =NULL;
10 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
comple ** darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:12
_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().

15 {CPPL_VERBOSE_REPORT;
16  //////// initialize ////////
17  m =mat.m;
18  n =mat.n;
19  array =mat.array;
20  darray =mat.darray;
21 
22  mat.nullify();
23 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
void nullify() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
comple ** darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:12
_zgematrix::~_zgematrix ( )
inline

zgematrix destructor

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

References array, and darray.

32 {CPPL_VERBOSE_REPORT;
33  delete [] array;
34  delete [] darray;
35 }
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
comple ** darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:12

Member Function Documentation

comple & _zgematrix::operator() ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

operator() for object

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

References darray, i, m, and n.

Referenced by write().

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if( i<0 || j<0 || m<=i || n<=j ){
7  ERROR_REPORT;
8  std::cerr << "The required component is out of the matrix size." << std::endl
9  << "Your input is (" << i << "," << j << "), whereas the matrix size is (" << m << "," << n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  //return array[i+m*j];
15  return darray[j][i];
16 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
comple ** darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:12
void _zgematrix::write ( const char *  filename) const
inline

Definition at line 41 of file _zgematrix-io.hpp.

References destroy(), i, m, n, and operator()().

42 {CPPL_VERBOSE_REPORT;
43  std::ofstream ofs(filename, std::ios::trunc);
44  ofs.setf(std::cout.flags());
45  ofs.precision(std::cout.precision());
46  ofs.width(std::cout.width());
47  ofs.fill(std::cout.fill());
48 
49  ofs << "#zgematrix" << " " << m << " " << n << std::endl;
50  for(CPPL_INT i=0; i<m; i++){
51  for(CPPL_INT j=0; j<n; j++){
52  ofs << operator()(i,j) << " ";
53  }
54  ofs << std::endl;
55  }
56 
57  ofs.close();
58  destroy();
59 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple & operator()(const CPPL_INT &, const CPPL_INT &) const
friend _zgematrix i(const _zgematrix &)
void destroy() const
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
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().

4 {CPPL_VERBOSE_REPORT;
5  m=0;
6  n=0;
7  array=NULL;
8  darray=NULL;
9 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
comple ** darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:12
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().

14 {CPPL_VERBOSE_REPORT;
15  delete [] array;
16  delete [] darray;
17  array=NULL;
18  darray=NULL;
19 }
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
comple ** darray
array of pointers of column head addresses
Definition: _zgematrix.hpp:12

Friends And Related Function Documentation

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

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

64 {CPPL_VERBOSE_REPORT;
65  for(CPPL_INT i=0; i<mat.m; i++){
66  for(CPPL_INT j=0; j<mat.n; j++){
67  s << " " << mat(i,j);
68  }
69  s << std::endl;
70  }
71  return s;
72 }
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_zgematrix t ( const _zgematrix mat)
friend

return transposed zgematrix

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

4 {CPPL_VERBOSE_REPORT;
5  zgematrix newmat(mat.n,mat.m);
6 
7  for(CPPL_INT i=0; i<newmat.m; i++){
8  for(CPPL_INT j=0; j<newmat.n; j++){
9  newmat(i,j) =mat(j,i);
10  }
11  }
12 
13  mat.destroy();
14  return _(newmat);
15 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix i ( const _zgematrix mat)
friend

return its inverse matrix

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

Referenced by operator()(), and write().

20 {CPPL_VERBOSE_REPORT;
21 #ifdef CPPL_DEBUG
22  if(mat.m!=mat.n){
23  ERROR_REPORT;
24  std::cerr << "This matrix is not square and has no inverse matrix." << std::endl
25  << "Your input was (" << mat.m << "x" << mat.n << ")." << std::endl;
26  exit(1);
27  }
28 #endif//CPPL_DEBUG
29 
30  zgematrix mat_cp(mat);
31  zgematrix mat_inv(mat_cp.m,mat_cp.n);
32  mat_inv.identity();
33  mat_cp.zgesv(mat_inv);
34 
35  return _(mat_inv);
36 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix conj ( const _zgematrix mat)
friend

return its conjugate matrix

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

45 {CPPL_VERBOSE_REPORT;
46  for(CPPL_INT i=0; i<mat.m; i++){
47  for(CPPL_INT j=0; j<mat.n; j++){
48  mat(i,j) =std::conj(mat(i,j));
49  }
50  }
51 
52  return mat;
53 }
_zgematrix conj(const _zgematrix &mat)
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix conjt ( const _zgematrix mat)
friend

return its conjugate transposed matrix

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

58 {CPPL_VERBOSE_REPORT;
59  zgematrix newmat(mat.n,mat.m);
60 
61  for(CPPL_INT i=0; i<newmat.m; i++){
62  for(CPPL_INT j=0; j<newmat.n; j++){
63  newmat(i,j) =std::conj(mat(j,i));
64  }
65  }
66 
67  mat.destroy();
68  return _(newmat);
69 }
_zgematrix conj(const _zgematrix &mat)
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
void idamax ( CPPL_INT &  i,
CPPL_INT &  j,
const _zgematrix mat 
)
friend

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

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

79 {CPPL_VERBOSE_REPORT;
80  CPPL_INT size =mat.m*mat.n;
81  CPPL_INT inc =1;
82  CPPL_INT index =izamax_(&size, mat.array, &inc) -1;
83  i =index%mat.m;
84  j =index/mat.m;
85 
86  mat.destroy();
87 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
comple damax ( const _zgematrix mat)
friend

return its largest absolute value

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

92 {CPPL_VERBOSE_REPORT;
93  CPPL_INT size =mat.m*mat.n;
94  CPPL_INT inc =1;
95  comple val =mat.array[izamax_(&size, mat.array, &inc) -1];
96 
97  mat.destroy();
98  return val;
99 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
const _zgematrix& operator+ ( const _zgematrix mat)
friend

+_zgematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5  return mat;
6 }
_zgematrix operator- ( const _zgematrix mat)
friend

-_zgematrix operator

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

11 {CPPL_VERBOSE_REPORT;
12  for(CPPL_INT i=0; i<mat.m*mat.n; i++){ mat.array[i]=-mat.array[i]; }
13  return mat;
14 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const zgematrix matB 
)
friend

_zgematrix+zgematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.m!=matB.m){
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  const CPPL_INT size =matA.m*matA.n;
15  for(CPPL_INT i=0; i<size; i++){
16  matA.array[i] += matB.array[i];
17  }
18 
19  return matA;
20 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
comple * array
1D array to store matrix data
Definition: zgematrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const _zgematrix matB 
)
friend

_zgematrix+_zgematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.m!=matB.m){
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  const CPPL_INT size =matA.m*matA.n;
15  for(CPPL_INT i=0; i<size; i++){
16  matA.array[i] += matB.array[i];
17  }
18 
19  matB.destroy();
20  return matA;
21 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const zhematrix matB 
)
friend

_zgematrix+zhematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.m!=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.n << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  for(CPPL_INT i=0; i<matB.n; i++){
15  for(CPPL_INT j=0; j<matB.n; j++){
16  matA(i,j) += matB(i,j);
17  }
18  }
19 
20  return matA;
21 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const _zhematrix matB 
)
friend

_zgematrix+_zhematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.m!=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.n << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  for(CPPL_INT i=0; i<matB.n; i++){
15  for(CPPL_INT j=0; j<matB.n; j++){
16  matA(i,j) += matB(i,j);
17  }
18  }
19 
20  matB.destroy();
21  return matA;
22 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
friend _zgematrix i(const _zgematrix &)
void destroy() const
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const zgbmatrix matB 
)
friend

_zgematrix+zgbmatrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.m!=matB.m){
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  for(CPPL_INT i=0; i<matB.m; i++){
15  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
16  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
17  matA(i,j) += matB(i,j);
18  }
19  }
20 
21  return matA;
22 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const _zgbmatrix matB 
)
friend

_zgematrix+_zgbmatrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.m!=matB.m){
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  for(CPPL_INT i=0; i<matB.m; i++){
15  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
16  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
17  matA(i,j)+=matB(i,j);
18  }
19  }
20 
21  matB.destroy();
22  return matA;
23 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
friend _zgematrix i(const _zgematrix &)
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const zgsmatrix matB 
)
friend

_zgematrix+zgsmatrix operator

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

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  const size_t matB_data_size =matB.data.size();
15  for(size_t c=0; c<matB_data_size; c++){
16  const zcomponent& z =matB.data[c];
17  matA(z.i,z.j) += z.v;
18  }
19 
20  return matA;
21 }
comple v
value of the component
Definition: zcomponent.hpp:11
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
std::vector< zcomponent > data
matrix data
Definition: zgsmatrix.hpp:11
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.hpp:3
CPPL_INT j
j index of the component
Definition: zcomponent.hpp:10
CPPL_INT i
i index of the component
Definition: zcomponent.hpp:9
CPPL_INT m
matrix row size
Definition: zgsmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: zgsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator+ ( const _zgematrix matA,
const _zgsmatrix matB 
)
friend

_zgematrix+_zgsmatrix operator

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

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  const size_t matB_data_size =matB.data.size();
15  for(size_t c=0; c<matB_data_size; c++){
16  const zcomponent& z =matB.data[c];
17  matA(z.i,z.j) += z.v;
18  }
19 
20  matB.destroy();
21  return matA;
22 }
comple v
value of the component
Definition: zcomponent.hpp:11
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgsmatrix.hpp:10
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.hpp:3
CPPL_INT j
j index of the component
Definition: zcomponent.hpp:10
CPPL_INT m
matrix row size
Definition: _zgsmatrix.hpp:9
void destroy() const
CPPL_INT i
i index of the component
Definition: zcomponent.hpp:9
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11
_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 24 of file _zgematrix-zgematrix.hpp.

25 {CPPL_VERBOSE_REPORT;
26 #ifdef CPPL_DEBUG
27  if(matA.n!=matB.n || matA.m!=matB.m){
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.m << "x" << matB.n << ")." << std::endl;
31  exit(1);
32  }
33 #endif//CPPL_DEBUG
34 
35  const CPPL_INT size =matA.m*matA.n;
36  for(CPPL_INT i=0; i<size; i++){
37  matA.array[i] -= matB.array[i];
38  }
39 
40  return matA;
41 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
comple * array
1D array to store matrix data
Definition: zgematrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const _zgematrix matB 
)
friend

_zgematrix-_zgematrix operator

Definition at line 25 of file _zgematrix-_zgematrix.hpp.

26 {CPPL_VERBOSE_REPORT;
27 #ifdef CPPL_DEBUG
28  if(matA.n!=matB.n || matA.m!=matB.m){
29  ERROR_REPORT;
30  std::cerr << "These two matrises can not make a subtraction." << std::endl
31  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl;
32  exit(1);
33  }
34 #endif//CPPL_DEBUG
35 
36  const CPPL_INT size =matA.m*matA.n;
37  for(CPPL_INT i=0; i<size; i++){
38  matA.array[i]-=matB.array[i];
39  }
40 
41  matB.destroy();
42  return matA;
43 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const zhematrix matB 
)
friend

_zgematrix-zhematrix operator

Definition at line 25 of file _zgematrix-zhematrix.hpp.

26 {CPPL_VERBOSE_REPORT;
27 #ifdef CPPL_DEBUG
28  if(matA.n!=matB.n || matA.m!=matB.n){
29  ERROR_REPORT;
30  std::cerr << "These two matrises can not make a summation." << std::endl
31  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
32  exit(1);
33  }
34 #endif//CPPL_DEBUG
35 
36  for(CPPL_INT i=0; i<matB.n; i++){
37  for(CPPL_INT j=0; j<matB.n; j++){
38  matA(i,j) -= matB(i,j);
39  }
40  }
41 
42  return matA;
43 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const _zhematrix matB 
)
friend

_zgematrix-_zhematrix operator

Definition at line 26 of file _zgematrix-_zhematrix.hpp.

27 {CPPL_VERBOSE_REPORT;
28 #ifdef CPPL_DEBUG
29  if(matA.n!=matB.n || matA.m!=matB.n){
30  ERROR_REPORT;
31  std::cerr << "These two matrises can not make a summation." << std::endl
32  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
33  exit(1);
34  }
35 #endif//CPPL_DEBUG
36 
37  for(CPPL_INT i=0; i<matB.n; i++){
38  for(CPPL_INT j=0; j<matB.n; j++){
39  matA(i,j) -= matB(i,j);
40  }
41  }
42 
43  matB.destroy();
44  return matA;
45 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
friend _zgematrix i(const _zgematrix &)
void destroy() const
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const zgbmatrix matB 
)
friend

_zgematrix-zgbmatrix operator

Definition at line 26 of file _zgematrix-zgbmatrix.hpp.

27 {CPPL_VERBOSE_REPORT;
28 #ifdef CPPL_DEBUG
29  if(matA.n!=matB.n || matA.m!=matB.m){
30  ERROR_REPORT;
31  std::cerr << "These two matrises can not make a summation." << std::endl
32  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
33  exit(1);
34  }
35 #endif//CPPL_DEBUG
36 
37  for(CPPL_INT i=0; i<matB.m; i++){
38  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
39  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
40  matA(i,j) -= matB(i,j);
41  }
42  }
43 
44  return matA;
45 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const _zgbmatrix matB 
)
friend

_zgematrix-_zgbmatrix operator

Definition at line 27 of file _zgematrix-_zgbmatrix.hpp.

28 {CPPL_VERBOSE_REPORT;
29 #ifdef CPPL_DEBUG
30  if(matA.n!=matB.n || matA.m!=matB.m){
31  ERROR_REPORT;
32  std::cerr << "These two matrises can not make a summation." << std::endl
33  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
34  exit(1);
35  }
36 #endif//CPPL_DEBUG
37 
38  for(CPPL_INT i=0; i<matB.m; i++){
39  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
40  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
41  matA(i,j)-=matB(i,j);
42  }
43  }
44 
45  matB.destroy();
46  return matA;
47 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
friend _zgematrix i(const _zgematrix &)
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const zgsmatrix matB 
)
friend

_zgematrix-zgsmatrix operator

Definition at line 25 of file _zgematrix-zgsmatrix.hpp.

26 {CPPL_VERBOSE_REPORT;
27 #ifdef CPPL_DEBUG
28  if(matA.m!=matB.m || matA.n!=matB.n){
29  ERROR_REPORT;
30  std::cerr << "These two matrises can not make a subtraction." << std::endl
31  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
32  exit(1);
33  }
34 #endif//CPPL_DEBUG
35 
36  const size_t matB_data_size =matB.data.size();
37  for(size_t c=0; c<matB_data_size; c++){
38  const zcomponent& z =matB.data[c];
39  matA(z.i,z.j) -= z.v;
40  }
41 
42  return matA;
43 }
comple v
value of the component
Definition: zcomponent.hpp:11
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
std::vector< zcomponent > data
matrix data
Definition: zgsmatrix.hpp:11
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.hpp:3
CPPL_INT j
j index of the component
Definition: zcomponent.hpp:10
CPPL_INT i
i index of the component
Definition: zcomponent.hpp:9
CPPL_INT m
matrix row size
Definition: zgsmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: zgsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator- ( const _zgematrix matA,
const _zgsmatrix matB 
)
friend

_zgematrix-_zgsmatrix operator

Definition at line 26 of file _zgematrix-_zgsmatrix.hpp.

27 {CPPL_VERBOSE_REPORT;
28 #ifdef CPPL_DEBUG
29  if(matA.m!=matB.m || matA.n!=matB.n){
30  ERROR_REPORT;
31  std::cerr << "These two matrises can not make a subtraction." << std::endl
32  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
33  exit(1);
34  }
35 #endif//CPPL_DEBUG
36 
37  const size_t matB_data_size =matB.data.size();
38  for(size_t c=0; c<matB_data_size; c++){
39  const zcomponent& z =matB.data[c];
40  matA(z.i,z.j) -= z.v;
41  }
42 
43  matB.destroy();
44  return matA;
45 }
comple v
value of the component
Definition: zcomponent.hpp:11
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgsmatrix.hpp:10
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.hpp:3
CPPL_INT j
j index of the component
Definition: zcomponent.hpp:10
CPPL_INT m
matrix row size
Definition: _zgsmatrix.hpp:9
void destroy() const
CPPL_INT i
i index of the component
Definition: zcomponent.hpp:9
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11
_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.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(mat.n!=vec.l){
7  ERROR_REPORT;
8  std::cerr << "These matrix and vector can not make a product." << std::endl
9  << "Your input was (" << mat.m << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zcovector newvec(mat.m);
15  char trans ='n';
16  comple alpha =comple(1.,0.);
17  CPPL_INT inc =1;
18  comple beta =comple(0.,0.);
19 
20  zgemv_( &trans, &mat.m, &mat.n, &alpha, mat.array, &mat.m, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  mat.destroy();
23  return _(newvec);
24 }
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT l
vector size
Definition: zcovector.hpp:9
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zcovector operator* ( const _zgematrix mat,
const _zcovector vec 
)
friend

_zgematrix*_zcovector operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(mat.n!=vec.l){
7  ERROR_REPORT;
8  std::cerr << "These matrix and vector can not make a product." << std::endl
9  << "Your input was (" << mat.m << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zcovector newvec(mat.m);
15  char trans ='n';
16  comple alpha =comple(1.,0.);
17  CPPL_INT inc =1;
18  comple beta =comple(0.,0.);
19 
20  zgemv_( &trans, &mat.m, &mat.n, &alpha, mat.array, &mat.m, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  mat.destroy();
23  vec.destroy();
24  return _(newvec);
25 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
void destroy() const
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const zgematrix matB 
)
friend

_zgematrix*zgematrix operator

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

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.m << "x" << matB.n << ")." << std::endl;
52  exit(1);
53  }
54 #endif//CPPL_DEBUG
55 
56  zgematrix newmat( matA.m, matB.n );
57  char transa ='n';
58  char transb ='n';
59  comple alpha =comple(1.,0.);
60  comple beta =comple(0.,0.);
61 
62  zgemm_( &transa, &transb, &matA.m, &matB.n, &matA.n, &alpha, matA.array, &matA.m, matB.array, &matB.m, &beta, newmat.array, &matA.m );
63 
64  matA.destroy();
65  return _(newmat);
66 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
comple * array
1D array to store matrix data
Definition: zgematrix.hpp:11
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const _zgematrix matB 
)
friend

_zgematrix*_zgematrix operator

Definition at line 47 of file _zgematrix-_zgematrix.hpp.

48 {CPPL_VERBOSE_REPORT;
49 #ifdef CPPL_DEBUG
50  if(matA.n!=matB.m){
51  ERROR_REPORT;
52  std::cerr << "These two matrises can not make a product." << std::endl
53  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
54  exit(1);
55  }
56 #endif//CPPL_DEBUG
57 
58  zgematrix newmat( matA.m, matB.n );
59  char transa ='n';
60  char transb ='n';
61  comple alpha =comple(1.,0.);
62  comple beta =comple(0.,0.);
63 
64  zgemm_( &transa, &transb, &matA.m, &matB.n, &matA.n, &alpha, matA.array, &matA.m, matB.array, &matB.m, &beta, newmat.array, &matA.m );
65 
66  matA.destroy();
67  matB.destroy();
68  return _(newmat);
69 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const zhematrix matB 
)
friend

_zgematrix*zhematrix operator

Definition at line 47 of file _zgematrix-zhematrix.hpp.

48 {CPPL_VERBOSE_REPORT;
49 #ifdef CPPL_DEBUG
50  if(matA.n!=matB.n){
51  ERROR_REPORT;
52  std::cerr << "These two matrises can not make a product." << std::endl
53  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
54  exit(1);
55  }
56 #endif//CPPL_DEBUG
57 
58  zgematrix newmat( matA.m, matB.n );
59  char side ='R';
60  char uplo ='l';
61  comple alpha =comple(1.,0.);
62  comple beta =comple(0.,0.);
63 
64  zhemm_( &side, &uplo, &newmat.m, &newmat.n, &alpha, matB.array, &matB.n, matA.array, &matA.m, &beta, newmat.array, &newmat.m );
65 
66  matA.destroy();
67  return _(newmat);
68 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
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
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const _zhematrix matB 
)
friend

_zgematrix*_zhematrix operator

Definition at line 49 of file _zgematrix-_zhematrix.hpp.

50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  if(matA.n!=matB.n){
53  ERROR_REPORT;
54  std::cerr << "These two matrises can not make a product." << std::endl
55  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
56  exit(1);
57  }
58 #endif//CPPL_DEBUG
59 
60  zgematrix newmat( matA.m, matB.n );
61  char side ='R';
62  char uplo ='l';
63  comple alpha =comple(1.,0.);
64  comple beta =comple(0.,0.);
65 
66  zhemm_( &side, &uplo, &newmat.m, &newmat.n, &alpha, matB.array, &matB.n, matA.array, &matA.m, &beta, newmat.array, &newmat.m );
67 
68  matA.destroy();
69  matB.destroy();
70  return _(newmat);
71 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
comple * array
1D array to store matrix data
Definition: _zhematrix.hpp:12
void destroy() const
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const zgbmatrix matB 
)
friend

_zgematrix*zgbmatrix operator

Definition at line 49 of file _zgematrix-zgbmatrix.hpp.

50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  if(matA.n!=matB.m){
53  ERROR_REPORT;
54  std::cerr << "These two matrises can not make a product." << std::endl
55  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
56  exit(1);
57  }
58 #endif//CPPL_DEBUG
59 
60  zgematrix newmat( matA.m, matB.n );
61  newmat.zero();
62 
63  for(CPPL_INT i=0; i<newmat.m; i++){
64  for(CPPL_INT j=0; j<newmat.n; j++){
65  const CPPL_INT kmax =std::min(matB.m,j+matB.kl+1);
66  for(CPPL_INT k=std::max(CPPL_INT(0),j-matB.ku); k<kmax; k++){
67  newmat(i,j) += matA(i,k)*matB(k,j);
68  }
69  }
70  }
71 
72  matA.destroy();
73  return _(newmat);
74 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: zgbmatrix.hpp:10
CPPL_INT ku
upper band width
Definition: zgbmatrix.hpp:12
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
CPPL_INT m
matrix row size
Definition: zgbmatrix.hpp:9
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const _zgbmatrix matB 
)
friend

_zgematrix*_zgbmatrix operator

Definition at line 51 of file _zgematrix-_zgbmatrix.hpp.

52 {CPPL_VERBOSE_REPORT;
53 #ifdef CPPL_DEBUG
54  if(matA.n!=matB.m){
55  ERROR_REPORT;
56  std::cerr << "These two matrises can not make a product." << std::endl
57  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
58  exit(1);
59  }
60 #endif//CPPL_DEBUG
61 
62  zgematrix newmat( matA.m, matB.n );
63  newmat.zero();
64 
65  for(CPPL_INT i=0; i<newmat.m; i++){
66  for(CPPL_INT j=0; j<newmat.n; j++){
67  const CPPL_INT kmax =std::min(matB.m,j+matB.kl+1);
68  for(CPPL_INT k=std::max(CPPL_INT(0),j-matB.ku); k<kmax; k++){
69  newmat(i,j)+=matA(i,k)*matB(k,j);
70  }
71  }
72  }
73 
74  matA.destroy();
75  matB.destroy();
76  return _(newmat);
77 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
friend _zgematrix i(const _zgematrix &)
void destroy() const
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const zgsmatrix matB 
)
friend

_zgematrix*zgsmatrix operator

Definition at line 47 of file _zgematrix-zgsmatrix.hpp.

48 {CPPL_VERBOSE_REPORT;
49 #ifdef CPPL_DEBUG
50  if(matA.n!=matB.m){
51  ERROR_REPORT;
52  std::cerr << "These two matrises can not make a product." << std::endl
53  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
54  exit(1);
55  }
56 #endif//CPPL_DEBUG
57 
58  zgematrix newmat(matA.m, matB.n);
59  newmat.zero();
60 
61  const size_t matB_data_size =matB.data.size();
62  for(size_t c=0; c<matB_data_size; c++){
63  const zcomponent& z =matB.data[c];
64  for(CPPL_INT i=0; i<matA.m; i++){
65  newmat(i,z.j) += matA(i,z.i)*z.v;
66  }
67  }
68 
69  matA.destroy();
70  return _(newmat);
71 }
comple v
value of the component
Definition: zcomponent.hpp:11
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
std::vector< zcomponent > data
matrix data
Definition: zgsmatrix.hpp:11
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.hpp:3
CPPL_INT j
j index of the component
Definition: zcomponent.hpp:10
void destroy() const
CPPL_INT i
i index of the component
Definition: zcomponent.hpp:9
CPPL_INT m
matrix row size
Definition: zgsmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: zgsmatrix.hpp:10
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix matA,
const _zgsmatrix matB 
)
friend

_zgematrix*_zgsmatrix operator

Definition at line 49 of file _zgematrix-_zgsmatrix.hpp.

50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  if(matA.n!=matB.m){
53  ERROR_REPORT;
54  std::cerr << "These two matrises can not make a product." << std::endl
55  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
56  exit(1);
57  }
58 #endif//CPPL_DEBUG
59 
60  zgematrix newmat(matA.m, matB.n);
61  newmat.zero();
62 
63  const size_t matB_data_size =matB.data.size();
64  for(size_t c=0; c<matB_data_size; c++){
65  const zcomponent& z =matB.data[c];
66  for(CPPL_INT i=0; i<matA.m; i++){
67  newmat(i,z.j) += matA(i,z.i)*z.v;
68  }
69  }
70 
71  matA.destroy();
72  matB.destroy();
73  return _(newmat);
74 }
comple v
value of the component
Definition: zcomponent.hpp:11
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
friend _zgematrix i(const _zgematrix &)
CPPL_INT n
matrix column size
Definition: _zgsmatrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
Component Class for Complex Double-precision Sparse Matrix Classes.
Definition: zcomponent.hpp:3
CPPL_INT j
j index of the component
Definition: zcomponent.hpp:10
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgsmatrix.hpp:9
void destroy() const
CPPL_INT i
i index of the component
Definition: zcomponent.hpp:9
_dcovector _(dcovector &vec)
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11
_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.

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =mat.m*mat.n;
6  CPPL_INT inc =1;
7  zdscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const _zgematrix mat,
const comple &  d 
)
friend

_zgematrix*comple operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =mat.m*mat.n;
6  CPPL_INT inc =1;
7  zscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator/ ( const _zgematrix mat,
const double &  d 
)
friend

_zgematrix/double operator

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

14 {CPPL_VERBOSE_REPORT;
15  CPPL_INT size =mat.m*mat.n;
16  double dinv =1./d;
17  CPPL_INT inc =1;
18  zdscal_(&size, &dinv, mat.array, &inc);
19  return mat;
20 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator/ ( const _zgematrix mat,
const comple &  d 
)
friend

_zgematrix/comple operator

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

14 {CPPL_VERBOSE_REPORT;
15  CPPL_INT size =mat.m*mat.n;
16  comple dinv =1./d;
17  CPPL_INT inc =1;
18  zscal_(&size, &dinv, mat.array, &inc);
19  return mat;
20 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const double &  d,
const _zgematrix mat 
)
friend

double*_zgematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =mat.m*mat.n;
6  CPPL_INT inc =1;
7  zdscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10
_zgematrix operator* ( const comple &  d,
const _zgematrix mat 
)
friend

comple*_zgematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =mat.m*mat.n;
6  CPPL_INT inc =1;
7  zscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT m
matrix row size
Definition: _zgematrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zgematrix.hpp:10

Member Data Documentation

CPPL_INT _zgematrix::m
mutable
CPPL_INT _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: