commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject [Math] "NonPositiveDefiniteMatrixException" message and meaning
Date Thu, 08 Sep 2011 13:30:24 GMT
Hi.

In revision 1166674, I've added an argument to that exception so that it can
print the value that failed the test.
However, I also wonder whether the message should not be
---CUT---
  not positive definite matrix: diagonal element at ({1},{1}) is not strictly larger than
{2} ({0})"
---CUT---
instead of the current
---CUT---
  not positive definite matrix: diagonal element at ({1},{1}) is smaller than {2} ({0})
---CUT---

In a class where the exceptionmay be thrown ("CholeskyDecompositionImpl"), the
test is (at line 128):
---CUT---
  ltI[i] < absolutePositivityThreshold
---CUT---
Which will *not* fail if "absolutePositivityThreshold" is zero.

Changing it to
---CUT---
  ltI[i] <= absolutePositivityThreshold
---CUT---
would allow to set the threshold to "0" exactly, for those cases where one
wants to avoid raising an exception (like where the matrix assumed to be
positive definite), but nevertheless wants to retain a basic fool-proof
check.


Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message