[ot?] matrix inversion

T

Tom St Denis

Mark McIntyre said:
Anyone who's too lazy to spell correctly is quite possibly also going
to have a problem turning out quality code. IMHO, YMMV.

I don't see the correlation. I spend more time coding/writing [say user
manuals, textbooks, replies to email] than I do on individual usenet posts.

Tom
 
T

Tom St Denis

Sidney Cadot said:
If you think that an understanding of high school algebra suffices for
implementing a decent-quality floating point matrix inverter, you are
sadly, sadly mistaken.

How so? You basically pivot the largest value in a column up and then
reduce each row of that given column. Append I to the right and voila
inverse [provided you finish the RREF]. Sure that may not be the fastest
solution but it's guaranteed to work and minimize the error [provided I'm
recalling RREF correctly].

Maybe your high school algebra class just sucked?

Tom
 
T

Tom St Denis

Joona I Palaste said:
Ben Pfaff said:
Joona I Palaste said:
CBFalconer <[email protected]> scribbled the following:
[regarding Tom St. Denis]
I believe him to be a pubescent teenager from Ottawa, Canada with
a severe civility disorder.

Why specifically from Ottawa, Canada?

Hmm, I wasn't aware of that. Well, that's not *conclusive* evidence -
even assuming the author of that web page speaks the truth (which he
has no real reason not to, but still), it might not be the same Tom
St Denis. *I* believe it is - but I won't jump to conclusions based
on my beliefs.

While that page is out of date [LibTomCrypt is at http://libtomcrypt.org
now...] and I'm in semester six, the rest seems about right.

Including my full postal address and phone number.

Tom
 
S

Sidney Cadot

Tom said:
If you think that an understanding of high school algebra suffices for
implementing a decent-quality floating point matrix inverter, you are
sadly, sadly mistaken.


How so? You basically pivot the largest value in a column up and then
reduce each row of that given column. Append I to the right and voila
inverse [provided you finish the RREF]. Sure that may not be the fastest
solution but it's guaranteed to work and minimize the error [provided I'm
recalling RREF correctly].

This algorithm outline doesn't consider artefacts due to limited
floating point precision, badly conditioned matrices, and the
interaction between these two phenomena. Your wording suggests you
didn't consider this.

"It's guaranteed to work" -- well, with infinite precision numbers:
yes. With finite precision floats, it is already quite a challenge to
come up with a decent definition of when such an algorithm can be said
to "work".

"minimize /the/ error" -- what error? Given a FP matrix M, an inversion
algorithm inv, and Minv = inv(M), what is the error measure you speak about?
Maybe your high school algebra class just sucked?

If thinking this allows your self-image to go unscathed, be my guest.

To me you just sound like somebody who thinks gaussian elimination is a
neat idea (very right) and thinks that's the end of the story as far as
numerical matrix inversion is concerned (very wrong). I recommend a
visit to a well-stocked university library to spend a humbling afternoon.

All this is much off-topic of course. Apologies to everybody for that.

Best regards,

Sidney
 
T

Tom St Denis

Sidney Cadot said:
This algorithm outline doesn't consider artefacts due to limited
floating point precision, badly conditioned matrices, and the
interaction between these two phenomena. Your wording suggests you
didn't consider this.

Well I did but I didn't go into full details. In a class called "Numerical
Analysis" at my college we actually study this problem and our required to
give the error estimate along with the results.
"It's guaranteed to work" -- well, with infinite precision numbers:
yes. With finite precision floats, it is already quite a challenge to
come up with a decent definition of when such an algorithm can be said
to "work".

"minimize /the/ error" -- what error? Given a FP matrix M, an inversion
algorithm inv, and Minv = inv(M), what is the error measure you speak
about?

In general by pivoting the largest value upwards you help minimize the
error. I wasn't trying to give the guy the best possible answer. I was
just showing that a basic solution [that will work 99% of the time] is
trivial to code.
If thinking this allows your self-image to go unscathed, be my guest.

To me you just sound like somebody who thinks gaussian elimination is a
neat idea (very right) and thinks that's the end of the story as far as
numerical matrix inversion is concerned (very wrong). I recommend a
visit to a well-stocked university library to spend a humbling afternoon.

Then you'd be wrong. The point is though that an ideal inversion [which I
had to write for college] and the one I described are not far off. Also
you're always going to have error. The idea is for well conditioned inputs
the inverse shall be precise.

Tom
 
M

Morris Dovey

Tom said:
Yeah that would be best..... so you don't have todo YOUR OWN
HOMEWORK!!!

****, if you can't right a RREF function you have no business
writing software at all...

Hmm. Having a bad day, Tom? Your response is a candidate for
"Rudest response ever on comp.lang.c"

I majored in math, enjoyed linear algebra, and haven't inverted a
matrix in more than 40 years. At this point I wouldn't consider
writing a program to do so without digging out one of my old
textbooks and doing intensive review.

