[Fwd: Singular Matrix Invert]
- Subject: [Fwd: Singular Matrix Invert]
- From: Ron Boisvert <boisvert@nist.gov>
- Date: Sun, 28 Sep 2008 15:40:41 -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: do_not_reply_to_this_address@t-online.de (hunniger)
Subject: Singular Matrix Invert
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