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

(DO NOT USE) Smart-temporary Real Double-precision Row Vector Class More...

#include <_drovector.hpp>

Public Member Functions

 _drovector ()
 
 _drovector (const _drovector &)
 
 ~_drovector ()
 
_zrovector to_zrovector () const
 
double & operator() (const CPPL_INT &) const
 
void write (const char *) const
 
void nullify () const
 
void destroy () const
 

Public Attributes

CPPL_INT l
 vector size More...
 
CPPL_INT cap
 vector capacity More...
 
double * array
 1D array to store vector data More...
 

Friends

std::ostream & operator<< (std::ostream &, const _drovector &)
 
_dcovector t (const drovector &)
 
double nrm2 (const drovector &)
 
CPPL_INT idamax (const drovector &)
 
double damax (const drovector &)
 
const _drovectoroperator+ (const _drovector &)
 
_drovector operator- (const _drovector &)
 
_drovector operator+ (const _drovector &, const drovector &)
 
_drovector operator+ (const _drovector &, const _drovector &)
 
_drovector operator- (const _drovector &, const drovector &)
 
_drovector operator- (const _drovector &, const _drovector &)
 
double operator* (const _drovector &, const dcovector &)
 
double operator* (const _drovector &, const _dcovector &)
 
_drovector operator* (const _drovector &, const dgematrix &)
 
_drovector operator* (const _drovector &, const _dgematrix &)
 
_drovector operator* (const _drovector &, const dsymatrix &)
 
_drovector operator* (const _drovector &, const _dsymatrix &)
 
_drovector operator* (const _drovector &, const dgbmatrix &)
 
_drovector operator* (const _drovector &, const _dgbmatrix &)
 
_drovector operator* (const _drovector &, const dgsmatrix &)
 
_drovector operator* (const _drovector &, const _dgsmatrix &)
 
_drovector operator* (const _drovector &, const dssmatrix &)
 
_drovector operator* (const _drovector &, const _dssmatrix &)
 
_drovector operator* (const _drovector &, const double &)
 
_drovector operator/ (const _drovector &, const double &)
 
double operator% (const _drovector &, const drovector &)
 
double operator% (const _drovector &, const _drovector &)
 
_drovector operator* (const double &, const _drovector &)
 

Detailed Description

(DO NOT USE) Smart-temporary Real Double-precision Row Vector Class

Definition at line 3 of file _drovector.hpp.

Constructor & Destructor Documentation

_drovector::_drovector ( )
inline

drovector constructor

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

References array, cap, and l.

