My Project
dssmatrix-unary.hpp
1 //=============================================================================
3 inline const dssmatrix& operator+(const dssmatrix& mat)
4 {
5 #ifdef CPPL_VERBOSE
6  std::cerr << "# [MARK] operator+(const dssmatrix&)"
7  << std::endl;
8 #endif//CPPL_VERBOSE
9 
10  return mat;
11 }
12 
13 //=============================================================================
15 inline _dssmatrix operator-(const dssmatrix& mat)
16 {
17 #ifdef CPPL_VERBOSE
18  std::cerr << "# [MARK] operator-(const dssmatrix&)"
19  << std::endl;
20 #endif//CPPL_VERBOSE
21 
22  dssmatrix newmat(mat.M,mat.N,mat.CAP);
23 
24  newmat.VOL=mat.VOL;
25  for(long i=0; i<mat.VOL; i++){
26  newmat.Array[i] =-mat.Array[i];
27  newmat.Indx[i] =mat.Indx[i];
28  newmat.Jndx[i] =mat.Jndx[i];
29  }
30 
31  return _(newmat);
32 }
(DO NOT USE) Smart-temporary Real Double-precision Sparse Matrix Class
Definition: _dssmatrix.hpp:3
friend _drovector operator-(const _drovector &)
Definition: _drovector-unary.hpp:15
Real Double-precision Sparse Matrix Class.
Definition: dssmatrix.hpp:3
friend const _drovector & operator+(const _drovector &)
Definition: _drovector-unary.hpp:3