14 SqMatrix3
operator* (double scalar
, const SqMatrix3
&other
);
15 std::ostream
& operator<< (std::ostream
&out
, const SqMatrix3
&matrix
);
23 Mat_Null
, // the 0 matrix
27 SqMatrix3 (MatType type
= Mat_Identity
); // the identity I3 or the null matrix
28 SqMatrix3 (const SqMatrix3
&other
);
29 SqMatrix3 (const Vector3
&col1
, const Vector3
&col2
, const Vector3
&col3
);
30 virtual ~SqMatrix3 ();
32 SqMatrix3
& operator= (const SqMatrix3
&other
);
34 // addition/substraction operators
35 SqMatrix3
operator+ (const SqMatrix3
&other
) const;
36 SqMatrix3
& operator+= (const SqMatrix3
&other
);
37 SqMatrix3
operator- (const SqMatrix3
&other
) const;
38 SqMatrix3
& operator-= (const SqMatrix3
&other
);
40 // multiplication operators
41 SqMatrix3
operator* (const SqMatrix3
&other
) const;
42 SqMatrix3
& operator*= (const SqMatrix3
&other
);
43 SqMatrix3
operator* (double scalar
) const;
44 SqMatrix3
& operator*= (double scalar
);
45 friend SqMatrix3
operator* (double scalar
, const SqMatrix3
&other
);
46 Vector3
operator* (const Vector3
& vector
) const;
48 // comparison operator
49 bool operator== (const SqMatrix3
&other
) const;
50 bool operator!= (const SqMatrix3
&other
) const;
53 SqMatrix3
transpose() const;
54 SqMatrix3
& setToTransposed();
56 // determinant, inverse
57 double determinant() const;
58 double det() const; // this is an alias
60 SqMatrix3
inverse() const;
61 SqMatrix3
& setToInverse();
64 // math-like setter/getter
65 double& operator() (unsigned int row
, unsigned int col
);
66 double operator() (unsigned int row
, unsigned int col
) const;
67 // C++ like setter/getter : indexes start at 0
68 double& at (unsigned int row
, unsigned int col
);
69 double at (unsigned int row
, unsigned int col
) const;
71 // show matrix using cout by default
72 void show(std::ostream
&out
= std::cout
) const;
75 void _setCols (const Vector3
*cols
); // call only from another SqMatrix3 : cols is intended to be a 3-dim array
79 static const unsigned int m_SIZE
= 3; // size of the column vectors representing the matrix