CPPLapack
 All Classes Files Functions Variables Friends Pages
dgrmatrix-double.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! dgrmatrix*=double operator */
3 inline dgrmatrix& dgrmatrix::operator*=(const double& d)
4 {CPPL_VERBOSE_REPORT;
5  const std::vector<double>::iterator a_end =a.end();
6  for(std::vector<double>::iterator it=a.begin(); it!=a_end; it++){
7  (*it) *=d;
8  }
9 
10  return *this;
11 }
12 
13 //=============================================================================
14 /*! dgrmatrix/=double operator */
15 inline dgrmatrix& dgrmatrix::operator/=(const double& d)
16 {CPPL_VERBOSE_REPORT;
17  const std::vector<double>::iterator a_end =a.end();
18  for(std::vector<double>::iterator it=a.begin(); it!=a_end; it++){
19  (*it) /=d;
20  }
21 
22  return *this;
23 }
24 
25 ///////////////////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////////////////
28 
29 //=============================================================================
30 /*! dgrmatrix*double operator */
31 inline dgrmatrix operator*(const dgrmatrix& mat, const double& d)
32 {CPPL_VERBOSE_REPORT;
33  dgrmatrix newmat =mat;
34 
35  const std::vector<double>::iterator newmat_a_end =newmat.a.end();
36  for(std::vector<double>::iterator it=newmat.a.begin(); it!=newmat_a_end; it++){
37  (*it) *=d;
38  }
39 
40  return newmat;
41 }
42 
43 //=============================================================================
44 /*! dgrmatrix/double operator */
45 inline dgrmatrix operator/(const dgrmatrix& mat, const double& d)
46 {CPPL_VERBOSE_REPORT;
47  dgrmatrix newmat =mat;
48 
49  const std::vector<double>::iterator newmat_a_end =newmat.a.end();
50  for(std::vector<double>::iterator it=newmat.a.begin(); it!=newmat_a_end; it++){
51  (*it) /=d;
52  }
53 
54  return newmat;
55 }
std::vector< double > a
matrix component values
Definition: dgrmatrix.hpp:11
dgrmatrix operator/(const dgrmatrix &mat, const double &d)
dgrmatrix & operator*=(const double &)
dgrmatrix operator*(const dgrmatrix &mat, const double &d)
dgrmatrix & operator/=(const double &)
Real Double-precision General Compressed Sparse Row (CSR) Matrix Class.
Definition: dgrmatrix.hpp:3