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

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

#include <_zgbmatrix.hpp>

Public Member Functions

 _zgbmatrix ()
 
 _zgbmatrix (const _zgbmatrix &)
 
 ~_zgbmatrix ()
 
_zgematrix to_zgematrix () const
 
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...
 
CPPL_INT kl
 lower band width More...
 
CPPL_INT ku
 upper band width 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 _zgbmatrix &)
 
_zgbmatrix t (const _zgbmatrix &)
 
_zgematrix i (const _zgbmatrix &)
 
_zgbmatrix conj (const _zgbmatrix &)
 
_zgbmatrix conjt (const _zgbmatrix &)
 
const _zgbmatrixoperator+ (const _zgbmatrix &)
 
_zgbmatrix operator- (const _zgbmatrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const zgematrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const _zgematrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const zhematrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const _zhematrix &)
 
_zgbmatrix operator+ (const _zgbmatrix &, const zgbmatrix &)
 
_zgbmatrix operator+ (const _zgbmatrix &, const _zgbmatrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const zgsmatrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const _zgsmatrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const zhsmatrix &)
 
_zgematrix operator+ (const _zgbmatrix &, const _zhsmatrix &)
 
_zgematrix operator- (const _zgbmatrix &, const zgematrix &)
 
_zgematrix operator- (const _zgbmatrix &, const _zgematrix &)
 
_zgematrix operator- (const _zgbmatrix &, const zhematrix &)
 
_zgematrix operator- (const _zgbmatrix &, const _zhematrix &)
 
_zgbmatrix operator- (const _zgbmatrix &, const zgbmatrix &)
 
_zgbmatrix operator- (const _zgbmatrix &, const _zgbmatrix &)
 
_zgematrix operator- (const _zgbmatrix &, const zgsmatrix &)
 
_zgematrix operator- (const _zgbmatrix &, const _zgsmatrix &)
 
_zgematrix operator- (const _zgbmatrix &, const zhsmatrix &)
 
_zgematrix operator- (const _zgbmatrix &, const _zhsmatrix &)
 
_zcovector operator* (const _zgbmatrix &, const zcovector &)
 
_zcovector operator* (const _zgbmatrix &, const _zcovector &)
 
_zgematrix operator* (const _zgbmatrix &, const zgematrix &)
 
_zgematrix operator* (const _zgbmatrix &, const _zgematrix &)
 
_zgematrix operator* (const _zgbmatrix &, const zhematrix &)
 
_zgematrix operator* (const _zgbmatrix &, const _zhematrix &)
 
_zgbmatrix operator* (const _zgbmatrix &, const zgbmatrix &)
 
_zgbmatrix operator* (const _zgbmatrix &, const _zgbmatrix &)
 
_zgematrix operator* (const _zgbmatrix &, const zgsmatrix &)
 
_zgematrix operator* (const _zgbmatrix &, const _zgsmatrix &)
 
_zgematrix operator* (const _zgbmatrix &, const zhsmatrix &)
 
_zgematrix operator* (const _zgbmatrix &, const _zhsmatrix &)
 
_zgbmatrix operator* (const _zgbmatrix &, const double &)
 
_zgbmatrix operator* (const _zgbmatrix &, const comple &)
 
_zgbmatrix operator/ (const _zgbmatrix &, const double &)
 
_zgbmatrix operator/ (const _zgbmatrix &, const comple &)
 
_zgbmatrix operator* (const double &, const _zgbmatrix &)
 
_zgbmatrix operator* (const comple &, const _zgbmatrix &)
 

Detailed Description

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

Definition at line 3 of file _zgbmatrix.hpp.

Constructor & Destructor Documentation

_zgbmatrix::_zgbmatrix ( )
inline

_zgbmatrix constructor

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

References array, darray, kl, ku, m, and n.

