ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/math/SquareMatrix3.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/math/SquareMatrix3.hpp (file contents):
Revision 1694, Thu Oct 28 22:34:02 2004 UTC vs.
Revision 1695 by tim, Mon Nov 1 22:52:57 2004 UTC

# Line 61 | Line 61 | namespace oopse {
61              /** copy  constructor */
62              SquareMatrix3(const SquareMatrix<Real, 3>& m)  : SquareMatrix<Real, 3>(m) {
63              }
64 <
64 >            
65              SquareMatrix3( const Vector3<Real>& eulerAngles) {
66                  setupRotMat(eulerAngles);
67              }
# Line 266 | Line 266 | namespace oopse {
266               * @note since simple algorithm can be applied to inverse the 3 by 3 matrix, we hide the
267               * implementation of inverse in SquareMatrix class
268               */
269 <            SquareMatrix3<Real>  inverse() {
269 >            SquareMatrix3<Real>  inverse() const {
270                  SquareMatrix3<Real> m;
271                  double det = determinant();
272                  if (fabs(det) <= oopse::epsilon) {
# Line 436 | Line 436 | namespace oopse {
436          v = v.transpose();
437          return ;
438      }
439 +
440 +    /**
441 +    * Return the multiplication of two matrixes  (m1 * m2).
442 +    * @return the multiplication of two matrixes
443 +    * @param m1 the first matrix
444 +    * @param m2 the second matrix
445 +    */
446 +    template<typename Real>
447 +    inline SquareMatrix3<Real> operator *(const SquareMatrix3<Real>& m1, const SquareMatrix3<Real>& m2) {
448 +        SquareMatrix3<Real> result;
449 +
450 +            for (unsigned int i = 0; i < 3; i++)
451 +                for (unsigned int j = 0; j < 3; j++)
452 +                    for (unsigned int k = 0; k < 3; k++)
453 +                        result(i, j)  += m1(i, k) * m2(k, j);                
454 +
455 +        return result;
456 +    }
457 +
458      typedef SquareMatrix3<double> Mat3x3d;
459      typedef SquareMatrix3<double> RotMat3x3d;
460  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines