CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
drovector-dgematrix.hpp File Reference

Go to the source code of this file.

Functions

_drovector operator* (const drovector &vec, const dgematrix &mat)
 

Function Documentation

_drovector operator* ( const drovector vec,
const dgematrix mat 
)
inline

drovector*dgematrix operator

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

References _(), drovector::array, dgematrix::array, drovector::l, dgematrix::m, and dgematrix::n.

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  return _(newvec);
23 }
double * array
1D array to store vector data
Definition: drovector.hpp:11
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
CPPL_INT l
vector size
Definition: drovector.hpp:9
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
_dcovector _(dcovector &vec)