4 {CPPL_VERBOSE_REPORT;
5  m =0;
6  n =0;
7  kl =0;
8  ku =0;
9  array =NULL;
10  darray =NULL;
11 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
comple ** darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:14
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix::_zgbmatrix ( const _zgbmatrix mat)
inline

_zgbmatrix copy constructor

Definition at line 15 of file _zgbmatrix-constructor.hpp.

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

16 {CPPL_VERBOSE_REPORT;
17  //////// initialize ////////
18  m =mat.m;
19  n =mat.n;
20  kl =mat.kl;
21  ku =mat.ku;
22  array =mat.array;
23  darray =mat.darray;
24 
25  mat.nullify();
26 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
void nullify() const
comple ** darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:14
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix::~_zgbmatrix ( )
inline

_zgbmatrix destructor

Definition at line 34 of file _zgbmatrix-constructor.hpp.

References array, and darray.

35 {CPPL_VERBOSE_REPORT;
36  delete [] array;
37  delete [] darray;
38 }
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
comple ** darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:14

Member Function Documentation

_zgematrix _zgbmatrix::to_zgematrix ( ) const
inline

convert to _zgematrix

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

References _(), destroy(), i, kl, ku, m, and n.

4 {CPPL_VERBOSE_REPORT;
5  zgematrix newmat( zgematrix(m,n).zero() );
6 
7  for(CPPL_INT i=0; i<m; i++){
8  const CPPL_INT jmax =std::min(n,i+ku+1);
9  for(CPPL_INT j=std::max(CPPL_INT(0),i-kl); j<jmax; j++){
10  newmat(i,j) =(*this)(i,j);
11  }
12  }
13 
14  destroy();
15  return _(newmat);
16 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
comple & _zgbmatrix::operator() ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

operator() for const object

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

References darray, i, kl, ku, m, and n.

Referenced by write().

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if( i<0 || j<0 || m<=i || n<=j || i-j>kl || j-i>ku ){
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 " << n << "x" << n << " with kl=" << kl << ", ku=" << ku << "." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  //return array[ku+i+(kl+ku)*j];
15  return darray[j][ku-j+i];
16 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple ** darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:14
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
friend _zgematrix i(const _zgbmatrix &)
void _zgbmatrix::write ( const char *  filename) const
inline

Definition at line 42 of file _zgbmatrix-io.hpp.

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

43 {CPPL_VERBOSE_REPORT;
44  std::ofstream ofs(filename, std::ios::trunc);
45  ofs.setf(std::cout.flags());
46  ofs.precision(std::cout.precision());
47  ofs.width(std::cout.width());
48  ofs.fill(std::cout.fill());
49 
50  ofs << "#zgbmatrix" << " " << m << " " << n << " " << kl << " " << ku << std::endl;
51  for(CPPL_INT i=0; i<m; i++){
52  const CPPL_INT jmax =std::min(n,i+ku+1);
53  for(CPPL_INT j=std::max(CPPL_INT(0),i-kl); j<jmax; j++){
54  ofs << operator()(i,j) << " ";
55  }
56  ofs << std::endl;
57  }
58 
59  ofs.close();
60  destroy();
61 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
comple & operator()(const CPPL_INT &, const CPPL_INT &) const
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
friend _zgematrix i(const _zgbmatrix &)
void _zgbmatrix::nullify ( ) const
inline

nullify all the matrix data

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

References array, darray, kl, ku, m, and n.

Referenced by _zgbmatrix(), zgbmatrix::shallow_copy(), and zgbmatrix::zgbmatrix().

4 {CPPL_VERBOSE_REPORT;
5  m=0;
6  n=0;
7  kl=0;
8  ku=0;
9  array=NULL;
10  darray=NULL;
11 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
comple ** darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:14
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
void _zgbmatrix::destroy ( ) const
inline

destroy all the matrix data

Definition at line 16 of file _zgbmatrix-misc.hpp.

References array, and darray.

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

17 {CPPL_VERBOSE_REPORT;
18  delete [] array;
19  delete [] darray;
20  array=NULL;
21  darray=NULL;
22 }
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
comple ** darray
array of pointers of column head addresses
Definition: _zgbmatrix.hpp:14

Friends And Related Function Documentation

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

Definition at line 23 of file _zgbmatrix-io.hpp.

24 {CPPL_VERBOSE_REPORT;
25  for(CPPL_INT i=0; i<mat.m; i++){
26  for(CPPL_INT j=0; j<mat.n; j++){
27  if( i-j>mat.kl || j-i>mat.ku ){ s << " x"; }
28  else{ s << " " << mat(i,j); }
29  }
30  s << std::endl;
31  }
32 
33  mat.destroy();
34  return s;
35 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix t ( const _zgbmatrix mat)
friend

return its transposed zgbmatrix

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

4 {CPPL_VERBOSE_REPORT;
5  zgbmatrix newmat(mat.n, mat.m, mat.ku, mat.kl);
6  for(CPPL_INT i=0; i<newmat.m; i++){
7  const CPPL_INT jmax =std::min(newmat.n,i+newmat.ku+1);
8  for(CPPL_INT j=std::max(CPPL_INT(0),i-newmat.kl); j<jmax; j++){
9  newmat(i,j) =mat(j,i);
10  }
11  }
12 
13  mat.destroy();
14  return _(newmat);
15 }
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
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgematrix i ( const _zgbmatrix mat)
friend

return its inverse matrix

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

Referenced by operator()(), to_zgematrix(), 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  zgbmatrix mat_cp(mat);
31  zgematrix mat_inv(mat_cp.m,mat_cp.n);
32  mat_inv.identity();
33  mat_cp.zgbsv(mat_inv);
34 
35  return _(mat_inv);
36 }
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
_zgbmatrix conj ( const _zgbmatrix mat)
friend

return its conjugate matrix

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

45 {CPPL_VERBOSE_REPORT;
46  for(CPPL_INT i=0; i<mat.m; i++){
47  const CPPL_INT jmax =std::min(mat.n,i+mat.ku+1);
48  for(CPPL_INT j=std::max(CPPL_INT(0),i-mat.kl); j<jmax; j++){
49  mat(i,j) =std::conj(mat(i,j));
50  }
51  }
52 
53  return mat;
54 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
_zgbmatrix conj(const _zgbmatrix &mat)
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix conjt ( const _zgbmatrix mat)
friend

return its conjugate transposed zgbmatrix

Definition at line 58 of file _zgbmatrix-calc.hpp.

59 {CPPL_VERBOSE_REPORT;
60  zgbmatrix newmat(mat.n, mat.m, mat.ku, mat.kl);
61 
62  for(CPPL_INT i=0; i<newmat.m; i++){
63  const CPPL_INT jmax =std::min(newmat.n,i+newmat.ku+1);
64  for(CPPL_INT j=std::max(CPPL_INT(0),i-newmat.kl); j<jmax; j++){
65  newmat(i,j) =std::conj(mat(j,i));
66  }
67  }
68 
69  mat.destroy();
70  return _(newmat);
71 }
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
_zgbmatrix conj(const _zgbmatrix &mat)
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
const _zgbmatrix& operator+ ( const _zgbmatrix mat)
friend

+_zgbmatrix operator

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

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

-_zgbmatrix operator

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

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

_zgbmatrix+zgematrix operator

Definition at line 3 of file _zgbmatrix-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  zgematrix newmat(matB);
15 
16  for(CPPL_INT i=0; i<matA.m; i++){
17  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
18  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
19  newmat(i,j) += matA(i,j);
20  }
21  }
22 
23  matA.destroy();
24  return _(newmat);
25 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
CPPL_INT n
matrix column size
Definition: zgematrix.hpp:10
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: zgematrix.hpp:9
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator+ ( const _zgbmatrix matA,
const _zgematrix matB 
)
friend

_zgbmatrix+_zgematrix operator

Definition at line 3 of file _zgbmatrix-_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  for(CPPL_INT i=0; i<matA.m; i++){
15  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
16  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
17  matB(i,j)+=matA(i,j);
18  }
19  }
20 
21  matA.destroy();
22  return matB;
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
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
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator+ ( const _zgbmatrix matA,
const zhematrix matB 
)
friend

_zgbmatrix+zhematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.m!=matB.n || 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.n << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zgematrix newmat( matB.to_zgematrix() );
15 
16  for(CPPL_INT i=0; i<matA.m; i++){
17  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
18  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
19  newmat(i,j) += matA(i,j);
20  }
21  }
22 
23  matA.destroy();
24  return _(newmat);
25 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
_zgematrix to_zgematrix() const
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator+ ( const _zgbmatrix matA,
const _zhematrix matB 
)
friend

_zgbmatrix+_zhematrix operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.m!=matB.n || 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.n << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  zgematrix newmat(matB.n, matB.n);
15  for(CPPL_INT i=0; i<matA.m; i++){
16  for(CPPL_INT j=0; j<matB.n; j++){
17  newmat(i,j) = matB(i,j);
18  }
19  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
20  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
21  newmat(i,j) += matA(i,j);
22  }
23  }
24 
25  matA.destroy();
26  matB.destroy();
27  return _(newmat);
28 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
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)
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix operator+ ( const _zgbmatrix matA,
const zgbmatrix matB 
)
friend

_zgbmatrix+zgbmatrix operator

Definition at line 3 of file _zgbmatrix-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  if(matA.kl>=matB.kl && matA.ku>=matB.ku){
15  for(CPPL_INT i=0; i<matB.m; i++){
16  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
17  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
18  matA(i,j) += matB(i,j);
19  }
20  }
21 
22  return matA;
23  }
24 
25  else{
26  zgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku));
27  newmat.zero();
28 
29  for(CPPL_INT i=0; i<matA.m; i++){
30  const CPPL_INT jmax1 =std::min(matA.n,i+matA.ku+1);
31  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax1; j++){
32  newmat(i,j) += matA(i,j);
33  }
34  const CPPL_INT jmax2 =std::min(matB.n,i+matB.ku+1);
35  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax2; j++){
36  newmat(i,j) += matB(i,j);
37  }
38  }
39 
40  matA.destroy();
41  return _(newmat);
42  }
43 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
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
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix operator+ ( const _zgbmatrix matA,
const _zgbmatrix matB 
)
friend

