Go to the documentation of this file.00001
00002
00003 inline _drovector operator+(const _drovector& vecA, const drovector& vecB)
00004 {VERBOSE_REPORT;
00005 #ifdef CPPL_DEBUG
00006 if(vecA.l!=vecB.l){
00007 ERROR_REPORT;
00008 std::cerr << "These two vectors can not make a sumation." << std::endl
00009 << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl;
00010 exit(1);
00011 }
00012
00013 #endif//CPPL_DEBUG
00014
00015 for(long i=0; i<vecA.l; i++){ vecA.array[i]+=vecB.array[i]; }
00016
00017 return vecA;
00018 }
00019
00020
00021
00022 inline _drovector operator-(const _drovector& vecA, const drovector& vecB)
00023 {VERBOSE_REPORT;
00024 #ifdef CPPL_DEBUG
00025 if(vecA.l!=vecB.l){
00026 ERROR_REPORT;
00027 std::cerr << "These two vectors can not make a subtraction." << std::endl
00028 << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
00029 exit(1);
00030 }
00031 #endif//CPPL_DEBUG
00032
00033 for(long i=0; i<vecA.l; i++){ vecA.array[i]-=vecB.array[i]; }
00034
00035 return vecA;
00036 }
00037
00038
00039
00040 inline double operator%(const _drovector& vecA, const drovector& vecB)
00041 {VERBOSE_REPORT;
00042 #ifdef CPPL_DEBUG
00043 if(vecA.l!=vecB.l){
00044 ERROR_REPORT;
00045 std::cerr << "These two vectors can not make a dot product." << std::endl
00046 << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
00047 exit(1);
00048 }
00049 #endif//CPPL_DEBUG
00050
00051 double val( ddot_( vecA.l, vecA.array, 1, vecB.array, 1 ) );
00052
00053 vecA.destroy();
00054 return val;
00055 }