Compare commits
No commits in common. "fba09a5c402637099ff3ff0069f07c9532229f80" and "91348e7c099266e649ec1847f855630178d6cc07" have entirely different histories.
fba09a5c40
...
91348e7c09
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,3 @@
|
|||||||
build/*
|
build/*
|
||||||
.vscode/*
|
.vscode/*
|
||||||
main.cpp
|
main.cpp
|
||||||
main.exe
|
|
13
matrices.h
13
matrices.h
@ -27,8 +27,6 @@ class Matrix{
|
|||||||
inline Matrix Substract(float);
|
inline Matrix Substract(float);
|
||||||
inline Matrix Substract(const Matrix*);
|
inline Matrix Substract(const Matrix*);
|
||||||
|
|
||||||
inline Matrix Function(float (*f)(float));
|
|
||||||
|
|
||||||
inline void Print(std::string_view);
|
inline void Print(std::string_view);
|
||||||
|
|
||||||
inline Matrix Transpose();
|
inline Matrix Transpose();
|
||||||
@ -76,17 +74,6 @@ Matrix Matrix::operator*(float value){
|
|||||||
return this->Multiply(value);
|
return this->Multiply(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix Matrix::Function(float (*f)(float)){
|
|
||||||
Matrix result = this;
|
|
||||||
for(int m = 0; m < result.values.size(); m++){
|
|
||||||
for(int n = 0; n < result.values[m].size(); n++){
|
|
||||||
// Execute function on every value
|
|
||||||
result.values[m][n] = f(result.values[m][n]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constructs a zero matrix
|
// Constructs a zero matrix
|
||||||
Matrix::Matrix(int rows, int cols){
|
Matrix::Matrix(int rows, int cols){
|
||||||
for(int m = 0; m < rows; m++){
|
for(int m = 0; m < rows; m++){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user