Commit b4b6fc6b authored by Eric Phipps's avatar Eric Phipps
Browse files

NOX: Fix possible overflow when computing matrix size in NOX::LAPACK::Matrix.

parent 98de7d37
......@@ -72,7 +72,9 @@ namespace NOX {
Matrix() : p(0), q(0), entries() {}
//! Create a m x n matrix with all entries zero
Matrix(int m, int n) : p(m), q(n), entries(m*n) {}
Matrix(int m, int n) :
// Compute size as size_t to avoid overflow for large matrices.
p(m), q(n), entries(size_t(m)*size_t(n)) {}
//! Copy constructor
Matrix(const Matrix& a) :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment