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