Go to the documentation of this file.00001
00002
00003 inline zcovector& zcovector::operator=(const _zcovector& vec)
00004 {VERBOSE_REPORT;
00005 shallow_copy(vec);
00006 return *this;
00007 }
00008
00009
00010
00011
00012
00013
00014
00015 inline zcovector& zcovector::operator+=(const _zcovector& vec)
00016 {VERBOSE_REPORT;
00017 #ifdef CPPL_DEBUG
00018 if( l!=vec.l ){
00019 ERROR_REPORT;
00020 std::cerr << "These two vectors can not make a sumation." << std::endl
00021 << "Your input was (" << l << ") += (" << vec.l << ")." << std::endl;
00022 exit(1);
00023 }
00024 #endif//CPPL_DEBUG
00025
00026 for(long i=0; i<l; i++){ array[i]+=vec.array[i]; }
00027
00028 vec.destroy();
00029 return *this;
00030 }
00031
00032
00033
00034 inline zcovector& zcovector::operator-=(const _zcovector& vec)
00035 {VERBOSE_REPORT;
00036 #ifdef CPPL_DEBUG
00037 if( l!=vec.l ){
00038 ERROR_REPORT;
00039 std::cerr << "These two vectors can not make a subtraction." << std::endl
00040 << "Your input was (" << l << ") -= (" << vec.l << ")." << std::endl;
00041 exit(1);
00042 }
00043 #endif//CPPL_DEBUG
00044
00045 for(long i=0; i<l; i++){ array[i]-=vec.array[i]; }
00046
00047 vec.destroy();
00048 return *this;
00049 }
00050
00051
00052
00053
00054
00055
00056
00057 inline _zcovector operator+(const zcovector& vecA, const _zcovector& vecB)
00058 {VERBOSE_REPORT;
00059 #ifdef CPPL_DEBUG
00060 if(vecA.l!=vecB.l){
00061 ERROR_REPORT;
00062 std::cerr << "These two vectors can not make a sumation." << std::endl
00063 << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl;
00064 exit(1);
00065 }
00066 #endif//CPPL_DEBUG
00067
00068 for(long i=0; i<vecA.l; i++){ vecB.array[i]+=vecA.array[i]; }
00069
00070 return vecB;
00071 }
00072
00073
00074
00075 inline _zcovector operator-(const zcovector& vecA, const _zcovector& vecB)
00076 {VERBOSE_REPORT;
00077 #ifdef CPPL_DEBUG
00078 if(vecA.l!=vecB.l){
00079 ERROR_REPORT;
00080 std::cerr << "These two vectors can not make a subtraction." << std::endl
00081 << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl;
00082 exit(1);
00083 }
00084 #endif//CPPL_DEBUG
00085
00086 for(long i=0; i<vecA.l; i++){
00087 vecB.array[i] =vecA.array[i]-vecB.array[i];
00088 }
00089
00090 return vecB;
00091 }
00092
00093
00094
00095 inline comple operator%(const zcovector& vecA, const _zcovector& vecB)
00096 {VERBOSE_REPORT;
00097 #ifdef CPPL_DEBUG
00098 if(vecA.l!=vecB.l){
00099 ERROR_REPORT;
00100 std::cerr << "These two vectors can not make a dot product." << std::endl
00101 << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl;
00102 exit(1);
00103 }
00104 #endif//CPPL_DEBUG
00105
00106 comple val( zdotu_( vecA.l, vecA.array, 1, vecB.array, 1 ) );
00107
00108 vecB.destroy();
00109 return val;
00110 }