[SciPy-user] most negative eigenvalue

Stefan van der Walt stefan@sun.ac...
Tue Aug 28 11:20:11 CDT 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