Ray Tracer  2020
Functions
Matrix.cpp File Reference

Matrix class implementation file. More...

#include "Matrix.h"
#include <algorithm>
#include <assert.h>

Detailed Description

Matrix class implementation file.

Function Documentation

◆ operator*() [1/3]

Matrix operator* ( const Matrix lhs,
const Matrix rhs 
)
related

This creates the product of two Matrices. The first Matrix must have the same number of columns as the second Matrix has rows.

Note that multiplication is declared as a friend. It could be declared as a normal method Matrix operator*(const Matrix& rhs);. The friend form provides a more symmetric view of the two Matrices being multiplied. It could also be defined in terms of a *= operator, but it is not clear whether A *= B; means A = A*B or A = B*A. So this is omitted to avoid confusion.

Parameters
lhsThe Matrix on the left hand side of the *.
rhsThe Matrix on the right hand side of the *.
Returns
The Matrix formed by lhs * rhs.

◆ operator*() [2/3]

Matrix operator* ( const Matrix mat,
double  s 
)
related

◆ operator*() [3/3]

Matrix operator* ( double  s,
const Matrix mat 
)
related

◆ operator+()

Matrix operator+ ( const Matrix lhs,
const Matrix rhs 
)
related

◆ operator-()

Matrix operator- ( const Matrix lhs,
const Matrix rhs 
)
related

◆ operator/()

Matrix operator/ ( const Matrix mat,
double  s 
)
related

◆ operator<<()

std::ostream& operator<< ( std::ostream &  outputStream,
const Matrix mat 
)
related

◆ operator>>()

std::istream& operator>> ( std::istream &  inputStream,
Matrix mat 
)
related