CPPLapack
 All Classes Files Functions Variables Friends Pages
dgematrix-double.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! dgematrix*=double operator */
3 inline dgematrix& dgematrix::operator*=(const double& d)
4 {CPPL_VERBOSE_REPORT;
5  CPPL_INT mn =m*n;
6  CPPL_INT inc =1;
7  dscal_(&mn, &d, array, &inc);
8  return *this;
9 }
10 
11 //=============================================================================
12 /*! dgematrix/=double operator */
13 inline dgematrix& dgematrix::operator/=(const double& d)
14 {CPPL_VERBOSE_REPORT;
15  CPPL_INT mn =m*n;
16  double dinv =1./d;
17  CPPL_INT inc =1;
18  dscal_(&mn, &dinv, array, &inc);
19  return *this;
20 }
21 
22 ///////////////////////////////////////////////////////////////////////////////
23 ///////////////////////////////////////////////////////////////////////////////
24 ///////////////////////////////////////////////////////////////////////////////
25 
26 //=============================================================================
27 /*! dgematrix*double operator */
28 inline _dgematrix operator*(const dgematrix& mat, const double& d)
29 {CPPL_VERBOSE_REPORT;
30  dgematrix newmat(mat.m, mat.n);
31 
32  const CPPL_INT mn =mat.m*mat.n;
33  for(CPPL_INT i=0; i<mn; i++){
34  newmat.array[i] =mat.array[i]*d;
35  }
36 
37  return _(newmat);
38 }
39 
40 //=============================================================================
41 /*! dgematrix/double operator */
42 inline _dgematrix operator/(const dgematrix& mat, const double& d)
43 {CPPL_VERBOSE_REPORT;
44  dgematrix newmat(mat.m, mat.n);
45 
46  const CPPL_INT mn =mat.m*mat.n;
47  for(CPPL_INT i=0; i<mn; i++){
48  newmat.array[i] =mat.array[i]/d;
49  }
50 
51  return _(newmat);
52 }
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
double * array
1D array to store matrix data
Definition: dgematrix.hpp:11
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: dgematrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
dgematrix & operator*=(const dgematrix &)
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition: _dgematrix.hpp:3
_dgematrix operator*(const dgematrix &mat, const double &d)
_dgematrix operator/(const dgematrix &mat, const double &d)
_dcovector _(dcovector &vec)
dgematrix & operator/=(const double &)