00001 //============================================================================= 00002 /*! _dgsmatrix+_dsymatrix operator */ 00003 /* 00004 inline _dgematrix operator+(const _dgsmatrix& matA, const _dsymatrix& matB) 00005 {VERBOSE_REPORT; 00006 #ifdef CPPL_DEBUG 00007 if(matA.m!=matB.n || matA.n!=matB.n){ 00008 ERROR_REPORT; 00009 std::cerr << "These two matrises can not make a summation." << std::endl 00010 << "Your input was (" << matA.m << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl; 00011 exit(1); 00012 } 00013 #endif//CPPL_DEBUG 00014 00015 dgematrix newmat(matB); 00016 for(long c=0; c<matA.vol; c++){ 00017 newmat(matA.indx[c],matA.jndx[c]) += matA.array[c]; 00018 } 00019 00020 matA.destroy(); 00021 matB.destroy(); 00022 return _(newmat); 00023 } 00024 */ 00025 //============================================================================= 00026 /*! _dgsmatrix-_dsymatrix operator */ 00027 /* 00028 inline _dgematrix operator-(const _dgsmatrix& matA, const _dsymatrix& matB) 00029 {VERBOSE_REPORT; 00030 #ifdef CPPL_DEBUG 00031 if(matA.m!=matB.n || matA.n!=matB.n){ 00032 ERROR_REPORT; 00033 std::cerr << "These two matrises can not make a subtraction." << std::endl 00034 << "Your input was (" << matA.m << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl; 00035 exit(1); 00036 } 00037 #endif//CPPL_DEBUG 00038 00039 //// shallow copy to dgematrix //// 00040 dgematrix newmat(-matB); 00041 00042 //// add //// 00043 for(long c=0; c<matA.vol; c++){ 00044 newmat(matA.indx[c],matA.jndx[c]) += matA.array[c]; 00045 } 00046 00047 matA.destroy(); 00048 matB.destroy(); 00049 return _(newmat); 00050 } 00051 */ 00052 //============================================================================= 00053 /*! _dgsmatrix*_dsymatrix operator */ 00054 /* 00055 inline _dgematrix operator*(const _dgsmatrix& matA, const _dsymatrix& matB) 00056 {VERBOSE_REPORT; 00057 #ifdef CPPL_DEBUG 00058 if(matA.n!=matB.n){ 00059 ERROR_REPORT; 00060 std::cerr << "These two matrises can not make a product." << std::endl 00061 << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl; 00062 exit(1); 00063 } 00064 #endif//CPPL_DEBUG 00065 00066 dgematrix newmat(matA.m, matB.n); 00067 newmat.zero(); 00068 00069 for(long c=0; c<matA.vol; c++){ 00070 for(long i=0; i<matB.n; i++){ 00071 newmat(matA.indx[c],i) += matA.array[c]*matB(matA.jndx[c],i); 00072 } 00073 } 00074 00075 matA.destroy(); 00076 matB.destroy(); 00077 return _(newmat); 00078 } 00079 */