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) |
|
drovector+drovector operator Definition at line 64 of file drovector-drovector.hpp. References drovector::Array, _drovector::Array, drovector::L, and _drovector::Ll.
00065 { 00066 #ifdef CPPSL_DEBUG 00067 if( vecA.L!=vecB.L ){ 00068 std::cerr << "[ERROR] operator+(const drovector&, const drovector&)" 00069 << std::endl 00070 << "These two vectors can not make a sumation." << std::endl 00071 << "Your input was (" << vecA.L << ") + (" << vecB.L << ")." 00072 << std::endl; 00073 exit(1); 00074 } 00075 #endif//CPPSL_DEBUG 00076 00077 _drovector newvec(vecA.L); 00078 for(long i=0; i<newvec.Ll; i++){ 00079 newvec.Array[i] =vecA.Array[i]+vecB.Array[i]; 00080 } 00081 00082 return newvec; 00083 } |
|
drovector-drovector operator Definition at line 87 of file drovector-drovector.hpp. References drovector::Array, _drovector::Array, drovector::L, and _drovector::Ll.
00088 { 00089 #ifdef CPPSL_DEBUG 00090 if( vecA.L!=vecB.L ){ 00091 std::cerr << "[ERROR] operator-(const drovector&, const drovector&)" 00092 << std::endl 00093 << "These two vectors can not make a subtraction." << std::endl 00094 << "Your input was (" << vecA.L << ") - (" << vecB.L << ")." 00095 << std::endl; 00096 exit(1); 00097 } 00098 #endif//CPPSL_DEBUG 00099 00100 _drovector newvec(vecA.L); 00101 for(long i=0; i<newvec.Ll; i++){ 00102 newvec.Array[i] =vecA.Array[i]-vecB.Array[i]; 00103 } 00104 00105 return newvec; 00106 } |
|
drovector*drovector^T operator (inner product) Definition at line 110 of file drovector-drovector.hpp. References drovector::Array, drovector::Desc, and drovector::L.
00111 { 00112 #ifdef CPPSL_DEBUG 00113 if( vecA.L!=vecB.L ){ 00114 std::cerr << "[ERROR] operator%(const drovector&, const drovector&)" 00115 << std::endl 00116 << "These two vectors can not make a dot product." << std::endl 00117 << "Your input was (" << vecA.L << ") % (" << vecB.L << ")." 00118 << std::endl; 00119 exit(1); 00120 } 00121 #endif//CPPSL_DEBUG 00122 00123 double val; 00124 pddot_( vecA.L, val, 00125 vecA.Array, 1, 1, vecA.Desc, 1, vecB.Array, 1, 1, vecB.Desc, 1 ); 00126 00127 return val; 00128 } |