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