CPPLapack
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Friends
Pages
include
zhsmatrix-
zhsmatrix-zgematrix.hpp
Go to the documentation of this file.
1
//=============================================================================
2
/*! zhsmatrix+zgematrix operator */
3
/*
4
inline _zgematrix operator+(const zhsmatrix& matA, const zgematrix& matB)
5
{CPPL_VERBOSE_REPORT;
6
#ifdef CPPL_DEBUG
7
if(matA.m!=matB.m || matA.n!=matB.n){
8
ERROR_REPORT;
9
std::cerr << "These two matrises can not make a summation." << std::endl
10
<< "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
11
exit(1);
12
}
13
#endif//CPPL_DEBUG
14
15
zgematrix newmat(matB);
16
for(CPPL_INT c=0; c<matA.vol; c++){
17
newmat(matA.indx[c],matA.jndx[c]) += matA.array[c];
18
}
19
20
return _(newmat);
21
}
22
*/
23
24
//=============================================================================
25
/*! zhsmatrix-zgematrix operator */
26
/*
27
inline _zgematrix operator-(const zhsmatrix& matA, const zgematrix& matB)
28
{CPPL_VERBOSE_REPORT;
29
#ifdef CPPL_DEBUG
30
if(matA.m!=matB.m || matA.n!=matB.n){
31
ERROR_REPORT;
32
std::cerr << "These two matrises can not make a subtraction." << std::endl
33
<< "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
34
exit(1);
35
}
36
#endif//CPPL_DEBUG
37
38
zgematrix newmat(-matB);
39
for(CPPL_INT c=0; c<matA.vol; c++){
40
newmat(matA.indx[c],matA.jndx[c]) += matA.array[c];
41
}
42
43
return _(newmat);
44
}
45
*/
46
47
//=============================================================================
48
/*! zhsmatrix*zgematrix operator */
49
/*
50
inline _zgematrix operator*(const zhsmatrix& matA, const zgematrix& matB)
51
{CPPL_VERBOSE_REPORT;
52
#ifdef CPPL_DEBUG
53
if(matA.n!=matB.m){
54
ERROR_REPORT;
55
std::cerr << "These two matrises can not make a product." << std::endl
56
<< "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
57
exit(1);
58
}
59
#endif//CPPL_DEBUG
60
61
zgematrix newmat(matA.m, matB.n);
62
newmat.zero();
63
64
for(CPPL_INT c=0; c<matA.vol; c++){
65
for(CPPL_INT j=0; j<matB.n; j++){
66
newmat(matA.indx[c],j) += matA.array[c]*matB(matA.jndx[c],j);
67
}
68
}
69
70
return _(newmat);
71
}
72
*/
Generated by
1.8.6