Matrix multiplication

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Matrix multiplication

Post 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?
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Re: Matrix multiplication

Post by Grim... »

Charles256 wrote:Anyone else know how to do matrix multiplication?
Yeah. I shag Trinity, and get her pregnant ;)
AngusL
Forum Contributor
Posts: 155
Joined: Fri Aug 20, 2004 4:28 am
Location: Falkirk, Scotland

Post by AngusL »

That looks right to me... but there could very easily be something I'm missing.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Nah, it's pretty simple.

Copulation, conception, creation :D
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Re: Matrix multiplication

Post 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
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post 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.
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post 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
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

actually, i originally wrote it procedurally but in hind sight I saw this was a perfect oppurtinity for some OOP abstraction! :-D
Post Reply