20 if(
n!=mat.
n ||
m!=mat.
m){
22 std::cerr <<
"These two matrises can not make a summation." << std::endl
23 <<
"Your input was (" <<
m <<
"x" <<
n <<
") += (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
28 const CPPL_INT mn =
m*
n;
29 for(CPPL_INT
i=0;
i<mn;
i++){
40 if(
n!=mat.
n ||
m!=mat.
m){
42 std::cerr <<
"These two matrises can not make a sutraction." << std::endl
43 <<
"Your input was (" <<
m <<
"x" <<
n <<
") -= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
48 const CPPL_INT mn =
m*
n;
49 for(CPPL_INT
i=0;
i<mn;
i++){
62 std::cerr <<
"These two matrises can not make a product." << std::endl
63 <<
"Your input was (" <<
m <<
"x" <<
n <<
") *= (" << mat.
m <<
"x" << mat.
n <<
")." << std::endl;
74 dgemm_( &transa, &transb, &
m, &mat.
n, &
n, &alpha,
array, &
m, mat.
array, &mat.
m, &beta, newmat.
array, &
m );
89 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
91 std::cerr <<
"These two matrises can not make a summation." << std::endl
92 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") + (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
99 const CPPL_INT mn =newmat.
m*newmat.
n;
100 for(CPPL_INT
i=0;
i<mn;
i++){
110 {CPPL_VERBOSE_REPORT;
112 if(matA.
n!=matB.
n || matA.
m!=matB.
m){
114 std::cerr <<
"These two matrises can not make a subtraction." << std::endl
115 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") - (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
122 const CPPL_INT mn =newmat.
m*newmat.
n;
123 for(CPPL_INT
i=0;
i<mn;
i++){
133 {CPPL_VERBOSE_REPORT;
137 std::cerr <<
"These two matrises can not make a product." << std::endl
138 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") * (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
149 dgemm_( &transa, &transb, &matA.
m, &matB.
n, &matA.
n, &alpha, matA.
array, &matA.
m, matB.
array, &matB.
m, &beta, newmat.
array, &matA.
m );
157 {CPPL_VERBOSE_REPORT;
159 if(matA.
m!=matB.
m || matA.
n!=matB.
n){
161 std::cerr <<
"These two matrises can not make a product." << std::endl
162 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") % (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
170 for(CPPL_INT j=0; j<matA.
n; j++){
171 for(CPPL_INT
i=0;
i<matA.
m;
i++){
172 newvec(j) +=matA(
i,j)*matB(
i,j);
186 {CPPL_VERBOSE_REPORT;
188 if( matA.
m!=matB.
m || matA.
n!=matB.
n ){
190 std::cerr <<
"These two matrices can not make Hadamerd product." << std::endl
191 <<
"Your input was (" << matA.
m <<
"x" << matA.
n <<
") and (" << matB.
m <<
"x" << matB.
n <<
")." << std::endl;
197 for(CPPL_INT
i=0;
i<newmat.
m;
i++){
198 for(CPPL_INT j=0; j<newmat.
n; j++){
199 newmat(
i,j) =matA(
i,j)*matB(
i,j);
_dgematrix operator+(const dgematrix &matA, const dgematrix &matB)
CPPL_INT m
matrix row size
double * array
1D array to store matrix data
_dgematrix operator-(const dgematrix &matA, const dgematrix &matB)
_dgematrix i(const _dgbmatrix &mat)
friend void swap(dgematrix &, dgematrix &)
CPPL_INT n
matrix column size
Real Double-precision General Dence Matrix Class.
dgematrix & operator=(const dgematrix &)
Real Double-precision Row Vector Class.
dgematrix & operator*=(const dgematrix &)
_dgematrix operator*(const dgematrix &matA, const dgematrix &matB)
(DO NOT USE) Smart-temporary Real Double-precision Row Vector Class
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
void copy(const dgematrix &)
_drovector operator%(const dgematrix &matA, const dgematrix &matB)
_dgematrix hadamerd(const dgematrix &matA, const dgematrix &matB)
dgematrix & operator-=(const dgematrix &)
friend _dgematrix i(const dgematrix &)
dgematrix & operator+=(const dgematrix &)
_dcovector _(dcovector &vec)