_zgbmatrix+_zgbmatrix operator

Definition at line 3 of file _zgbmatrix-_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  if(matA.kl>matB.kl && matA.ku>matB.ku){
15  for(CPPL_INT i=0; i<matB.m; i++){
16  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
17  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
18  matA(i,j) += matB(i,j);
19  }
20  }
21 
22  matB.destroy();
23  return matA;
24  }
25 
26  else if(matB.kl>matA.kl && matB.ku>matA.ku){
27  for(CPPL_INT i=0; i<matA.m; i++){
28  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
29  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
30  matB(i,j) += matA(i,j);
31  }
32  }
33 
34  matA.destroy();
35  return matB;
36  }
37 
38  else{
39  zgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku));
40  newmat.zero();
41 
42  for(CPPL_INT i=0; i<matA.m; i++){
43  const CPPL_INT jmax1 =std::min(matA.n,i+matA.ku+1);
44  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax1; j++){
45  newmat(i,j) += matA(i,j);
46  }
47  const CPPL_INT jmax2 =std::min(matB.n,i+matB.ku+1);
48  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax2; j++){
49  newmat(i,j) += matB(i,j);
50  }
51  }
52 
53  matA.destroy();
54  matB.destroy();
55  return _(newmat);
56  }
57 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator+ ( const _zgbmatrix ,
const zgsmatrix  
)
friend
_zgematrix operator+ ( const _zgbmatrix ,
const _zgsmatrix  
)
friend
_zgematrix operator+ ( const _zgbmatrix ,
const zhsmatrix  
)
friend
_zgematrix operator+ ( const _zgbmatrix ,
const _zhsmatrix  
)
friend
_zgematrix operator- ( const _zgbmatrix matA,
const zgematrix matB 
)
friend

