commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Brisard <>
Subject Re: [math] Consistent use of ExceptionContext [was "using the ExceptionContext facility"]
Date Mon, 29 Aug 2011 06:56:54 GMT
Hello everyone,
Looking at the present hierarchy of exceptions, I've had some further
thoughts, actually supporting the use of context rather than property
getters. Sticking with the same example, we have two exceptions
- NonPositiveDefiniteMatrixException: already implemented
- NonPositiveDefiniteLinearOperatorException: work in progress.
These two exceptions refer to the same mathematical concept, and the
former should probably extend the latter (just like AbstractRealMatrix
extends RealLinearOperator). However, these two exceptions are thrown
under quite different circumstances, with widely different parameters:
- If I understood correctly, NonPositiveDefiniteMatrixException is
thrown for example when a non-positive diagonal element is met,
- NonPositiveDefiniteLinearOperator is to be thrown when a *vector* x
is met, such as x'.a.x <= 0 (the entries of the operator as a matrix
are not accessible).
As you can see, the parameters of these exceptions will be different.
We could have a getOffendingOperator() method, but probably not a
getOffendingVector() method (since NonPositiveDefiniteMatrixException
has no offending vector in its state).

Does that make sense?

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message