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

Go to the source code of this file.

Functions

_dgematrix operator+ (const dgematrix &matA, const _dsymatrix &matB)
 
_dgematrix operator- (const dgematrix &matA, const _dsymatrix &matB)
 
_dgematrix operator* (const dgematrix &matA, const _dsymatrix &matB)
 

Function Documentation

_dgematrix operator+ ( const dgematrix matA,
const _dsymatrix matB 
)
inline

dgematrix+_dsymatrix operator

Definition at line 79 of file dgematrix-_dsymatrix.hpp.

References _(), _dsymatrix::destroy(), i(), dgematrix::m, dgematrix::n, and _dsymatrix::n.

80 {CPPL_VERBOSE_REPORT;
81 #ifdef CPPL_DEBUG
82  if(matA.n!=matB.n || matA.m!=matB.n){
83  ERROR_REPORT;
84  std::cerr << "These two matrises can not make a summation." << std::endl
85  << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
86  exit(1);
87  }
88 #endif//CPPL_DEBUG
89 
90  dgematrix newmat(matA);
91  for(CPPL_INT i=0; i<matA.m; i++){
92  for(CPPL_INT j=0; j<matA.n; j++){
93  newmat(i,j) += matB(i,j);
94  }
95  }
96 
97  matB.destroy();
98  return _(newmat);
99 }
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
void destroy() const
_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
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator- ( const dgematrix matA,
const _dsymatrix matB 
)
inline

dgematrix-_dsymatrix operator

Definition at line 103 of file dgematrix-_dsymatrix.hpp.

References _(), _dsymatrix::destroy(), i(), dgematrix::m, dgematrix::n, and _dsymatrix::n.

104 {CPPL_VERBOSE_REPORT;
105 #ifdef CPPL_DEBUG
106  if(matA.n!=matB.n || matA.m!=matB.n){
107  ERROR_REPORT;
108  std::cerr << "These two matrises can not make a subtraction." << std::endl
109  << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
110  exit(1);
111  }
112 #endif//CPPL_DEBUG
113 
114  dgematrix newmat(matA);
115  for(CPPL_INT i=0; i<matA.m; i++){
116  for(CPPL_INT j=0; j<matA.n; j++){
117  newmat(i,j) -= matB(i,j);
118  }
119  }
120 
121  matB.destroy();
122  return _(newmat);
123 }
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
void destroy() const
_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
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator* ( const dgematrix matA,
const _dsymatrix matB 
)
inline

dgematrix*_dsymatrix operator

Definition at line 127 of file dgematrix-_dsymatrix.hpp.

References _(), dgematrix::array, _dsymatrix::array, _dsymatrix::destroy(), dgematrix::m, dgematrix::n, and _dsymatrix::n.

128 {CPPL_VERBOSE_REPORT;
129 #ifdef CPPL_DEBUG
130  if(matA.n!=matB.n){
131  ERROR_REPORT;
132  std::cerr << "These two matrises can not make a product." << std::endl
133  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
134  exit(1);
135  }
136 #endif//CPPL_DEBUG
137 
138  dgematrix newmat( matA.m, matB.n );
139  char side ='R';
140  char uplo ='l';
141  double alpha =1.;
142  double beta =0.;
143 
144  dsymm_( &side, &uplo, &newmat.m, &newmat.n, &alpha, matB.array, &matB.n, matA.array, &matA.m, &beta, newmat.array, &newmat.m );
145 
146  matB.destroy();
147  return _(newmat);
148 }
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
void destroy() const
double * array
1D array to store matrix data
Definition: dgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: dgematrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)