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