Go to the documentation of this file.00001
00002
00003 inline zhsmatrix& zhsmatrix::operator=(const zhsmatrix& mat)
00004 {VERBOSE_REPORT;
00005 if(&data!=&mat.data){
00006 copy(mat);
00007 }
00008 return *this;
00009 }
00010
00011
00012
00013
00014
00015
00016
00017 inline zhsmatrix& zhsmatrix::operator+=(const zhsmatrix& mat)
00018 {VERBOSE_REPORT;
00019 #ifdef CPPL_DEBUG
00020 if(n!=mat.n){
00021 ERROR_REPORT;
00022 std::cerr << "These two matrises can not make a summation." << std::endl
00023 << "Your input was (" << n << "x" << n << ") += (" << mat.n << "x" << mat.n << ")." << std::endl;
00024 exit(1);
00025 }
00026 #endif//CPPL_DEBUG
00027
00028 for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00029 (*this)(it->i,it->j) +=it->v;
00030 }
00031
00032 return *this;
00033 }
00034
00035
00036
00037 inline zhsmatrix& zhsmatrix::operator-=(const zhsmatrix& mat)
00038 {VERBOSE_REPORT;
00039 #ifdef CPPL_DEBUG
00040 if(n!=mat.n){
00041 ERROR_REPORT;
00042 std::cerr << "These two matrises can not make a sutraction." << std::endl
00043 << "Your input was (" << n << "x" << n << ") -= (" << mat.n << "x" << mat.n << ")." << std::endl;
00044 exit(1);
00045 }
00046 #endif//CPPL_DEBUG
00047
00048 for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00049 (*this)(it->i,it->j) -=it->v;
00050 }
00051
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(matA);
00073
00074 for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB.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(matA);
00095
00096 for(std::vector<zcomponent>::const_iterator it=matB.data.begin(); it!=matB.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