_zgbmatrix-zgematrix operator

Definition at line 29 of file _zgbmatrix-zgematrix.hpp.

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

_zgbmatrix-_zgematrix operator

Definition at line 27 of file _zgbmatrix-_zgematrix.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<matA.m; i++){
39  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
40  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
41  matB(i,j) =matA(i,j)-matB(i,j);
42  }
43  }
44 
45  matA.destroy();
46  return matB;
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
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
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator- ( const _zgbmatrix matA,
const zhematrix matB 
)
friend

_zgbmatrix-zgematrix operator

_zgbmatrix-zhematrix operator

Definition at line 29 of file _zgbmatrix-zhematrix.hpp.

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

_zgbmatrix-_zhematrix operator

Definition at line 32 of file _zgbmatrix-_zhematrix.hpp.

33 {CPPL_VERBOSE_REPORT;
34 #ifdef CPPL_DEBUG
35  if(matA.m!=matB.n || matA.n!=matB.n){
36  ERROR_REPORT;
37  std::cerr << "These two matrises can not make a summation." << std::endl
38  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
39  exit(1);
40  }
41 #endif//CPPL_DEBUG
42 
43  zgematrix newmat(matB.n, matB.n);
44  for(CPPL_INT i=0; i<newmat.m; i++){
45  for(CPPL_INT j=0; j<newmat.n; j++){
46  newmat(i,j) = -matB(i,j);
47  }
48  const CPPL_INT jmax =std::min(matA.n,i+matA.ku+1);
49  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax; j++){
50  newmat(i,j) += matA(i,j);
51  }
52  }
53 
54  matA.destroy();
55  matB.destroy();
56  return _(newmat);
57 }
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
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
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)
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix operator- ( const _zgbmatrix matA,
const zgbmatrix matB 
)
friend

