From cf9fd0ca9ffa3493d8becaa231a8a96291a3d41b Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Fri, 20 Jan 2006 16:41:44 +0000 Subject: [PATCH] added operators: operator -= ( const Matrix33Diag &p ) Matrix33 operator - ( const Matrix33Diag &p ) Matrix33 operator + ( const Matrix33 &m ) Matrix33 operator + ( const Matrix33Diag &p ) --- vcg/math/matrix33.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/vcg/math/matrix33.h b/vcg/math/matrix33.h index 481c3de7..bda8b985 100644 --- a/vcg/math/matrix33.h +++ b/vcg/math/matrix33.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.12 2005/11/14 10:28:25 cignoni +Changed Invert -> FastInvert for the function based on the maple expansion + Revision 1.11 2005/10/13 15:45:23 ponchio Changed a Zero in SetZero in WeightedCrossCovariance() (again) @@ -171,6 +174,15 @@ public: a[i] -= m.a[i]; return *this; } + + /// Modificatore somma per matrici 3x3 + Matrix33 & operator -= ( const Matrix33Diag &p ) + { + a[0] -= p[0]; + a[4] -= p[1]; + a[8] -= p[2]; + return *this; + } /// Modificatore divisione per scalare Matrix33 & operator /= ( const S &s ) @@ -253,7 +265,36 @@ public: return r; } + + /// Operatore sottrazione di matrici 3x3 con matrici diagonali + Matrix33 operator - ( const Matrix33Diag &p ) + { + Matrix33 r=a; + r[0][0] -= p[0]; + r[1][1] -= p[1]; + r[2][2] -= p[2]; + return r; + } + /// Operatore sottrazione per matrici 3x3 + Matrix33 operator + ( const Matrix33 &m ) + { + Matrix33 r; + for(int i=0;i<9;++i) + r.a[i] = a[i] + m.a[i]; + + return r; + } + + /// Operatore addizione di matrici 3x3 con matrici diagonali + Matrix33 operator + ( const Matrix33Diag &p ) + { + Matrix33 r=a; + r.a[0][0] += p[0]; + r.a[1][1] += p[1]; + r.a[2][2] += p[2]; + return r; + } /** Operatore per il prodotto matrice-vettore. @param v A point in $R^{3}$