Go to the documentation of this file.00001
00002
00003 inline dssmatrix& dssmatrix::operator=(const dssmatrix& 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 dssmatrix& dssmatrix::operator+=(const dssmatrix& 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<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00029 (*this)(it->i,it->j) +=it->v;
00030 }
00031 return *this;
00032 }
00033
00034
00035
00036 inline dssmatrix& dssmatrix::operator-=(const dssmatrix& 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<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
00048 (*this)(it->i,it->j) -=it->v;
00049 }
00050 return *this;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059 inline _dssmatrix operator+(const dssmatrix& matA, const dssmatrix& matB)
00060 {VERBOSE_REPORT;
00061 #ifdef CPPL_DEBUG
00062 if(matA.n!=matB.n){
00063 ERROR_REPORT;
00064 std::cerr << "These two matrises can not make a summation." << std::endl
00065 << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
00066 exit(1);
00067 }
00068 #endif//CPPL_DEBUG
00069
00070 dssmatrix newmat(matA);
00071 for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){
00072 newmat(it->i,it->j) +=it->v;
00073 }
00074 return _(newmat);
00075 }
00076
00077
00078
00079 inline _dssmatrix operator-(const dssmatrix& matA, const dssmatrix& matB)
00080 {VERBOSE_REPORT;
00081 #ifdef CPPL_DEBUG
00082 if(matA.n!=matB.n){
00083 ERROR_REPORT;
00084 std::cerr << "These two matrises can not make a subtraction." << std::endl
00085 << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
00086 exit(1);
00087 }
00088 #endif//CPPL_DEBUG
00089
00090 dssmatrix newmat(matA);
00091 for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB.data.end(); it++){
00092 newmat(it->i,it->j) -=it->v;
00093 }
00094 return _(newmat);
00095 }
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123