Go to the documentation of this file.00001
00002
00003 inline zhsmatrix& zhsmatrix::operator=(const _zhsmatrix& mat)
00004 {VERBOSE_REPORT;
00005 shallow_copy(mat);
00006 return *this;
00007 }
00008
00009
00010
00011
00012
00013
00014
00015 inline zhsmatrix& zhsmatrix::operator+=(const _zhsmatrix& mat)
00016 {VERBOSE_REPORT;
00017 #ifdef CPPL_DEBUG
00018 if(n!=mat.n){
00019 ERROR_REPORT;
00020 std::cerr << "These two matrises can not make a summation." << std::endl
00021 << "Your input was (" << n << "x" << n << ") += (" << mat.n << "x" << mat.n << ")." << std::endl;
00022 exit(1);
00023 }
00024 #endif//CPPL_DEBUG
00025
00026 for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00027 (*this)(it->i,it->j) +=it->v;
00028 }
00029
00030 mat.destroy();
00031 return *this;
00032 }
00033
00034
00035
00036 inline zhsmatrix& zhsmatrix::operator-=(const _zhsmatrix& mat)
00037 {VERBOSE_REPORT;
00038 #ifdef CPPL_DEBUG
00039 if(n!=mat.n){
00040 ERROR_REPORT;
00041 std::cerr << "These two matrises can not make a sutraction." << std::endl
00042 << "Your input was (" << n << "x" << n << ") -= (" << mat.n << "x" << mat.n << ")." << std::endl;
00043 exit(1);
00044 }
00045 #endif//CPPL_DEBUG
00046
00047 for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00048 (*this)(it->i,it->j) -=it->v;
00049 }
00050
00051 mat.destroy();
00052 return *this;
00053 }
00054
00055
00056
00057
00058
00059
00060
00061 inline _zhsmatrix operator+(const zhsmatrix& matA, const _zhsmatrix& matB)
00062 {VERBOSE_REPORT;
00063 #ifdef CPPL_DEBUG
00064 if(matA.n!=matB.n){
00065 ERROR_REPORT;
00066 std::cerr << "These two matrises can not make a summation." << std::endl
00067 << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
00068 exit(1);
00069 }
00070 #endif//CPPL_DEBUG
00071
00072 zhsmatrix newmat(matB);
00073
00074 for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){
00075 newmat(it->i,it->j) +=it->v;
00076 }
00077
00078 return _(newmat);
00079 }
00080
00081
00082
00083 inline _zhsmatrix operator-(const zhsmatrix& matA, const _zhsmatrix& matB)
00084 {VERBOSE_REPORT;
00085 #ifdef CPPL_DEBUG
00086 if(matA.n!=matB.n){
00087 ERROR_REPORT;
00088 std::cerr << "These two matrises can not make a subtraction." << std::endl
00089 << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
00090 exit(1);
00091 }
00092 #endif//CPPL_DEBUG
00093
00094 zhsmatrix newmat(-matB);
00095
00096 for(std::vector<zcomponent>::const_iterator it=matA.data.begin(); it!=matA.data.end(); it++){
00097 newmat(it->i,it->j) +=it->v;
00098 }
00099
00100 return _(newmat);
00101 }
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130