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