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