[Date Index]
[Thread Index]
[Author Index]
Testing for invertible matrix
*To*: mathgroup at smc.vnet.net
*Subject*: [mg39676] Testing for invertible matrix
*From*: Bob Harris <NspamITmeLION at MINDnotSPRING.COM>
*Date*: Sat, 1 Mar 2003 02:48:33 -0500 (EST)
*Sender*: owner-wri-mathgroup at wolfram.com
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
Prev by Date:
**Re: visualizing Map, Thread, Apply, etc.**
Next by Date:
**Re: density plot**
Previous by thread:
**Re: Re: visualizing Map, Thread, Apply, etc.**
Next by thread:
**Re: Testing for invertible matrix**
| |