Browse Source

Correct a few indexing copy/paste errors that likely previously only functioned properly on square matrices.

master
mcsauder 9 years ago
parent
commit
46c83a8c18
  1. 6
      matrix/Matrix.hpp

6
matrix/Matrix.hpp

@ -407,7 +407,7 @@ public: @@ -407,7 +407,7 @@ public:
{
Matrix<Type, M, N> r;
for (size_t i=0; i<M; i++) {
for (size_t j=0; j<M; j++) {
for (size_t j=0; j<N; j++) {
r(i,j) = Type(fabs((*this)(i,j)));
}
}
@ -418,7 +418,7 @@ public: @@ -418,7 +418,7 @@ public:
{
Type max_val = (*this)(0,0);
for (size_t i=0; i<M; i++) {
for (size_t j=0; j<M; j++) {
for (size_t j=0; j<N; j++) {
Type val = (*this)(i,j);
if (val > max_val) {
max_val = val;
@ -432,7 +432,7 @@ public: @@ -432,7 +432,7 @@ public:
{
Type min_val = (*this)(0,0);
for (size_t i=0; i<M; i++) {
for (size_t j=0; j<M; j++) {
for (size_t j=0; j<N; j++) {
Type val = (*this)(i,j);
if (val < min_val) {
min_val = val;

Loading…
Cancel
Save