[Fwd: Re: Singular Matrix Invert]
- Subject: [Fwd: Re: Singular Matrix Invert]
- From: Ron Boisvert <boisvert@nist.gov>
- Date: Sun, 28 Sep 2008 19:26:05 -0400
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=ISO-8859-1; format=flowed
- User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
Sender: Wolfram Ruehaak <geowolf@gmx.de>
Subject: Re: Singular Matrix Invert
Dear Dirk,
maybe you can use something like:
if (A.lu().isNonsingular())
this is how I solved my problem with singular matrices.
Kind regards
Wolfram
hunniger schrieb:
> I receive a RuntimeException, whenever a Matrix is Singular, carrying a
> text message, that say. "Matrix si singular.". This is Ok. It is very
> good that it is a runtime exception and not a checked exception, but it
> would be better if it was a SingularMatrixException, that is derived
> from RuntimeException
> , because I can catch this exception in a specific way, that is without
> catching anything else.
>
> So currently I got
>
> try {
> step();
> }
> catch (RuntimeException r) {
> System.out.println(error());
> if (r.getMessage().equals("Matrix is singular.")) {
> for (Variable v:variables) {
> v.value+=0.001*Math.random();
> }
> }
> else {
> throw r;
> }
> }
>
>
> but I would like to have
>
>
> try {
> step();
> }
> catch (SingularMatrixException r) {
> System.out.println(error());
> for (Variable v:variables) {
> v.value+=0.001*Math.random();
> }
> }
>
>
> because not you can change the string "Matrix is singular." to anything
> you like and I don't need to change my code.
>
> Yours Dirk
>
>
>
>
Date Index |
Thread Index |
Problems or questions? Contact list-master@nist.gov