3 #ifndef MATRIX_H_INCLUDED
4 #define MATRIX_H_INCLUDED
45 Matrix(
size_t rows,
size_t cols);
128 const double&
operator()(
size_t row,
size_t col)
const;
Colour operator/(const Colour &colour, double s)
Colour-scalar division.
Definition: Colour.cpp:85
Colour operator+(const Colour &lhs, const Colour &rhs)
Colour addition.
Definition: Colour.cpp:35
Colour operator-(const Colour &lhs, const Colour &rhs)
Colour subtraction.
Definition: Colour.cpp:47
Basic class for matrices.
Definition: Matrix.h:22
std::ostream & operator<<(std::ostream &outputStream, const Matrix &mat)
Stream insertion operator.
Definition: Matrix.cpp:209
Matrix(size_t size=1)
Square Matrix constructor.
Definition: Matrix.cpp:12
Matrix & operator=(const Matrix &mat)
Matrix assignment operator.
Definition: Matrix.cpp:41
Matrix & operator/=(double s)
Matrix-scalar multiplication-assignment operator.
Definition: Matrix.cpp:190
std::istream & operator>>(std::istream &inputStream, Matrix &mat)
Stream extraction operator.
Definition: Matrix.cpp:222
size_t numRows() const
Number of rows in a Matrix.
Definition: Matrix.cpp:93
static Matrix zero(size_t rows, size_t cols)
Factory method for Zero Matrices.
Definition: Matrix.cpp:69
double & operator()(size_t row, size_t col)
Matrix element access.
Definition: Matrix.cpp:81
Matrix operator-() const
Unary minus.
Definition: Matrix.cpp:110
Matrix transpose() const
Matrix transpose.
Definition: Matrix.cpp:198
size_t numElements() const
Number of elements in a Matrix.
Definition: Matrix.cpp:103
friend Matrix operator*(const Matrix &lhs, const Matrix &rhs)
Matrix-Matrix multiplication operator.
Definition: Matrix.cpp:151
size_t cols_
Number of columns in the Matrix.
Definition: Matrix.h:239
Matrix & operator+=(const Matrix &mat)
Matrix addition-assignment operator.
Definition: Matrix.cpp:125
virtual ~Matrix()
Matrix destructor.
Definition: Matrix.cpp:36
std::vector< double > data_
Storage for Matrix data elements.
Definition: Matrix.h:240
Matrix & operator-=(const Matrix &mat)
Matrix subtraction-assignment operator.
Definition: Matrix.cpp:140
Matrix & operator*=(double s)
Matrix-scalar multiplication-assignment operator.
Definition: Matrix.cpp:177
size_t numCols() const
Number of columns in a Matrix.
Definition: Matrix.cpp:98
static Matrix identity(size_t rows, size_t cols)
Factory method for Identity Matrices.
Definition: Matrix.cpp:58
size_t rows_
Number of rows in the Matrix.
Definition: Matrix.h:238