_zgbmatrix-zgbmatrix operator

Definition at line 47 of file _zgbmatrix-zgbmatrix.hpp.

48 {CPPL_VERBOSE_REPORT;
49 #ifdef CPPL_DEBUG
50  if(matA.n!=matB.n || matA.m!=matB.m){
51  ERROR_REPORT;
52  std::cerr << "These two matrises can not make a subtraction." << 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  if(matA.kl>=matB.kl && matA.ku>=matB.ku){
59  for(CPPL_INT i=0; i<matB.m; i++){
60  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
61  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
62  matA(i,j) -= matB(i,j);
63  }
64  }
65 
66  return matA;
67  }
68 
69  else{
70  zgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku));
71  newmat.zero();
72 
73  for(CPPL_INT i=0; i<matA.m; i++){
74  const CPPL_INT jmax1 =std::min(matA.n,i+matA.ku+1);
75  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax1; j++){
76  newmat(i,j) += matA(i,j);
77  }
78  const CPPL_INT jmax2 =std::min(matB.n,i+matB.ku+1);
79  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax2; j++){
80  newmat(i,j) -= matB(i,j);
81  }
82  }
83 
84  return _(newmat);
85  }
86 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
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
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix operator- ( const _zgbmatrix matA,
const _zgbmatrix matB 
)
friend

_zgbmatrix-_zgbmatrix operator

Definition at line 61 of file _zgbmatrix-_zgbmatrix.hpp.

