CPPLapack
 All Classes Files Functions Variables Friends
zhsmatrix-_zgbmatrix.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! zhsmatrix+_zgbmatrix operator */
00003 /*
00004 inline _zgematrix operator+(const zhsmatrix& 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   matB.destroy();
00024   return _(newmat);
00025 }
00026 */
00027 //=============================================================================
00028 /*! zhsmatrix-_zgbmatrix operator */
00029 /*
00030 inline _zgematrix operator-(const zhsmatrix& 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   matB.destroy();
00050   return _(newmat);
00051 }
00052 */
00053 
00054 //=============================================================================
00055 /*! zhsmatrix*_zgbmatrix operator */
00056 /*
00057 inline _zgematrix operator*(const zhsmatrix& matA, const _zgbmatrix& matB)
00058 {VERBOSE_REPORT;
00059 #ifdef  CPPL_DEBUG
00060   if(matA.n!=matB.m){
00061     ERROR_REPORT;
00062     std::cerr << "These two matrises can not make a product." << std::endl
00063               << "Your input was (" << matA.m << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
00064     exit(1);
00065   }
00066 #endif//CPPL_DEBUG
00067   
00068   zgematrix newmat( matA.m, matB.n );
00069   newmat.zero();
00070   
00071   for(long c=0; c<matA.vol; c++){
00072     for(long j=max(0,matA.jndx[c]-matB.kl);
00073         j<min(matB.n,matA.jndx[c]+matB.ku+1); j++){
00074       newmat(matA.indx[c],j) += matA.array[c]*matB(matA.jndx[c],j);
00075     }
00076   }
00077   
00078   matB.destroy();
00079   return _(newmat);
00080 }
00081 */
 All Classes Files Functions Variables Friends