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