Added operations for floats
This commit is contained in:
parent
2d2d6afcfb
commit
91348e7c09
17
matrices.h
17
matrices.h
@ -36,7 +36,10 @@ class Matrix{
|
||||
inline Matrix operator+(const Matrix*);
|
||||
inline Matrix operator-(const Matrix*);
|
||||
inline Matrix operator*(const Matrix*);
|
||||
// TODO : Add float parameters for these
|
||||
|
||||
inline Matrix operator+(float);
|
||||
inline Matrix operator-(float);
|
||||
inline Matrix operator*(float);
|
||||
|
||||
// Constructors
|
||||
inline Matrix(int, int);
|
||||
@ -59,6 +62,18 @@ Matrix Matrix::operator*(const Matrix* other){
|
||||
return this->Multiply(other);
|
||||
}
|
||||
|
||||
Matrix Matrix::operator+(float value){
|
||||
return this->Add(value);
|
||||
}
|
||||
|
||||
Matrix Matrix::operator-(float value){
|
||||
return this->Substract(value);
|
||||
}
|
||||
|
||||
Matrix Matrix::operator*(float value){
|
||||
return this->Multiply(value);
|
||||
}
|
||||
|
||||
// Constructs a zero matrix
|
||||
Matrix::Matrix(int rows, int cols){
|
||||
for(int m = 0; m < rows; m++){
|
||||
|
Loading…
x
Reference in New Issue
Block a user