Skip to content

Commit

Permalink
Summing issue fixed
Browse files Browse the repository at this point in the history
jeweells@2dd90a0 commit applied.
  • Loading branch information
pwwiur committed Sep 9, 2018
1 parent e85740a commit 88caa45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dist/Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,18 @@ template<class T, int R = 0, int C = 0> class Matrix{
return *this;
}
template<class S> Matrix operator+ (S x){
Matrix result(this->width, this->height);
for(int i = 0; i < this->width; i++){
for(int j = 0; j < this->height; j++){
Matrix result(this->height, this->width);
for(int i = 0; i < this->height; i++){
for(int j = 0; j < this->width; j++){
result[i][j] = (*this)[i][j] + x;
}
}
return result;
}
Matrix operator+ (Matrix m){
Matrix result(this->width, this->height);
for(int i = 0; i < this->width; i++){
for(int j = 0; j < this->height; j++){
Matrix result(this->height, this->width);
for(int i = 0; i < this->height; i++){
for(int j = 0; j < this->width; j++){
result[i][j] = (*this)[i][j] + m[i][j];
}
}
Expand Down

0 comments on commit 88caa45

Please sign in to comment.