CPPLapack
 All Classes Files Functions Variables Friends Pages
zhsmatrix-_zhematrix.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! zhsmatrix+_zhematrix operator */
3 /*
4 inline _zgematrix operator+(const zhsmatrix& matA, const _zhematrix& 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  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  matB.destroy();
21  return _(newmat);
22 }
23 */
24 
25 //=============================================================================
26 /*! zhsmatrix-_zhematrix operator */
27 /*
28 inline _zgematrix operator-(const zhsmatrix& matA, const _zhematrix& 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  zgematrix 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 /*! zhsmatrix*_zhematrix operator */
52 /*
53 inline _zgematrix operator*(const zhsmatrix& matA, const _zhematrix& 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  zgematrix 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 */