My Project
_zrovector-_zgbmatrix.hpp
1 //=============================================================================
3 inline _zrovector operator*(const _zrovector& vec, const _zgbmatrix& mat)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] operator*(const _zrovector&, const _zgbmatrix&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10 #ifdef CPPL_DEBUG
11  if(vec.L!=mat.M){
12  std::cerr << "[ERROR] operator*(const zrovector&, const _zgbmatrix&)"
13  << std::endl
14  << "These vector and matrix can not make a product."
15  << std::endl
16  << "Your input was (" << vec.L << ") * ("
17  << mat.M << "x" << mat.N << ")." << std::endl;
18  exit(1);
19  }
20 #endif//CPPL_DEBUG
21 
22  zrovector newvec(mat.N);
23  zgbmv_( 'T', mat.M, mat.N, mat.KL, mat.KU, std::complex<double>(1.0,0.0),
24  mat.Array, mat.KL+mat.KU+1, vec.Array, 1, std::complex<double>(0.0,0.0), newvec.array, 1 );
25 
26  vec.destroy();
27  mat.destroy();
28  return _(newvec);
29 }
std::complex< double > * Array
1D Array to store matrix data
Definition: _zgbmatrix.hpp:11
void destroy() const
Definition: _zrovector-misc.hpp:3
long L
vector size
Definition: _zrovector.hpp:7
long N
matrix column size
Definition: _zgbmatrix.hpp:8
void destroy() const
Definition: _zgbmatrix-misc.hpp:3
long KU
upper band width
Definition: _zgbmatrix.hpp:10
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
(DO NOT USE) Smart-temporary Complex Double-precision Row Vector Class
Definition: _zrovector.hpp:3
friend _zrovector operator*(const zrovector &, const zgematrix &)
Definition: zrovector-zgematrix.hpp:3
long M
matrix row size
Definition: _zgbmatrix.hpp:7
(DO NOT USE) Smart-temporary Complex Double-precision General Band Matrix Class
Definition: _zgbmatrix.hpp:3
long KL
lower band width
Definition: _zgbmatrix.hpp:9
std::complex< double > * Array
1D Array to store vector data
Definition: _zrovector.hpp:8