[SciPy-user] most negative eigenvalue

Stefan van der Walt stefan at sun.ac.za
Tue Aug 28 12:20:11 EDT 2007


On Tue, Aug 28, 2007 at 04:57:01PM +0300, dmitrey wrote:
> Yes, I already use
> try:
>   cholesky(A)
> except:
>   ...
> but it makes impossible to use debugger, that is very bad.

Blind catches are dangerous.  How about

try:
    cholesky(A)
except LinAlgError:
    ...

or

try:
    cholesky(A)
except LinAlgError,e:
    if not 'positive definite' in e.message: raise e

    ...

Cheers
Stéfan



More information about the SciPy-User mailing list