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 61 of file dsymatrix-dsymatrix.hpp.

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

62 {CPPL_VERBOSE_REPORT;
63 #ifdef CPPL_DEBUG
64  if(matA.n!=matB.n){
65  ERROR_REPORT;
66  std::cerr << "These two matrises can not make a summation." << std::endl
67  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
68  exit(1);
69  }
70 #endif//CPPL_DEBUG
71 
72  dsymatrix newmat(matA.n);
73 
74  for(CPPL_INT j=0; j<matA.n; j++){
75  for(CPPL_INT i=j; i<matA.n; i++){
76  newmat.darray[j][i] =matA.darray[j][i] +matB.darray[j][i];
77  }
78  }
79 
80  return _(newmat);
81 }
_dgematrix i(const _dgbmatrix &mat)
Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].
Definition: dsymatrix.hpp:3
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12
_dcovector _(dcovector &vec)
_dsymatrix operator- ( const dsymatrix matA,
const dsymatrix matB 
)
inline

dsymatrix-dsymatrix operator

Definition at line 85 of file dsymatrix-dsymatrix.hpp.

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

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

dsymatrix*dsymatrix operator

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

References _(), dgematrix::array, dsymatrix::array, dsymatrix::complete(), dsymatrix::m, dgematrix::m, 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  return _(newmat);
131 }
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT const & m
matrix row size
Definition: dsymatrix.hpp:9
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
_dcovector _(dcovector &vec)