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

_drovector-_drovector.hpp File Reference

Go to the source code of this file.

Functions

_drovector operator+ (const _drovector &vecA, const _drovector &vecB)
_drovector operator- (const _drovector &vecA, const _drovector &vecB)
double operator% (const _drovector &vecA, const _drovector &vecB)


Function Documentation

_drovector operator+ const _drovector vecA,
const _drovector vecB
[inline]
 

_drovector+_drovector operator

Definition at line 3 of file _drovector-_drovector.hpp.

References _drovector::Array, _drovector::destroy(), _drovector::L, and _drovector::Ll.

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( vecA.L!=vecB.L ){
00007     std::cerr << "[ERROR] operator+(const _drovector&, const _drovector&)"
00008               << std::endl
00009               << "These two vectors can not make a sumation." << std::endl
00010               << "Your input was (" << vecA.L << ") + (" << vecB.L << ")."
00011               << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   for(long i=0; i<vecA.Ll; i++){ vecA.Array[i] +=vecB.Array[i]; }
00017   
00018   vecB.destroy();
00019   return vecA;
00020 }

_drovector operator- const _drovector vecA,
const _drovector vecB
[inline]
 

_drovector-_drovector operator

Definition at line 24 of file _drovector-_drovector.hpp.

References _drovector::Array, _drovector::destroy(), _drovector::L, and _drovector::Ll.

00025 {
00026 #ifdef  CPPSL_DEBUG
00027   if( vecA.L!=vecB.L ){
00028     std::cerr << "[ERROR] operator-(const _drovector&, const _drovector&)"
00029               << std::endl
00030               << "These two vectors can not make a subtraction." << std::endl
00031               << "Your input was (" << vecA.L << ") - (" << vecB.L << ")."
00032               << std::endl;
00033     exit(1);
00034   }
00035 #endif//CPPSL_DEBUG
00036   
00037   for(long i=0; i<vecA.Ll; i++){ vecA.Array[i] -=vecB.Array[i]; }
00038   
00039   vecB.destroy();
00040   return vecA;
00041 }

double operator% const _drovector vecA,
const _drovector vecB
[inline]
 

_drovector*_drovector^T operator (inner product)

Definition at line 45 of file _drovector-_drovector.hpp.

References _drovector::Array, _drovector::Desc, _drovector::destroy(), and _drovector::L.

00046 {
00047 #ifdef  CPPSL_DEBUG
00048   if( vecA.L!=vecB.L ){
00049     std::cerr << "[ERROR] operator%(const _drovector&, const _drovector&)"
00050               << std::endl
00051               << "These two vectors can not make a dot product." << std::endl
00052               << "Your input was (" << vecA.L << ") % (" << vecB.L << ")."
00053               << std::endl;
00054     exit(1);
00055   }
00056 #endif//CPPSL_DEBUG
00057   
00058   double val;
00059   pddot_( vecA.L, val,
00060           vecA.Array, 1, 1, vecA.Desc, 1, vecB.Array, 1, 1, vecB.Desc, 1 );
00061   
00062   vecA.destroy();
00063   vecB.destroy();
00064   return val;
00065 }


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