62 {CPPL_VERBOSE_REPORT;
63 #ifdef CPPL_DEBUG
64  if(matA.n!=matB.n || matA.m!=matB.m){
65  ERROR_REPORT;
66  std::cerr << "These two matrises can not make a subtraction." << std::endl
67  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl;
68  exit(1);
69  }
70 #endif//CPPL_DEBUG
71 
72  if(matA.kl>matB.kl && matA.ku>matB.ku){
73  for(CPPL_INT i=0; i<matB.m; i++){
74  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
75  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
76  matA(i,j) -= matB(i,j);
77  }
78  }
79 
80  matB.destroy();
81  return matA;
82  }
83 
84  else{
85  zgbmatrix newmat(matA.m,matA.n,std::max(matA.kl,matB.kl),std::max(matA.ku,matB.ku));
86  newmat.zero();
87 
88  for(CPPL_INT i=0; i<matA.m; i++){
89  const CPPL_INT jmax1 =std::min(matA.n,i+matA.ku+1);
90  for(CPPL_INT j=std::max(CPPL_INT(0),i-matA.kl); j<jmax1; j++){
91  newmat(i,j) += matA(i,j);
92  }
93  const CPPL_INT jmax2 =std::min(matB.n,i+matB.ku+1);
94  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax2; j++){
95  newmat(i,j) -= matB(i,j);
96  }
97  }
98 
99  matA.destroy();
100  matB.destroy();
101  return _(newmat);
102  }
103 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator- ( const _zgbmatrix ,
const zgsmatrix  
)
friend
_zgematrix operator- ( const _zgbmatrix ,
const _zgsmatrix  
)
friend
_zgematrix operator- ( const _zgbmatrix ,
const zhsmatrix  
)
friend
_zgematrix operator- ( const _zgbmatrix ,
const _zhsmatrix  
)
friend
_zcovector operator* ( const _zgbmatrix mat,
const zcovector vec 
)
friend

_zgbmatrix*zcovector operator

Definition at line 3 of file _zgbmatrix-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 lda =mat.kl+mat.ku+1;
18  CPPL_INT inc =1;
19  comple beta =comple(0.,0.);
20 
21  zgbmv_( &trans, &mat.m, &mat.n, &mat.kl, &mat.ku, &alpha, mat.array, &lda, vec.array, &inc, &beta, newvec.array, &inc );
22 
23  mat.destroy();
24  return _(newvec);
25 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
comple * array
1D array to store vector data
Definition: zcovector.hpp:10
CPPL_INT l
vector size
Definition: zcovector.hpp:9
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
_zcovector operator* ( const _zgbmatrix mat,
const _zcovector vec 
)
friend

_zgbmatrix*_zcovector operator

Definition at line 3 of file _zgbmatrix-_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 lda =mat.kl+mat.ku+1;
18  CPPL_INT inc =1;
19  comple beta =comple(0.,0.);
20 
21  zgbmv_( &trans, &mat.m, &mat.n, &mat.kl, &mat.ku, &alpha, mat.array, &lda, vec.array, &inc, &beta, newvec.array, &inc );
22 
23  mat.destroy();
24  vec.destroy();
25  return _(newvec);
26 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
void destroy() const
void destroy() const
comple * array
1D array to store vector data
Definition: _zcovector.hpp:10
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
Complex Double-precision Column Vector Class.
Definition: zcovector.hpp:3
CPPL_INT l
vector size
Definition: _zcovector.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
_zgematrix operator* ( const _zgbmatrix matA,
const zgematrix matB 
)
friend

_zgbmatrix*zgematrix operator

Definition at line 55 of file _zgbmatrix-zgematrix.hpp.

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

_zgbmatrix*_zgematrix operator

