[Teleus-cvs] teleus/src/math matrix.cpp,1.8,1.9 matrix.hpp,1.7,1.8
Status: Inactive
Brought to you by:
spiffgq
|
From: Daniel R. <sp...@us...> - 2004-05-25 23:02:44
|
Update of /cvsroot/teleus/teleus/src/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15853/src/math Modified Files: matrix.cpp matrix.hpp Log Message: Enhanced Matrix3d. Renamed the Matrix classes to more typist-friendly names. Index: matrix.cpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/math/matrix.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** matrix.cpp 4 May 2004 18:12:39 -0000 1.8 --- matrix.cpp 25 May 2004 23:02:26 -0000 1.9 *************** *** 45,49 **** * \author Daniel Royer */ ! Matrix_3X3::Matrix_3X3 () { zero(); --- 45,49 ---- * \author Daniel Royer */ ! Matrix3d::Matrix3d () { [...1527 lines suppressed...] - /** - * \typedef typedef Matrix_4X4 Matrix; - * \brief Another more convenient name for a 4 by 4 matrix - * \author Daniel Royer - */ - } // END NAMESPACE math } // END NAMESPACE teleus --- 1580,1589 ---- /** ! * \class Matrix4d ! * \brief A 4 by 4 matrix * \author Daniel Royer */ } // END NAMESPACE math } // END NAMESPACE teleus Index: matrix.hpp =================================================================== RCS file: /cvsroot/teleus/teleus/src/math/matrix.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** matrix.hpp 4 May 2004 18:12:39 -0000 1.7 --- matrix.hpp 25 May 2004 23:02:27 -0000 1.8 *************** *** 33,37 **** namespace math { ! struct Matrix_2X2 { float v[4]; --- 33,37 ---- namespace math { ! struct Matrix2d { float v[4]; *************** *** 39,43 **** }; ! struct Matrix_3X3 { union { --- 39,43 ---- }; ! struct Matrix3d { union { *************** *** 51,58 **** }; ! Matrix_3X3 (); ! Matrix_3X3 (float); ! Matrix_3X3 (const float*); ! Matrix_3X3 (const Matrix_3X3&); void zero(); --- 51,59 ---- }; ! Matrix3d (); ! Matrix3d (float); ! Matrix3d (const float*); ! Matrix3d (float, float, float, float, float, float, float, float, float); ! Matrix3d (const Matrix3d&); void zero(); *************** *** 60,64 **** void set (float); void set (const float*); ! void set (const Matrix_3X3&); void setDiag (float, bool setZero = true); void setDiag (float, float, float, bool setZero = true); --- 61,66 ---- void set (float); void set (const float*); ! void set (float, float, float, float, float, float, float, float, float); ! void set (const Matrix3d&); void setDiag (float, bool setZero = true); void setDiag (float, float, float, bool setZero = true); *************** *** 72,105 **** float det() const; void transpose(); ! Matrix_3X3 transposed() const; void inverse(); ! Matrix_3X3 inversed() const; ! Matrix_3X3& operator+= (const Matrix_3X3& m); ! Matrix_3X3& operator-= (const Matrix_3X3& m); ! Matrix_3X3& operator*= (const Matrix_3X3& m); ! Matrix_3X3& operator*= (float); ! Matrix_3X3& operator/= (float); ! Matrix_3X3& operator= (float); ! Matrix_3X3& operator= (float*); ! Matrix_3X3& operator= (const Matrix_3X3&); }; ! const Matrix_3X3 operator+ (const Matrix_3X3& m1, const Matrix_3X3& m2); ! const Matrix_3X3 operator- (const Matrix_3X3& m1, const Matrix_3X3& m2); ! const Matrix_3X3 operator* (const Matrix_3X3& m1, const Matrix_3X3& m2); ! const Vector3d operator* (const Matrix_3X3& m, const Vector3d& v); ! const Vector3d operator* (const Vector3d& v, const Matrix_3X3& m); ! const Matrix_3X3 operator* (const Matrix_3X3& m, float scalar); ! const Matrix_3X3 operator* (float scalar, const Matrix_3X3& m); ! const Matrix_3X3 operator/ (const Matrix_3X3& m, float scalar); ! typedef Matrix_3X3 Tensor; ! struct Matrix_4X4 { union { --- 74,107 ---- float det() const; void transpose(); ! Matrix3d transposed() const; void inverse(); ! Matrix3d inversed() const; ! Matrix3d& operator+= (const Matrix3d& m); ! Matrix3d& operator-= (const Matrix3d& m); ! Matrix3d& operator*= (const Matrix3d& m); ! Matrix3d& operator*= (float); ! Matrix3d& operator/= (float); ! Matrix3d& operator= (float); ! Matrix3d& operator= (float*); ! Matrix3d& operator= (const Matrix3d&); }; ! const Matrix3d operator+ (const Matrix3d& m1, const Matrix3d& m2); ! const Matrix3d operator- (const Matrix3d& m1, const Matrix3d& m2); ! const Matrix3d operator* (const Matrix3d& m1, const Matrix3d& m2); ! const Vector3d operator* (const Matrix3d& m, const Vector3d& v); ! const Vector3d operator* (const Vector3d& v, const Matrix3d& m); ! const Matrix3d operator* (const Matrix3d& m, float scalar); ! const Matrix3d operator* (float scalar, const Matrix3d& m); ! const Matrix3d operator/ (const Matrix3d& m, float scalar); ! typedef Matrix3d Tensor; ! struct Matrix4d { union { *************** *** 114,122 **** }; ! Matrix_4X4 (); ! Matrix_4X4 (const float f); ! Matrix_4X4 (const float *v); ! Matrix_4X4 (const Quaternion& q); ! Matrix_4X4 (const Matrix_4X4 &m); void zero (); --- 116,124 ---- }; ! Matrix4d (); ! Matrix4d (const float f); ! Matrix4d (const float *v); ! Matrix4d (const Quaternion& q); ! Matrix4d (const Matrix4d &m); void zero (); *************** *** 132,139 **** float operator()(unsigned int i, unsigned int j) const; ! const Matrix_4X4& operator=(const float f); ! const Matrix_4X4& operator=(const float *v); ! const Matrix_4X4& operator=(const Quaternion& q); ! const Matrix_4X4& operator=(const Matrix_4X4& m); Vector3d transform (const Vector3d& v) const; --- 134,141 ---- float operator()(unsigned int i, unsigned int j) const; ! const Matrix4d& operator=(const float f); ! const Matrix4d& operator=(const float *v); ! const Matrix4d& operator=(const Quaternion& q); ! const Matrix4d& operator=(const Matrix4d& m); Vector3d transform (const Vector3d& v) const; *************** *** 178,187 **** }; ! typedef Matrix_4X4 Matrix; ! ! const Matrix_4X4 operator* (const Matrix_4X4& a, const Matrix_4X4& b); ! const Matrix_4X4& operator*=( Matrix_4X4& a, const Matrix_4X4& b); ! const Vector3d operator* (const Matrix_4X4& a, const Vector3d& v); ! const Vector3d operator* (const Vector3d& v, const Matrix_4X4& a); } // END NAMESPACE math --- 180,187 ---- }; ! const Matrix4d operator* (const Matrix4d& a, const Matrix4d& b); ! const Matrix4d& operator*=( Matrix4d& a, const Matrix4d& b); ! const Vector3d operator* (const Matrix4d& a, const Vector3d& v); ! const Vector3d operator* (const Vector3d& v, const Matrix4d& a); } // END NAMESPACE math |