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

Comparing:
trunk/OOPSE-3.0/src/math/SquareMatrix3.hpp (file contents), Revision 1630 by tim, Thu Oct 21 21:31:39 2004 UTC vs.
branches/new_design/OOPSE-3.0/src/math/SquareMatrix3.hpp (file contents), Revision 1695 by tim, Mon Nov 1 22:52:57 2004 UTC

# Line 47 | Line 47 | namespace oopse {
47              
48              /** default constructor */
49              SquareMatrix3() : SquareMatrix<Real, 3>() {
50 +            }
51 +
52 +            /** Constructs and initializes every element of this matrix to a scalar */
53 +            SquareMatrix3(Real s) : SquareMatrix<Real,3>(s){
54 +            }
55 +
56 +            /** Constructs and initializes from an array */
57 +            SquareMatrix3(Real* array) : SquareMatrix<Real,3>(array){
58              }
59  
60 +
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 257 | 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 426 | Line 435 | namespace oopse {
435          // transpose the eigenvectors back again
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