Astonishingly, I've been writing software for /very/ happy
employers and clients (which list includes the college where I
/studied/ math, NASA, NSA, a bunch of Fortune 500 firms, and one
stock exchange) for the entire 40+ year period. To bring it a bit
closer, I helped design, write, and debug the first drivers for
at least one (and very possibly two) of the devices in the
machine you used to write that response. Are you really saying
that I had no business doing so? [If "yes", consider yourself
invited to eschew Winchester-derivative hard drives and floppy
drives for the remainder of your career.]

You might find it helpful to pretend that the person to whom
you're responding is in the same room with you, is 2+m tall, has
a black belt, masses a trim 100kg, and is also having a bad day.
 
T

Tom St Denis

Morris Dovey said:
Hmm. Having a bad day, Tom? Your response is a candidate for
"Rudest response ever on comp.lang.c"

I majored in math, enjoyed linear algebra, and haven't inverted a
matrix in more than 40 years. At this point I wouldn't consider
writing a program to do so without digging out one of my old
textbooks and doing intensive review.

Astonishingly, I've been writing software for /very/ happy
employers and clients (which list includes the college where I
/studied/ math, NASA, NSA, a bunch of Fortune 500 firms, and one
stock exchange) for the entire 40+ year period. To bring it a bit
closer, I helped design, write, and debug the first drivers for
at least one (and very possibly two) of the devices in the
machine you used to write that response. Are you really saying
that I had no business doing so? [If "yes", consider yourself
invited to eschew Winchester-derivative hard drives and floppy
drives for the remainder of your career.]

I'd say you should know your math or know how to access math before you
write software. Your personal position alongside history aside these rules
apply to everyone. Being capable of engineering something [buildings,
vehicles, software, etc] isn't as much a matter of memorization as a matter
of knowing enough and knowing how to find stuff too.

Heck I have TAOCP and other texts at arms length too. You don't see me
posting every 20 minutes on how todo this that or the otherthing.

As for the general question at hand. Assuming the guy wanted something to
start from a straightforward RREF is a good place to start. If his code was
going to be plugged into a system at NASA or something, heaven help us all
because people will die...
You might find it helpful to pretend that the person to whom
you're responding is in the same room with you, is 2+m tall, has
a black belt, masses a trim 100kg, and is also having a bad day.

Given that I'm a fairly hefty 2m tall person myself I wouldn't feel that
much intimidated. That being said, I have something called conviction. I
actually believe, get this... you'll love it, that academia is a worthwhile
pursuit and that people who trivialize it (e.g. average college student) are
making a mockery of what it is to learn. You don't know something you
research, you hypothesize, etc. You don't just ask someone else to answer
for you.

If the dude was really not a student then he's still lame since google is a
click away [and probably faster]. If the guy was a student then shame on
him. It's people like him that get A+ while I get C+ [since I actually do
the work and actually do other stuff on the side] then go on thinking
they're professional...

Tom
 
J

Joona I Palaste

Tom St Denis said:
Morris Dovey said:
Hmm. Having a bad day, Tom? Your response is a candidate for
"Rudest response ever on comp.lang.c"

I majored in math, enjoyed linear algebra, and haven't inverted a
matrix in more than 40 years. At this point I wouldn't consider
writing a program to do so without digging out one of my old
textbooks and doing intensive review.

Astonishingly, I've been writing software for /very/ happy
employers and clients (which list includes the college where I
/studied/ math, NASA, NSA, a bunch of Fortune 500 firms, and one
stock exchange) for the entire 40+ year period. To bring it a bit
closer, I helped design, write, and debug the first drivers for
at least one (and very possibly two) of the devices in the
machine you used to write that response. Are you really saying
that I had no business doing so? [If "yes", consider yourself
invited to eschew Winchester-derivative hard drives and floppy
drives for the remainder of your career.]
I'd say you should know your math or know how to access math before you
write software. Your personal position alongside history aside these rules
apply to everyone. Being capable of engineering something [buildings,
vehicles, software, etc] isn't as much a matter of memorization as a matter
of knowing enough and knowing how to find stuff too.

Tom, do you still think all the world is mathematical software? I,
for one, see engineering skills and good conception of abstraction as
*much* more important than mathematics. I am majoring at Computer
Science, and the Mathematics majors I've talked to (some of them almost
finished with their Master's theses) have no idea of the concepts that
are pretty much routine to a software engineer of my experience level.
Likewise the stuff they talk about in their Master's theses goes way
over my head.
 
D

Dan Pop

In said:
No egos around here :) The threat is rather pointless, however I
consider PLONK announcements useful in that they encourage others
to co-PLONK.

Any hard evidence of that? Do the c.l.c readers have sheep genes?
If I were to plonk someone, I would do it exclusively for my own reasons.
The end result is that the PLONKee is ignored, and
sometimes goes away.

Wishful thinking. The plonkers still get to read everything, from the
replies coming from the non-plonked people.

The only useful efect of plonking is that you're presented with a
slightly smaller number of articles, when reading the newsgroup. Unless
you read everything available, it doesn't make any practical difference.

Dan
 
J

Joona I Palaste

Non sequitur. What *you* care about is irrelevant here.

No it's not a non sequitur. I might have other reasons for killfiling
him than him caring about being killfiled by me.
 
S

