Page 1 of 1

Matrix multiplication

Posted: Mon Jan 16, 2006 10:32 am
by Charles256
Anyone else know how to do matrix multiplication? Trying to make sure I do enough error checking...
Right now I have this output...
First test passed. The number of rows in matrix two does equal the number of columns in matrix one.
The number of columns is the same in the following two rows in matrix 1. Rows 1 and 2.
The number of columns is the same in the following two rows in matrix 1. Rows 2 and 3.
Second test completed on matrix 1. There are an equal number of columns in every row.
The number of columns is the same in the following two rows in matrix 2. Rows 1 and 2.
The number of columns is the same in the following two rows in matrix 2. Rows 2 and 3.
Second test completed on matrix 2. There are an equal number of columns in every row.
Third test passed. All entries in matrix 1 are numeric.
Third test passed. All entries in matrix 2 are numeric.
I think I'm ready to multiply the corresponding entries and make the resulting matrix...Anyone think of anythingelse I need to check?

Re: Matrix multiplication

Posted: Tue Jan 17, 2006 3:20 am
by Grim...
Charles256 wrote:Anyone else know how to do matrix multiplication?
Yeah. I shag Trinity, and get her pregnant ;)

Posted: Tue Jan 17, 2006 10:06 am
by AngusL
That looks right to me... but there could very easily be something I'm missing.

Posted: Tue Jan 17, 2006 11:26 am
by Grim...
Nah, it's pretty simple.

Copulation, conception, creation :D

Re: Matrix multiplication

Posted: Tue Jan 17, 2006 12:13 pm
by foobar
Grim... wrote:
Charles256 wrote:Anyone else know how to do matrix multiplication?
Yeah. I shag Trinity, and get her pregnant ;)
Trinity was a man and you know it! 8O :P

Posted: Tue Jan 17, 2006 12:40 pm
by Ambush Commander
As long as you've got a test case going, just implement the thing already, and add extra checks (supported by the testcase) as the errors come in.

Posted: Tue Jan 17, 2006 12:41 pm
by Charles256
: smacks grim : bad thread hijacking. consider yourself warned ;) either way, I'm almost done with my class(that's right biatches, i wrote a class) for matrix multiplication. will release within the next twenty four hours.. :-D not that it was hard..i actually ended up cheating a bit..but shhh! :-D

Posted: Tue Jan 17, 2006 12:42 pm
by Charles256
actually, i originally wrote it procedurally but in hind sight I saw this was a perfect oppurtinity for some OOP abstraction! :-D