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