Skip to content

El::limits::Lowest<El::BigFloat>() returns 0 instead of the largest negative value

El::Max(const El::Matrix<El::BigFloat>&) returns wrong result.

Example:

#include <El.hpp>
#include <cassert>
void test()
{
  El::Matrix<El::BigFloat> matrix(1, 1);
  matrix(0, 0) = El::BigFloat(-1);
  auto max = El::Max(matrix);  
  El::Print(matrix, "matrix:");
  El::Output("\nEl::Max(matrix) = ", max);
  assert(max == matrix(0, 0));
}

Output:

matrix:
-1
El::Max(matrix) = 0
void test(): Assertion `max == matrix(0, 0)' failed.
Edited by Vasiliy Dommes