Definition at line 51 of file _zgbmatrix-_zgematrix.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(matA.n,i+matA.ku+1);
68  for(CPPL_INT k=std::max(CPPL_INT(0),i-matA.kl); 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
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
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator* ( const _zgbmatrix matA,
const zhematrix matB 
)
friend

_zgbmatrix*zgematrix operator

_zgbmatrix*zhematrix operator

Definition at line 54 of file _zgbmatrix-zhematrix.hpp.

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

_zgbmatrix*_zhematrix operator

Definition at line 61 of file _zgbmatrix-_zhematrix.hpp.

62 {CPPL_VERBOSE_REPORT;
63 #ifdef CPPL_DEBUG
64  if(matA.n!=matB.n){
65  ERROR_REPORT;
66  std::cerr << "These two matrises can not make a product." << std::endl
67  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
68  exit(1);
69  }
70 #endif//CPPL_DEBUG
71 
72  zgematrix newmat( matA.m, matB.n );
73  newmat.zero();
74 
75  for(CPPL_INT i=0; i<newmat.m; i++){
76  for(CPPL_INT j=0; j<newmat.n; j++){
77  const CPPL_INT kmax =std::min(matA.n,i+matA.ku+1);
78  for(CPPL_INT k=std::max(CPPL_INT(0),i-matA.kl); k<kmax; k++){
79  newmat(i,j) += matA(i,k)*matB(k,j);
80  }
81  }
82  }
83 
84  matA.destroy();
85  matB.destroy();
86  return _(newmat);
87 }
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
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
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)
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix operator* ( const _zgbmatrix matA,
const zgbmatrix matB 
)
friend

_zgbmatrix*zgbmatrix operator

Definition at line 90 of file _zgbmatrix-zgbmatrix.hpp.

91 {CPPL_VERBOSE_REPORT;
92 #ifdef CPPL_DEBUG
93  if(matA.n!=matB.m){
94  ERROR_REPORT;
95  std::cerr << "These two matrises can not make a product." << std::endl
96  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
97  exit(1);
98  }
99 #endif//CPPL_DEBUG
100 
101  zgbmatrix newmat( matA.m, matB.n, std::min(matA.kl+matB.kl,matA.m-1), std::min(matA.ku+matB.ku,matB.n-1) );
102  newmat.zero();
103 
104  for(CPPL_INT i=0; i<newmat.m; i++){
105  const CPPL_INT jmax =std::min(newmat.n,i+newmat.ku+1);
106  for(CPPL_INT j=std::max(CPPL_INT(0),i-newmat.kl); j<jmax; j++){
107  const CPPL_INT kmax =std::min( std::min(matA.n,i+matA.ku+1), std::min(matB.m,j+matB.kl+1) );
108  for(CPPL_INT k=std::max( std::max(CPPL_INT(0),i-matA.kl), std::max(CPPL_INT(0),j-matB.ku) ); k<kmax; k++){
109  newmat(i,j) += matA(i,k)*matB(k,j);
110  }
111  }
112  }
113 
114  matA.destroy();
115  return _(newmat);
116 }
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
void destroy() const
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
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT kl
lower band width
Definition: zgbmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgbmatrix operator* ( const _zgbmatrix matA,
const _zgbmatrix matB 
)
friend

_zgbmatrix*_zgbmatrix operator

Definition at line 107 of file _zgbmatrix-_zgbmatrix.hpp.

