KurusView  1.0
MMatrix Class Reference

Public Member Functions

 MMatrix (const MVector &v1, const MVector &v2, const MVector &v3)
 constructor - Initializes MVectors in the matrix
 
 MMatrix (double v1x, double v1y, double v1z, double v2x, double v2y, double v2z, double v3x, double v3y, double v3z)
 constructor - Initializes coordinates in the matrix
 
 MMatrix ()
 default constructor - Initializes matrix to zero with MVector constructor
 
MMatrix operator+ (MMatrix const &obj) const
 operator+ - overloads the + operator to add two matrices directly together More...
 
MMatrix operator- (MMatrix const &obj) const
 operator- - overloads the - operator to subtract two matrices directly together More...
 
MMatrix operator* (const MMatrix &obj) const
 operator* - overloads the * operator to multiply a matrix by a matrix More...
 
MVector operator* (const MVector &obj) const
 operator* - overloads the * operator to multiply a matrix by a vector More...
 
MMatrix operator* (double const &scalar) const
 operator* - overloads the * operator to multiply a matrix by a scalar More...
 
MMatrix operator/ (double const &scalar) const
 operator/ - overloads the / operator to divide a matrix by a scalar More...
 
void transpose ()
 transpose - Reflects matrix across the diagonal
 
double determinant () const
 determinant - finds the determinant of the matrix More...
 
void inverse ()
 inverse - Finds inverse of a matrix
 
void setMat (int col, MVector vector)
 setMat - Sets a specific column in the 3x3 matrix (initializes one column to an MVector
 
std::vector< MVector > & getMat ()
 
 ~MMatrix ()=default
 default destructor
 
bool operator== (const MMatrix &m) const
 
bool operator!= (const MMatrix &m) const
 

Friends

std::ostream & operator<< (std::ostream &os, MMatrix &obj)
 classic friend overloaded ostream operator<< declaration - prints MMatrix properties to stdout in human friendly format More...
 

Member Function Documentation

double MMatrix::determinant ( ) const

determinant - finds the determinant of the matrix

Returns
- Determinant of the matrix
MMatrix MMatrix::operator* ( const MMatrix obj) const

operator* - overloads the * operator to multiply a matrix by a matrix

Parameters
obj- MMatrix instance
Returns
MMatrix - result of matrix multiplied by a MMatrix
MVector MMatrix::operator* ( const MVector obj) const

operator* - overloads the * operator to multiply a matrix by a vector

Parameters
obj- MVector instance
Returns
MVector - result of matrix multiplied by a vector
MMatrix MMatrix::operator* ( double const &  scalar) const

operator* - overloads the * operator to multiply a matrix by a scalar

Parameters
scalar- a double value to multiply an MMatrix with
Returns
- MMatrix multiplied by a scalar
MMatrix MMatrix::operator+ ( MMatrix const &  obj) const

operator+ - overloads the + operator to add two matrices directly together

Parameters
obj- MMatrix instance to add to the called object MMatrix
Returns
- MMatrix that is a result of two added matrices
MMatrix MMatrix::operator- ( MMatrix const &  obj) const

operator- - overloads the - operator to subtract two matrices directly together

Parameters
obj- MMatrix instance to subtract to the called object MMatrix
Returns
- MMatrix that is a result of two subtracted matrices
MMatrix MMatrix::operator/ ( double const &  scalar) const

operator/ - overloads the / operator to divide a matrix by a scalar

Parameters
scalar- a double value to divide an MMatrix with
Returns
- MMatrix divided by a scalar

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
MMatrix obj 
)
friend

classic friend overloaded ostream operator<< declaration - prints MMatrix properties to stdout in human friendly format

Parameters
os- lhs element [ a.operator<<(b) ], might be std::cout or see return
obj- MMatrix instance
Returns
- os reference for cascading <<

The documentation for this class was generated from the following files: