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

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

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

dgematrix-dsymatrix operator

Definition at line 99 of file dgematrix-dsymatrix.hpp.

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

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

dgematrix*dsymatrix operator

Definition at line 122 of file dgematrix-dsymatrix.hpp.

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

123 {CPPL_VERBOSE_REPORT;
124 #ifdef CPPL_DEBUG
125  if(matA.n!=matB.n){
126  ERROR_REPORT;
127  std::cerr << "These two matrises can not make a product." << std::endl
128  << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
129  exit(1);
130  }
131 #endif//CPPL_DEBUG
132 
133  dgematrix newmat( matA.m, matB.n );
134  char side ='R';
135  char uplo ='l';
136  double alpha =1.;
137  double beta =0.;
138 
139  dsymm_( &side, &uplo, &newmat.m, &newmat.n, &alpha, matB.array, &matB.n, matA.array, &matA.m, &beta, newmat.array, &newmat.m );
140 
141  return _(newmat);
142 }
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
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
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
double * array
1D array to store matrix data
Definition: dsymatrix.hpp:11
_dcovector _(dcovector &vec)