00001
00003 inline zrovector& zrovector::operator=(const zrovector& vec)
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] zrovector::operator=(const zrovector&)"
00007 << std::endl;
00008 #endif//CPPL_VERBOSE
00009
00010 if(Array!=vec.Array){
00011 copy(vec);
00012 }
00013 return *this;
00014 }
00015
00019
00020
00022 inline zrovector& zrovector::operator+=(const zrovector& vec)
00023 {
00024 #ifdef CPPL_VERBOSE
00025 std::cerr << "# [MARK] zrovector::operator+=(const zrovector&)"
00026 << std::endl;
00027 #endif//CPPL_VERBOSE
00028
00029 #ifdef CPPL_DEBUG
00030 if( L!=vec.L ){
00031 std::cerr << "[ERROR] zrovector::operator+=(const zrovector&)" << std::endl
00032 << "These two vectors can not make a sumation." << std::endl
00033 << "Your input was (" << L << ") += (" << vec.L << ")."
00034 << std::endl;
00035 exit(1);
00036 }
00037 #endif//CPPL_DEBUG
00038
00039 for(long i=0; i<L; i++){ Array[i]+=vec.Array[i]; }
00040
00041 return *this;
00042 }
00043
00044
00046 inline zrovector& zrovector::operator-=(const zrovector& vec)
00047 {
00048 #ifdef CPPL_VERBOSE
00049 std::cerr << "# [MARK] zrovector::operator-=(const zrovector&)"
00050 << std::endl;
00051 #endif//CPPL_VERBOSE
00052
00053 #ifdef CPPL_DEBUG
00054 if( L!=vec.L ){
00055 std::cerr << "[ERROR] zrovector::operator-=(const zrovector&)" << std::endl
00056 << "These two vectors can not make a subtraction." << std::endl
00057 << "Your input was (" << L << ") -= (" << vec.L << ")."
00058 << std::endl;
00059 exit(1);
00060 }
00061 #endif//CPPL_DEBUG
00062
00063 for(long i=0; i<L; i++){ Array[i]-=vec.Array[i]; }
00064
00065 return *this;
00066 }
00067
00071
00072
00074 inline _zrovector operator+(const zrovector& vecA, const zrovector& vecB)
00075 {
00076 #ifdef CPPL_VERBOSE
00077 std::cerr << "# [MARK] operator+(const zrovector&, const zrovector&)"
00078 << std::endl;
00079 #endif//CPPL_VERBOSE
00080
00081 #ifdef CPPL_DEBUG
00082 if(vecA.L!=vecB.L){
00083 std::cerr << "[ERROR] operator+(const zrovector&, const zrovector&)"
00084 << std::endl
00085 << "These two vectors can not make a sumation." << std::endl
00086 << "Your input was (" << vecA.L << ") + (" << vecB.L << ")."
00087 << std::endl;
00088 exit(1);
00089 }
00090
00091 #endif//CPPL_DEBUG
00092
00093 zrovector newvec(vecA.L);
00094 for(long i=0; i<newvec.l; i++){
00095 newvec.array[i] =vecA.Array[i]+vecB.Array[i];
00096 }
00097
00098 return _(newvec);
00099 }
00100
00101
00103 inline _zrovector operator-(const zrovector& vecA, const zrovector& vecB)
00104 {
00105 #ifdef CPPL_VERBOSE
00106 std::cerr << "# [MARK] operator-(const zrovector&, const zrovector&)"
00107 << std::endl;
00108 #endif//CPPL_VERBOSE
00109
00110 #ifdef CPPL_DEBUG
00111 if(vecA.L!=vecB.L){
00112 std::cerr << "[ERROR] operator-(const zrovector&, const zrovector&)"
00113 << std::endl
00114 << "These two vectors can not make a subtraction." << std::endl
00115 << "Your input was (" << vecA.L << ") - (" << vecB.L << ")."
00116 << std::endl;
00117 exit(1);
00118 }
00119 #endif//CPPL_DEBUG
00120
00121 zrovector newvec(vecA.L);
00122 for(long i=0; i<newvec.l; i++){
00123 newvec.array[i] =vecA.Array[i]-vecB.Array[i];
00124 }
00125
00126 return _(newvec);
00127 }
00128
00129
00131 inline std::complex<double> operator%(const zrovector& vecA, const zrovector& vecB)
00132 {
00133 #ifdef CPPL_VERBOSE
00134 std::cerr << "# [MARK] operator%(const zrovector&, const zrovector&)"
00135 << std::endl;
00136 #endif//CPPL_VERBOSE
00137
00138 #ifdef CPPL_DEBUG
00139 if(vecA.L!=vecB.L){
00140 std::cerr << "[ERROR] operator%(const zrovector&, const zrovector&)"
00141 << std::endl
00142 << "These two vectors can not make a dot product." << std::endl
00143 << "Your input was (" << vecA.L << ") % (" << vecB.L << ")."
00144 << std::endl;
00145 exit(1);
00146 }
00147 #endif//CPPL_DEBUG
00148
00149 std::complex<double> val( zdotu_( vecA.L, vecA.Array, 1, vecB.Array, 1 ) );
00150 return val;
00151 }