Main Page | Class List | File List | Class Members | File Members | Related Pages

_dgematrix-dgematrix.hpp File Reference

Go to the source code of this file.

Functions

_dgematrix operator+ (const _dgematrix &matA, const dgematrix &matB)
_dgematrix operator- (const _dgematrix &matA, const dgematrix &matB)
_dgematrix operator * (const _dgematrix &matA, const dgematrix &matB)


Function Documentation

_dgematrix operator+ const _dgematrix matA,
const dgematrix matB
[inline]
 

_dgematrix+dgematrix operator

Definition at line 3 of file _dgematrix-dgematrix.hpp.

References dgematrix::Array, _dgematrix::Array, dgematrix::M, _dgematrix::M, _dgematrix::Ml, dgematrix::N, _dgematrix::N, and _dgematrix::Nl.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(matA.N!=matB.N || matA.M!=matB.M){
00007     std::cerr << "[ERROR] operator+(const _dgematrix&, const dgematrix&)"
00008               << std::endl
00009               << "These two matrises can not make a summation." << std::endl
00010               << "Your input was (" << matA.M << "x" << matA.N << ") + ("
00011               << matB.M << "x" << matB.N << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015 
00016   for(long i=0; i<matA.Ml*matA.Nl; i++){ matA.Array[i] +=matB.Array[i]; }
00017   
00018   return matA;
00019 }

_dgematrix operator- const _dgematrix matA,
const dgematrix matB
[inline]
 

_dgematrix-dgematrix operator

Definition at line 23 of file _dgematrix-dgematrix.hpp.

References dgematrix::Array, _dgematrix::Array, dgematrix::M, _dgematrix::M, _dgematrix::Ml, dgematrix::N, _dgematrix::N, and _dgematrix::Nl.

00024 {
00025 #ifdef  CPPSL_DEBUG
00026   if(matA.N!=matB.N || matA.M!=matB.M){
00027     std::cerr << "[ERROR] operator-(const _dgematrix&, const dgematrix&)"
00028               << std::endl
00029               << "These two matrises can not make a subtraction." << std::endl
00030               << "Your input was (" << matA.M << "x" << matA.N << ") - ("
00031               << matB.M << "x" << matB.N << ")." << std::endl;
00032     exit(1);
00033   }
00034 #endif//CPPSL_DEBUG
00035   
00036   for(long i=0; i<matA.Ml*matA.Nl; i++){ matA.Array[i] -=matB.Array[i]; }
00037   
00038   return matA;
00039 }

_dgematrix operator * const _dgematrix matA,
const dgematrix matB
[inline]
 

_dgematrix*dgematrix operator

Definition at line 43 of file _dgematrix-dgematrix.hpp.

References dgematrix::Array, _dgematrix::Array, dgematrix::Desc, _dgematrix::Desc, _dgematrix::destroy(), _dgematrix::M, dgematrix::M, dgematrix::N, and _dgematrix::N.

00044 {
00045 #ifdef  CPPSL_DEBUG
00046   if(matA.N!=matB.M){
00047     std::cerr << "[ERROR] operator*(const _dgematrix&, const dgematrix&)"
00048               << std::endl
00049               << "These two matrises can not make a product." << std::endl
00050               << "Your input was (" << matA.M << "x" << matA.N << ") * ("
00051               << matB.M << "x" << matB.N << ")." << std::endl;
00052     exit(1);
00053   }
00054 #endif//CPPSL_DEBUG
00055   
00056   _dgematrix newmat( matA.M, matB.N );
00057   pdgemm_( 'N', 'N', matA.M, matB.N, matA.N, 1.0,
00058            matA.Array, 1, 1, matA.Desc,
00059            matB.Array, 1, 1, matB.Desc, 0.0,
00060            newmat.Array, 1, 1, newmat.Desc );
00061   
00062   matA.destroy();
00063   return newmat;
00064 }


Generated on Sat Jan 31 19:25:44 2004 for CPPScaLapack by doxygen 1.3.5