4 {CPPL_VERBOSE_REPORT;
5  l =0;
6  cap =0;
7  array =NULL;
8 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
CPPL_INT cap
vector capacity
Definition: _drovector.hpp:10
_drovector::_drovector ( const _drovector vec)
inline

_drovector copy constructor

Definition at line 12 of file _drovector-constructor.hpp.

References array, cap, l, and nullify().

13 {CPPL_VERBOSE_REPORT;
14  l =vec.l;
15  cap =vec.cap;
16  array =vec.array;
17 
18  vec.nullify();
19 }
void nullify() const
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
CPPL_INT cap
vector capacity
Definition: _drovector.hpp:10
_drovector::~_drovector ( )
inline

_drovector destructor

Definition at line 27 of file _drovector-constructor.hpp.

References array.

28 {CPPL_VERBOSE_REPORT;
29  delete[] array;
30 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11

Member Function Documentation

_zrovector _drovector::to_zrovector ( ) const
inline

cast to _zrovector

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

References _(), zrovector::array, array, destroy(), i(), and l.

4 {CPPL_VERBOSE_REPORT;
5  zrovector newvec(l);
6 
7  for(CPPL_INT i=0; i<l; i++){
8  newvec.array[i] =comple(array[i], 0.);
9  }
10 
11  destroy();
12  return _(newvec);
13 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
Complex Double-precision Row Vector Class.
Definition: zrovector.hpp:3
_dcovector _(dcovector &vec)
double & _drovector::operator() ( const CPPL_INT &  i) const
inline

operator() for const object

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

References array, i(), and l.

Referenced by write().

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if( i<0 || l<=i ){
7  ERROR_REPORT;
8  std::cerr << "The required component is out of the vector size." << std::endl
9  << "Your input is (" << i << "), whereas the vector size is " << l << "." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  return array[i];
15 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void _drovector::write ( const char *  filename) const
inline

Definition at line 36 of file _drovector-io.hpp.

References destroy(), i(), l, and operator()().

37 {CPPL_VERBOSE_REPORT;
38  std::ofstream ofs(filename, std::ios::trunc);
39  ofs.setf(std::cout.flags());
40  ofs.precision(std::cout.precision());
41  ofs.width(std::cout.width());
42  ofs.fill(std::cout.fill());
43 
44  ofs << "#drovector" << " " << l << std::endl;
45  for(CPPL_INT i=0; i<l; i++){
46  ofs << operator()(i) << " ";
47  }
48  ofs << std::endl;
49 
50  ofs.close();
51  destroy();
52 }
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
double & operator()(const CPPL_INT &) const
void _drovector::nullify ( ) const
inline

nullify all the vector data

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

References array, cap, and l.

Referenced by _drovector(), drovector::drovector(), drovector::shallow_copy(), and t().

4 {CPPL_VERBOSE_REPORT;
5  l=0;
6  cap=0;
7  array=NULL;
8 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
CPPL_INT cap
vector capacity
Definition: _drovector.hpp:10
void _drovector::destroy ( ) const
inline

destroy all the vector data

Definition at line 12 of file _drovector-misc.hpp.

References array.

Referenced by damax(), idamax(), nrm2(), operator%(), operator*(), operator+(), drovector::operator+=(), operator-(), drovector::operator-=(), operator<<(), to_zrovector(), and write().

13 {CPPL_VERBOSE_REPORT;
14  delete [] array;
15  array=NULL;
16 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const _drovector vec 
)
friend

Definition at line 22 of file _drovector-io.hpp.

23 {CPPL_VERBOSE_REPORT;
24  for(CPPL_INT i=0; i<vec.l; i++){ s << " " << vec.array[i]; }
25  s << std::endl;
26 
27  vec.destroy();
28  return s;
29 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
_dcovector t ( const drovector rovec)
friend

return a transposed column vector

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

4 {CPPL_VERBOSE_REPORT;
5  dcovector covec(rovec.l);
6 
7  CPPL_INT inc =1;
8  dcopy_(&rovec.l, rovec.array, &inc, covec.array, &inc);
9 
10  return _(covec);
11 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
CPPL_INT l
vector size
Definition: drovector.hpp:9
Real Double-precision Column Vector Class.
Definition: dcovector.hpp:3
_dcovector _(dcovector &vec)
double nrm2 ( const drovector vec)
friend

return its Euclidean norm

Definition at line 15 of file drovector-calc.hpp.

16 {CPPL_VERBOSE_REPORT;
17  CPPL_INT inc =1;
18  return dnrm2_(&vec.l, vec.array, &inc);
19 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
CPPL_INT l
vector size
Definition: drovector.hpp:9
CPPL_INT idamax ( const drovector vec)
friend

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

Definition at line 24 of file drovector-calc.hpp.

25 {CPPL_VERBOSE_REPORT;
26  CPPL_INT inc =1;
27  return idamax_(&vec.l, vec.array, &inc) -1;
28 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
CPPL_INT l
vector size
Definition: drovector.hpp:9
double damax ( const drovector vec)
friend

return its largest absolute value

Definition at line 32 of file drovector-calc.hpp.

33 {CPPL_VERBOSE_REPORT;
34  CPPL_INT inc =1;
35  return vec.array[idamax_(&vec.l, vec.array, &inc) -1];
36 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
CPPL_INT l
vector size
Definition: drovector.hpp:9
const _drovector& operator+ ( const _drovector vec)
friend

+_drovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  return vec;
6 }
_drovector operator- ( const _drovector vec)
friend

-_drovector operator

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

11 {CPPL_VERBOSE_REPORT;
12  for(CPPL_INT i=0; i<vec.l; i++){
13  vec.array[i] =-vec.array[i];
14  }
15  return vec;
16 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
_drovector operator+ ( const _drovector vecA,
const drovector vecB 
)
friend

_drovector+drovector operator

Definition at line 3 of file _drovector-drovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vecA.l!=vecB.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a sumation." << std::endl
9  << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl;
10  exit(1);
11  }
12 
13 #endif//CPPL_DEBUG
14 
15  for(CPPL_INT i=0; i<vecA.l; i++){
16  vecA.array[i]+=vecB.array[i];
17  }
18 
19  return vecA;
20 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT l
vector size
Definition: drovector.hpp:9
_drovector operator+ ( const _drovector vecA,
const _drovector vecB 
)
friend

_drovector+_drovector operator

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

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vecA.l!=vecB.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a sumation." << std::endl
9  << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl;
10  exit(1);
11  }
12 
13 #endif//CPPL_DEBUG
14 
15  for(CPPL_INT i=0; i<vecA.l; i++){
16  vecA.array[i]+=vecB.array[i];
17  }
18 
19  vecB.destroy();
20  return vecA;
21 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
_drovector operator- ( const _drovector vecA,
const drovector vecB 
)
friend

drovector-drovector operator

Definition at line 24 of file _drovector-drovector.hpp.

25 {CPPL_VERBOSE_REPORT;
26 #ifdef CPPL_DEBUG
27  if(vecA.l!=vecB.l){
28  ERROR_REPORT;
29  std::cerr << "These two vectors can not make a subtraction." << std::endl
30  << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
31  exit(1);
32  }
33 #endif//CPPL_DEBUG
34 
35  for(CPPL_INT i=0; i<vecA.l; i++){
36  vecA.array[i]-=vecB.array[i];
37  }
38 
39  return vecA;
40 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT l
vector size
Definition: drovector.hpp:9
_drovector operator- ( const _drovector vecA,
const _drovector vecB 
)
friend

_drovector-_drovector operator

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

26 {CPPL_VERBOSE_REPORT;
27 #ifdef CPPL_DEBUG
28  if(vecA.l!=vecB.l){
29  ERROR_REPORT;
30  std::cerr << "These two vectors can not make a subtraction." << std::endl
31  << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
32  exit(1);
33  }
34 #endif//CPPL_DEBUG
35 
36  for(CPPL_INT i=0; i<vecA.l; i++){
37  vecA.array[i]-=vecB.array[i];
38  }
39 
40  vecB.destroy();
41  return vecA;
42 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
double operator* ( const _drovector rovec,
const dcovector covec 
)
friend

_drovector*dcovector operator

Definition at line 3 of file _drovector-dcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(rovec.l!=covec.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a product." << std::endl
9  << "Your input was (" << rovec.l << ") * (" << covec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  CPPL_INT inc =1;
15  double val =ddot_( &rovec.l, rovec.array, &inc, covec.array, &inc );
16 
17  rovec.destroy();
18  return val;
19 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
CPPL_INT l
vector size
Definition: dcovector.hpp:9
void destroy() const
double * array
1D array to store vector data
Definition: dcovector.hpp:11
double operator* ( const _drovector rovec,
const _dcovector covec 
)
friend

_drovector*_dcovector operator

Definition at line 3 of file _drovector-_dcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(rovec.l!=covec.l){
7  ERROR_REPORT;
8  std::cerr << "These two vectors can not make a product." << std::endl
9  << "Your input was (" << rovec.l << ") * (" << covec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  CPPL_INT inc =1;
15  double val =ddot_( &rovec.l, rovec.array, &inc, covec.array, &inc );
16 
17  rovec.destroy();
18  covec.destroy();
19  return val;
20 }
CPPL_INT l
vector size
Definition: _dcovector.hpp:9
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
void destroy() const
double * array
1D array to store vector data
Definition: _dcovector.hpp:11
_drovector operator* ( const _drovector vec,
const dgematrix mat 
)
friend

_drovector*dgematrix operator

Definition at line 3 of file _drovector-dgematrix.hpp.

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

_drovector*_dgematrix operator

Definition at line 3 of file _drovector-_dgematrix.hpp.

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

_drovector*dsymatrix operator

Definition at line 3 of file _drovector-dsymatrix.hpp.

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

_drovector*_dsymatrix operator

Definition at line 3 of file _drovector-_dsymatrix.hpp.

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

_drovector*dgbmatrix operator

Definition at line 3 of file _drovector-dgbmatrix.hpp.

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

_drovector*_dgbmatrix operator

Definition at line 3 of file _drovector-_dgbmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  drovector newvec(mat.n);
15  char trans ='T';
16  double alpha =1.;
17  CPPL_INT lda =mat.kl+mat.ku+1;
18  CPPL_INT inc =1;
19  double beta =0.;
20 
21  dgbmv_( &trans, &mat.m, &mat.n, &mat.kl, &mat.ku, &alpha, mat.array, &lda, vec.array, &inc, &beta, newvec.array, &inc );
22 
23  vec.destroy();
24  mat.destroy();
25  return _(newvec);
26 }
CPPL_INT ku
upper band width
Definition: _dgbmatrix.hpp:12
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
void destroy() const
CPPL_INT kl
lower band width
Definition: _dgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dgbmatrix.hpp:10
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
double * array
1D array to store matrix data
Definition: _dgbmatrix.hpp:13
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: _dgbmatrix.hpp:9
_drovector operator* ( const _drovector vec,
const dgsmatrix mat 
)
friend

_drovector*dgsmatrix operator

Definition at line 3 of file _drovector-dgsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  drovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) += vec(it->i)*it->v;
20  }
21 
22  vec.destroy();
23  return _(newvec);
24 }
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
void destroy() const
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9
_drovector operator* ( const _drovector vec,
const _dgsmatrix mat 
)
friend

_drovector*_dgsmatrix operator

Definition at line 3 of file _drovector-_dgsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.m){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  drovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) += vec(it->i)*it->v;
20  }
21 
22  vec.destroy();
23  mat.destroy();
24  return _(newvec);
25 }
CPPL_INT n
matrix column size
Definition: _dgsmatrix.hpp:10
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
void destroy() const
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11
_dcovector _(dcovector &vec)
_drovector operator* ( const _drovector vec,
const dssmatrix mat 
)
friend

_drovector*dssmatrix operator

Definition at line 3 of file _drovector-dssmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.n){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.n << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  drovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) +=vec(it->i)*it->v;
20  if(it->i!=it->j){
21  newvec(it->i) +=vec(it->j)*it->v;
22  }
23  }
24 
25  vec.destroy();
26  return _(newvec);
27 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
CPPL_INT n
matrix column size
Definition: dssmatrix.hpp:10
_dcovector _(dcovector &vec)
_drovector operator* ( const _drovector vec,
const _dssmatrix mat 
)
friend

_drovector*_dssmatrix operator

Definition at line 3 of file _drovector-_dssmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(vec.l!=mat.n){
7  ERROR_REPORT;
8  std::cerr << "These vector and matrix can not make a product." << std::endl
9  << "Your input was (" << vec.l << ") * (" << mat.n << "x" << mat.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  drovector newvec(mat.n);
15  newvec.zero();
16 
17  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
18  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  newvec(it->j) +=vec(it->i)*it->v;
20  if(it->i!=it->j){
21  newvec(it->i) +=vec(it->j)*it->v;
22  }
23  }
24 
25  vec.destroy();
26  mat.destroy();
27  return _(newvec);
28 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
void destroy() const
_dcovector _(dcovector &vec)
_drovector operator* ( const _drovector vec,
const double &  d 
)
friend

_drovector*double operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT inc =1;
6  dscal_(&vec.l, &d, vec.array, &inc);
7  return vec;
8 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
_drovector operator/ ( const _drovector vec,
const double &  d 
)
friend

_drovector/double operator

Definition at line 12 of file _drovector-double.hpp.

13 {CPPL_VERBOSE_REPORT;
14  double dinv =1./d;
15  CPPL_INT inc =1;
16  dscal_(&vec.l, &dinv, vec.array, &inc);
17  return vec;
18 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
double operator% ( const _drovector vecA,
const drovector vecB 
)
friend

drovector^T*drovector operator (inner product)

Definition at line 44 of file _drovector-drovector.hpp.

45 {CPPL_VERBOSE_REPORT;
46 #ifdef CPPL_DEBUG
47  if(vecA.l!=vecB.l){
48  ERROR_REPORT;
49  std::cerr << "These two vectors can not make a dot product." << std::endl
50  << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
51  exit(1);
52  }
53 #endif//CPPL_DEBUG
54 
55  CPPL_INT inc =1;
56  double val =ddot_( &vecA.l, vecA.array, &inc, vecB.array, &inc );
57 
58  vecA.destroy();
59  return val;
60 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
CPPL_INT l
vector size
Definition: drovector.hpp:9
double operator% ( const _drovector vecA,
const _drovector vecB 
)
friend

_drovector^T*_drovector operator (inner product)

Definition at line 46 of file _drovector-_drovector.hpp.

47 {CPPL_VERBOSE_REPORT;
48 #ifdef CPPL_DEBUG
49  if(vecA.l!=vecB.l){
50  ERROR_REPORT;
51  std::cerr << "These two vectors can not make a dot product." << std::endl
52  << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
53  exit(1);
54  }
55 #endif//CPPL_DEBUG
56 
57  CPPL_INT inc =1;
58  double val =ddot_( &vecA.l, vecA.array, &inc, vecB.array, &inc );
59 
60  vecA.destroy();
61  vecB.destroy();
62  return val;
63 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
void destroy() const
_drovector operator* ( const double &  d,
const _drovector vec 
)
friend

double*_drovector operator

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

4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT inc =1;
6  dscal_(&vec.l, &d, vec.array, &inc);
7  return vec;
8 }
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9

Member Data Documentation

CPPL_INT _drovector::l
mutable
CPPL_INT _drovector::cap
mutable

vector capacity

Definition at line 10 of file _drovector.hpp.

Referenced by _(), _drovector(), drovector::drovector(), nullify(), drovector::shallow_copy(), and t().

double* _drovector::array
mutable

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