Howdy,
If there some means to test whether a square matrix is invertible, rather
than trying Invert[] and having it fail?
I'm working on a notebook that's searching through randomly generated
matrices, looking for one for which the inverse has certain properties.
Thus inside my search function I have a loop something like this:
While [... some condition ,
t = ... create a matrix ;
q = Inverse[t] ;
... perform some computation using the entries in q
to determine if the exit condition will be met
];
But if t is singular, computing the inverse fails. Nevertheless my loop
keeps running for a while, but generates a few more annoying messages
(because access to q fails) before it finally quits.
What I would rather do is something like this:
While [... some condition ,
t = ... create a matrix ;
If [ t is singular, Continue[]];
q = ... inverse of matrix ;
... perform some computation using the entries in q
to determine if the exit condition will be met
];
But looking through the mathematica book, I haven't come across a way to do
that. I also considered that Inverse[] would have some means for me to tell
it how to handle the failure condition, but I don't see anything in the book
about that.
Thanks in advance for any help,
Bob H
Lawrenceville, GA