[ 
https://issues.apache.org/jira/browse/MATH-1044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13806480#comment-13806480
 ] 

Thomas Neidhart commented on MATH-1044:
---------------------------------------

In general it good, but I would still advertise the SingularMatrixException in 
the DecompositionSolver interface with a @throws clause.
For each decomposition, I would specify if it can compute a pseudo-inverse or 
will throw an exception in case of a singular matrix.

The reason being that a user might just use an interface and may not know 
explicitly the used implementation, thus must protect itself against anything 
that can happen, including the SingularMatrixException.

btw. I would also add the specific inverse behavior, as mentioned before, to 
the class javadoc of each decomposition, as this one will be more often read as 
the one from the embedded DecompositionSolver imho.

> Clarify and fix javadoc of DecompositionSolver.getInverse() and 
> implementations
> -------------------------------------------------------------------------------
>
>                 Key: MATH-1044
>                 URL: https://issues.apache.org/jira/browse/MATH-1044
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.2
>            Reporter: Sean Owen
>            Priority: Minor
>              Labels: decomposition, inverse, singular, solver
>         Attachments: MATH-1044.patch
>
>
> As suggested by Phil on the mailing list, I'm providing a patch to the 
> javadoc of DecompositionSolver.getInverse() to clarify what it does. It also 
> correctly moves the "@throws SingularMatrixException" to implementations that 
> do throw this exception; not all do.
> Tests already cover most of the behavior asserted by the documentation. I 
> added one to show that the SVD does not reject singular matrices. There 
> should be a test for EigenDecomposition here too, but in the course of adding 
> it I found another apparent small bug in its behavior with singular matrices. 
> So I will provide that separately (it actually involves no doc changes, and 
> docs are the topic here.)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to