Skip to content

Commit 31ee4a9

Browse files
authored
Bug in MatrixEnumerator
Matrix index should be less than (column * row) instead of (column + row)
1 parent 8842299 commit 31ee4a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SharpMath/Geometry/MatrixEnumerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void Dispose()
2626
public bool MoveNext()
2727
{
2828
_index++;
29-
return _index < _matrix.ColumnCount + _matrix.RowCount;
29+
return _index < _matrix.ColumnCount * _matrix.RowCount;
3030
}
3131

3232
public void Reset()
@@ -36,4 +36,4 @@ public void Reset()
3636

3737
public double Current => _matrix[(uint) _index % _matrix.ColumnCount, (uint) _index / _matrix.RowCount];
3838
}
39-
}
39+
}

0 commit comments

Comments
 (0)