VERB_code_2.3
dgematrix-double.hpp
1 //=============================================================================
3 inline dgematrix& dgematrix::operator*=(const double& d)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] dgematrix::operator*=(const double&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10  dscal_(M*N, d, Array, 1);
11  return *this;
12 }
13 
14 //=============================================================================
16 inline dgematrix& dgematrix::operator/=(const double& d)
17 {
18 #ifdef CPPL_VERBOSE
19  std::cerr << "# [MARK] dgematrix::operator/=(const double&)"
20  << std::endl;
21 #endif//CPPL_VERBOSE
22 
23  dscal_(M*N, 1./d, Array, 1);
24  return *this;
25 }
26 
30 
31 //=============================================================================
33 inline _dgematrix operator*(const dgematrix& mat, const double& d)
34 {
35 #ifdef CPPL_VERBOSE
36  std::cerr << "# [MARK] operator*(const dgematrix&, const double&)"
37  << std::endl;
38 #endif//CPPL_VERBOSE
39 
40  dgematrix newmat(mat.M, mat.N);
41  for(long i=0; i<mat.M*mat.N; i++){ newmat.Array[i] =mat.Array[i]*d; }
42 
43  return _(newmat);
44 }
45 
46 //=============================================================================
48 inline _dgematrix operator/(const dgematrix& mat, const double& d)
49 {
50 #ifdef CPPL_VERBOSE
51  std::cerr << "# [MARK] operator/(const dgematrix&, const double&)"
52  << std::endl;
53 #endif//CPPL_VERBOSE
54 
55  double inv_d(1./d);
56 
57  dgematrix newmat(mat.M, mat.N);
58  for(long i=0; i<mat.M*mat.N; i++){ newmat.Array[i] =mat.Array[i]*inv_d; }
59 
60  return _(newmat);
61 }
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
dgematrix & operator*=(const dgematrix &)
Definition: dgematrix-dgematrix.hpp:68
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition: _dgematrix.hpp:3
friend _drovector operator/(const drovector &, const double &)
Definition: drovector-double.hpp:48
friend _drovector operator*(const drovector &, const dgematrix &)
Definition: drovector-dgematrix.hpp:3
double * Array
1D Array to store vector data
Definition: _drovector.hpp:8
dgematrix & operator/=(const double &)
Definition: dgematrix-double.hpp:16