1 #ifndef CMU462_MATRIX3X3_H
2 #define CMU462_MATRIX3X3_H
27 for(
int i = 0; i < 3; i++ ) {
28 for(
int j = 0; j < 3; j++ ) {
30 (*this)(i,j) = data[i*3 + j];
38 void zero(
double val = 0.0 );
43 double det(
void )
const;
48 double norm(
void )
const;
77 double& operator()(
int i,
int j );
78 const double& operator()(
int i,
int j )
const;
82 const Vector3D& operator[](
int i )
const;
103 void operator/=(
double x );
119 std::ostream& operator<<( std::ostream& os,
const Matrix3x3& A );
123 #endif // CMU462_MATRIX3X3_H
double det(void) const
Returns the determinant of A.
Definition: matrix3x3.cpp:31
Defines 3D vectors.
Definition: vector3D.h:14
static Matrix3x3 identity(void)
Returns the 3x3 identity matrix.
Definition: matrix3x3.cpp:181
Vector3D & column(int i)
Returns the ith column.
Definition: matrix3x3.cpp:234
static Matrix3x3 crossProduct(const Vector3D &u)
Returns a matrix representing the (left) cross product with u.
Definition: matrix3x3.cpp:191
Matrix3x3 inv(void) const
Returns the inverse of A.
Definition: matrix3x3.cpp:157
Matrix3x3 T(void) const
Returns the transpose of A.
Definition: matrix3x3.cpp:144
void zero(double val=0.0)
Sets all elements to val.
Definition: matrix3x3.cpp:26
Defines a 3x3 matrix.
Definition: matrix3x3.h:15
double norm(void) const
Returns the Frobenius norm of A.
Definition: matrix3x3.cpp:39