diff --git a/Geo/STensor3.h b/Geo/STensor3.h index 134e69537a730476d1c51238e62bd1a18fba62a0..61827399e82ecf6e458c027161a16de6af2534c2 100644 --- a/Geo/STensor3.h +++ b/Geo/STensor3.h @@ -281,8 +281,9 @@ class STensor3 { return ithis; } - void operator = (const STensor3 &other){ + STensor3& operator = (const STensor3 &other){ for (int i = 0; i < 9; i++) _val[i] = other._val[i]; + return *this; } STensor3 operator + (const STensor3 &other) const diff --git a/Geo/SVector3.h b/Geo/SVector3.h index 834d4681b6db47fbaf6cf2e49bb0fae024e191e6..d5db422faca103f56c0141451fe857b31a096e3d 100644 --- a/Geo/SVector3.h +++ b/Geo/SVector3.h @@ -70,6 +70,12 @@ class SVector3 { P[0] = v; P[1] = v; P[2] = v; return *this; } + SVector3 & operator = (const SVector3& a) + { + P[0] = a[0]; P[1] = a[1]; P[2] = a[2]; + return *this; + } + operator double *() { return P; } void print(std::string name="") const { diff --git a/Solver/STensor43.h b/Solver/STensor43.h index 09c08dc9627ce519a9fbc3f7d9b2336360d0a39c..12980c713d9971e413e3c89e18cbcdee7f5ce345 100644 --- a/Solver/STensor43.h +++ b/Solver/STensor43.h @@ -83,11 +83,17 @@ class STensor43 { for (int i = 0; i < 81; i++) _val[i] -= other._val[i]; return *this; } + STensor43& operator = (const STensor43 &other) + { + for (int i = 0; i < 81; i++) _val[i] = other._val[i]; + return *this; + } STensor43& operator *= (const double &other) { for (int i = 0; i < 81; i++) _val[i] *= other; return *this; } + STensor43 transpose (int n, int m) const { STensor43 ithis; diff --git a/Solver/STensor53.h b/Solver/STensor53.h index fefe35d8acb6412db80699065765e6b16a820a91..085339287e8c1e9dbefea867a081f9b142b9080d 100644 --- a/Solver/STensor53.h +++ b/Solver/STensor53.h @@ -18,6 +18,15 @@ class STensor53 { inline double operator()(int i, int j, int k, int l, int m) const{ return _val[i][j][k][l][m]; }; + STensor53& operator = (const STensor53 &other){ + for (int i=0; i<3; i++) + for (int j=0; j<3; j++) + for (int k=0; k<3; k++) + for (int l=0; l<3; l++) + for (int m=0; m<3; m++) + _val[i][j][k][l][m] = other._val[i][j][k][l][m]; + return *this; + }; STensor53& operator += (const STensor53 &other){ for (int i=0; i<3; i++) for (int j=0; j<3; j++) diff --git a/Solver/STensor63.h b/Solver/STensor63.h index de6218a8be91edbb7623217ae3d8e3bdcf5ee509..7d26113d0f8e547f10268dfe4fa8d070c238cf6b 100644 --- a/Solver/STensor63.h +++ b/Solver/STensor63.h @@ -18,6 +18,16 @@ class STensor63{ inline double operator()(int i, int j, int k, int l, int m, int n) const{ return _val[i][j][k][l][m][n]; }; + STensor63& operator = (const STensor63 &other){ + for (int i=0; i<3; i++) + for (int j=0; j<3; j++) + for (int k=0; k<3; k++) + for (int l=0; l<3; l++) + for (int m=0; m<3; m++) + for (int n=0; n<3; n++) + _val[i][j][k][l][m][n] = other._val[i][j][k][l][m][n]; + return *this; + }; STensor63& operator += (const STensor63 &other){ for (int i=0; i<3; i++) for (int j=0; j<3; j++)