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

_dcovector-_dcovector.hpp File Reference

Go to the source code of this file.

Functions

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


Function Documentation

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

_dcovector+_dcovector operator

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

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

00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if(vecA.L!=vecB.L){
00007     std::cerr
00008       << "[ERROR] operator+(const _dcovector&, const _dcovector&)" << 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(int i=0; i<vecA.Ll; i++){ vecA.Array[i] +=vecB.Array[i]; }
00017   
00018   vecB.destroy();
00019   return vecA;
00020 }

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

_dcovector-_dcovector operator

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

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

00025 {
00026 #ifdef  CPPSL_DEBUG
00027   if(vecA.L!=vecB.L){
00028     std::cerr
00029       << "[ERROR] operator-(const _dcovector&, const _dcovector&)" << 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(int i=0; i<vecA.Ll; i++){ vecA.Array[i] -=vecB.Array[i]; }
00038   
00039   vecB.destroy();
00040   return vecA;
00041 }

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

_dcovector^T*_dcovector operator (inner product)

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

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

00046 {
00047 #ifdef  CPPSL_DEBUG
00048   if(vecA.L!=vecB.L){
00049     std::cerr
00050       << "[ERROR] operator%(const _dcovector&, const _dcovector&)" << 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