Sidney Cadot

Tom said:
Well I did but I didn't go into full details. In a class called "Numerical
Analysis" at my college we actually study this problem and our required to
give the error estimate along with the results.

/what/ error estimate?

Given M (a priori) and Minv (calculated), you'd ideally have M.Minv==I,
and you won't get there in practice. Implementing a quality matrix
inverter is not so much about just getting an Minv (that's easy by a
number of methods); rather, the challenge is to provide an algorithm
that has provable properties about the relation between M and Minv.

That's something different than a bit of handwaving concerning partial
pivoting, you know.
about?

In general by pivoting the largest value upwards you help minimize the
error.

"the" error? What error?
I wasn't trying to give the guy the best possible answer.
Obviously.

I was just showing that a basic solution [that will work 99% of the time] is
trivial to code.

You mean 99% of the time for the 5x5 matrices you used for testing, I
guess. Now you tell me how that 'knowledge' extrapolates to real-life
problems where you need to solve 100,000 equations, with guaranteed
reliability.
Then you'd be wrong.

"Then..." what does this refer to?
> The point is though that an ideal inversion [which I
had to write for college] and the one I described are not far off. Also
you're always going to have error. The idea is for well conditioned inputs
the inverse shall be precise.

What's "precise" ? For someone talking big about numerics, you're
awfully vague.

And of course, the well-conditioned case is not that interesting. The
real challenge is to make an algorithm that performs well for badly
conditioned systems. These are very important in practice, although you
would probably prefer to just ignore them.

Regards,
Sidney
 
T

Tom St Denis

Sidney Cadot said:
What's "precise" ? For someone talking big about numerics, you're
awfully vague.

And of course, the well-conditioned case is not that interesting. The
real challenge is to make an algorithm that performs well for badly
conditioned systems. These are very important in practice, although you
would probably prefer to just ignore them.

You seem to forget I'm not the one asking about how to invert a matrix. I'm
not going todo all the work for the OP when if they really wanted to they
could find good source on the net.

And what "error", well the error that comes from the finite size of the
floating point variables. The error that comes from ill-conditioned
matrices, etc, etc.

I think you're just using any excuse to flame me and personally I don't
really care as I wasn't the person asking in the first place.

Tom
 
T

Tom St Denis

Joona I Palaste said:
Tom, do you still think all the world is mathematical software? I,
for one, see engineering skills and good conception of abstraction as
*much* more important than mathematics. I am majoring at Computer
Science, and the Mathematics majors I've talked to (some of them almost
finished with their Master's theses) have no idea of the concepts that
are pretty much routine to a software engineer of my experience level.
Likewise the stuff they talk about in their Master's theses goes way
over my head.

Um quite a few branches of CS require some knowledge of math. Grahpics,
Sound, Communication, etc... all need some form of math of another.

Sure you don't need to know the number of folds on a hyper-geodesic cube in
jacobian planes [I'm making this up] but knowing algebra/calculus is I think
at least a prerequisit to call yourself a computer scientist. Unless you
want to narrow your focus so horribly that when you graduate from school
you're as useless to humanity as the day you started university.

Tom
 
C

Christopher Benson-Manica

Sidney Cadot said:
Anyway, most here can probably stomach a spelling mistake or two, but
the faul language was certainly uncalled for. If I want any of that I'll
^^^^
I do hope this was intentional, or I may just die laughing at the
irony ;)
 
S

Sidney Cadot

Tom said:
You seem to forget I'm not the one asking about how to invert a matrix. I'm
not going todo all the work for the OP when if they really wanted to they
could find good source on the net.

Fine by me, if you'd have left it at that. Instead you went on to imply
that any person with a cursory background in mathematics should be able
to write such a routine by him/herself. Only if your understanding of
the subject is superficial would you make such an outrageous claim.
And what "error", well the error that comes from the finite size of the
floating point variables. The error that comes from ill-conditioned
matrices, etc, etc.

Well, it doesn't get any more vague than this, does it.
I think you're just using any excuse to flame me and personally I don't
really care as I wasn't the person asking in the first place.

You were suggesting that a cursory knowledge of high-school level
algebra would suffice to write a floating-point matrix inversion routine
of acceptable quality.

Nonsense like that needs to be answered. If you interpret that as a
personal flame, it sure is somebody's problem - but not mine.

Regards, Sidney
 
D

Dan Pop

In said:
No it's not a non sequitur. I might have other reasons for killfiling
him than him caring about being killfiled by me.

It is a non sequitur, because I was talking about your "threatening" post
not about your reasons for killfiling him. There is no other way of
plausibly explaining your post.

Dan
 
R

Randy Howard

You seem to forget I'm not the one asking about how to invert a matrix.

No, you've just hijacked the thread from the OP so well that it's all
but forgotten.
I'm not going todo all the work for the OP when if they really wanted
to they could find good source on the net.

Which, IIRC, is exactly what the OP asked for pointers to here. To which,
you flamed away and started cursing the OP and the educators responsible
for whatever ills you could imagine during grade school.
I think you're just using any excuse to flame me

Hypocrisy rears its ugly head again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top