108 {CPPL_VERBOSE_REPORT;
109 #ifdef CPPL_DEBUG
110  if(matA.n!=matB.m){
111  ERROR_REPORT;
112  std::cerr << "These two matrises can not make a product." << std::endl
113  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
114  exit(1);
115  }
116 #endif//CPPL_DEBUG
117 
118  zgbmatrix newmat( matA.m, matB.n, std::min(matA.kl+matB.kl,matA.m-1), std::min(matA.ku+matB.ku,matB.n-1) );
119  newmat.zero();
120 
121  for(CPPL_INT i=0; i<newmat.m; i++){
122  const CPPL_INT jmax =std::min(newmat.n,i+newmat.ku+1);
123  for(CPPL_INT j=std::max(CPPL_INT(0),i-newmat.kl); j<jmax; j++){
124  const CPPL_INT kmax =std::min( std::min(matA.n,i+matA.ku+1), std::min(matB.m,j+matB.kl+1) );
125  for(CPPL_INT k=std::max( std::max(CPPL_INT(0),i-matA.kl), std::max(CPPL_INT(0),j-matB.ku) ); k<kmax; k++){
126  newmat(i,j) += matA(i,k)*matB(k,j);
127  }
128  }
129  }
130 
131  matA.destroy();
132  matB.destroy();
133  return _(newmat);
134 }
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
void destroy() const
Complex Double-precision General Band Matrix Class.
Definition: zgbmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _zgbmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_dcovector _(dcovector &vec)
friend _zgematrix i(const _zgbmatrix &)
_zgematrix operator* ( const _zgbmatrix ,
const zgsmatrix  
)
friend
_zgematrix operator* ( const _zgbmatrix ,
const _zgsmatrix  
)
friend
_zgematrix operator* ( const _zgbmatrix ,
const zhsmatrix  
)
friend
_zgematrix operator* ( const _zgbmatrix ,
const _zhsmatrix  
)
friend
_zgbmatrix operator* ( const _zgbmatrix mat,
const double &  d 
)
friend

_zgbmatrix*double operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =(mat.kl+mat.ku+1)*mat.n;
6  CPPL_INT inc =1;
7  zdscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix operator* ( const _zgbmatrix mat,
const comple &  d 
)
friend

_zgbmatrix*comple operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =(mat.kl+mat.ku+1)*mat.n;
6  CPPL_INT inc =1;
7  zscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix operator/ ( const _zgbmatrix mat,
const double &  d 
)
friend

_zgbmatrix/double operator

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

14 {CPPL_VERBOSE_REPORT;
15  CPPL_INT size =(mat.kl+mat.ku+1)*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 ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix operator/ ( const _zgbmatrix mat,
const comple &  d 
)
friend

_zgbmatrix/comple operator

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

14 {CPPL_VERBOSE_REPORT;
15  CPPL_INT size =(mat.kl+mat.ku+1)*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 ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix operator* ( const double &  d,
const _zgbmatrix mat 
)
friend

double*_zgbmatrix operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =(mat.kl+mat.ku+1)*mat.n;
6  CPPL_INT inc =1;
7  zdscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10
_zgbmatrix operator* ( const comple &  d,
const _zgbmatrix mat 
)
friend

comple*_zgbmatrix operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT size =(mat.kl+mat.ku+1)*mat.n;
6  CPPL_INT inc =1;
7  zscal_(&size, &d, mat.array, &inc);
8  return mat;
9 }
CPPL_INT ku
upper band width
Definition: _zgbmatrix.hpp:12
CPPL_INT kl
lower band width
Definition: _zgbmatrix.hpp:11
comple * array
1D array to store matrix data
Definition: _zgbmatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _zgbmatrix.hpp:10

Member Data Documentation

CPPL_INT _zgbmatrix::m
mutable
CPPL_INT _zgbmatrix::n
mutable
CPPL_INT _zgbmatrix::kl
mutable
CPPL_INT _zgbmatrix::ku
mutable
comple* _zgbmatrix::array
mutable

1D array to store matrix data

Definition at line 13 of file _zgbmatrix.hpp.

Referenced by _(), _zgbmatrix(), destroy(), nullify(), operator*(), operator-(), operator/(), zgbmatrix::shallow_copy(), zgbmatrix::zgbmatrix(), and ~_zgbmatrix().

comple** _zgbmatrix::darray
mutable

array of pointers of column head addresses

Definition at line 14 of file _zgbmatrix.hpp.

Referenced by _(), _zgbmatrix(), destroy(), nullify(), operator()(), zgbmatrix::shallow_copy(), zgbmatrix::zgbmatrix(), and ~_zgbmatrix().


The documentation for this class was generated from the following files: