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

Go to the source code of this file.

Functions

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

Function Documentation

_dsymatrix operator+ ( const dsymatrix matA,
const _dsymatrix matB 
)
inline

dsymatrix+_dsymatrix operator

Definition at line 65 of file dsymatrix-_dsymatrix.hpp.

References dsymatrix::darray, _dsymatrix::darray, i(), dsymatrix::n, and _dsymatrix::n.

66 {CPPL_VERBOSE_REPORT;
67 #ifdef CPPL_DEBUG
68  if(matA.n!=matB.n){
69  ERROR_REPORT;
70  std::cerr << "These two matrises can not make a summation." << std::endl
71  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
72  exit(1);
73  }
74 #endif//CPPL_DEBUG
75 
76  for(CPPL_INT j=0; j<matA.n; j++){
77  for(CPPL_INT i=j; i<matA.n; i++){
78  matB.darray[j][i] +=matA.darray[j][i];
79  }
80  }
81 
82  return matB;
83 }
_dgematrix i(const _dgbmatrix &mat)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12
_dsymatrix operator- ( const dsymatrix matA,
const _dsymatrix matB 
)
inline

dsymatrix-_dsymatrix operator

Definition at line 87 of file dsymatrix-_dsymatrix.hpp.

References dsymatrix::darray, _dsymatrix::darray, i(), dsymatrix::n, and _dsymatrix::n.

88 {CPPL_VERBOSE_REPORT;
89 #ifdef CPPL_DEBUG
90  if(matA.n!=matB.n){
91  ERROR_REPORT;
92  std::cerr << "These two matrises can not make a subtraction." << std::endl
93  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
94  exit(1);
95  }
96 #endif//CPPL_DEBUG
97 
98  for(CPPL_INT j=0; j<matA.n; j++){
99  for(CPPL_INT i=j; i<matA.n; i++){
100  matB.darray[j][i] =matA.darray[j][i] -matB.darray[j][i];
101  }
102  }
103 
104  return matB;
105 }
_dgematrix i(const _dgbmatrix &mat)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12
_dgematrix operator* ( const dsymatrix matA,
const _dsymatrix matB 
)
inline

dsymatrix*_dsymatrix operator

Definition at line 109 of file dsymatrix-_dsymatrix.hpp.

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

110 {CPPL_VERBOSE_REPORT;
111 #ifdef CPPL_DEBUG
112  if(matA.n!=matB.n){
113  ERROR_REPORT;
114  std::cerr << "These two matrises can not make a product." << std::endl
115  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
116  exit(1);
117  }
118 #endif//CPPL_DEBUG
119 
120  matB.complete();
121 
122  dgematrix newmat( matA.n, matA.n );
123  char side ='l';
124  char uplo ='l';
125  double alpha =1.;
126  double beta =0.;
127 
128  dsymm_( &side, &uplo, &matA.n, &matB.n, &alpha, matA.array, &matA.n, matB.array, &matB.m, &beta, newmat.array, &newmat.m );
129 
130  matB.destroy();
131  return _(newmat);
132 }
void destroy() const
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:10
void complete() const
double * array
1D array to store matrix data
Definition: dsymatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT const & m
matrix row size
Definition: _dsymatrix.hpp:10