By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,627 Members | 1,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,627 IT Pros & Developers. It's quick & easy.

addtion of matrices

P: 7
hai everyone, i would like someone to help me with a c++ program that adds, subtracts and multiply matrices
Aug 20 '07 #1
Share this Question
Share on Google+
13 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
hai everyone, i would like some to help me with a c++ program that adds, subtracts and multiply matrices
Sure, what do you have so far?
Aug 20 '07 #2

P: 7
Sure, what do you have so far?
im still confused, i only have a program that displays the matrix
Aug 20 '07 #3

sicarie
Expert Mod 2.5K+
P: 4,677
im still confused, i only have a program that displays the matrix
Ok, well, then lets start with just the addition part.

Do you know how you would add two matricies by hand?
Aug 20 '07 #4

P: 7
Ok, well, then lets start with just the addition part.

Do you know how you would add two matricies by hand?
The problem is, i am not doing applied maths or anything that does matrices and i think thats where the problem is
Aug 20 '07 #5

sicarie
Expert Mod 2.5K+
P: 4,677
That's still okay - you can figure this stuff out, you just need to have an idea of what you are doing when you code, or else you're not going to be able to get started.

I approached it this way:

http://www.google.com/search?hl=en&q...=Google+Search

A Google search. So look through those. It seems pretty straightforward.
Aug 20 '07 #6

P: 7
[quote=luvuyo]The problem is, i am not doing applied maths or anything that does matrices and i think thats where the problem is
so, will you please help me
Aug 20 '07 #7

sicarie
Expert Mod 2.5K+
P: 4,677
The problem is, i am not doing applied maths or anything that does matrices and i think thats where the problem is
so, will you please help me
That's what I'm trying to do. Did you look through those links and do you understand how to do matrix addition? Next we have to build an algorithm, and then you can code. But it starts with you understanding how matrix addition works. Then once we do that, you can do the subtraction and multiplication on your own.
Aug 20 '07 #8

P: 7
Ok, well, then lets start with just the addition part.

Do you know how you would add two matricies by hand?
The problem is, i am not doing applied maths or anything that does matrices and i think thats where the problem is
Aug 20 '07 #9

sicarie
Expert Mod 2.5K+
P: 4,677
That's still okay - you can figure this stuff out, you just need to have an idea of what you are doing when you code, or else you're not going to be able to get started.

I approached it this way:

http://www.google.com/search?hl=en&q...=Google+Search

A Google search. So look through those. It seems pretty straightforward.
Click on the link. Read a few of the returns about matrix multiplication. If you can do regular multiplication, you can do matrix multiplication.
Aug 20 '07 #10

P: 7
now i understand the addition part, but still no idea of writing a code that adds the matrices
Aug 20 '07 #11

sicarie
Expert Mod 2.5K+
P: 4,677
now i understand the addition part, but still no idea of writing a code that adds the matrices
We're building up to that. You can't just jump in and start coding - that gets you lost. It's like traveling, you need a map. Sometimes you can just take off and end up in the right place, but you're likely to make a few wrong turns, and not end up where you wanted to go.

So, our "map" is our algorithm. Are the matricies you are going to be working with of a fixed size? (ie always going to be 4x4 or 5x5) Or are they going to change?
Aug 20 '07 #12

P: 7
We're building up to that. You can't just jump in and start coding - that gets you lost. It's like traveling, you need a map. Sometimes you can just take off and end up in the right place, but you're likely to make a few wrong turns, and not end up where you wanted to go.

So, our "map" is our algorithm. Are the matricies you are going to be working with of a fixed size? (ie always going to be 4x4 or 5x5) Or are they going to change?
They are going to changes sir
Aug 20 '07 #13

sicarie
Expert Mod 2.5K+
P: 4,677
They are going to changes sir
Ok, do you know how they will be read in? Will they be passed in an array, read from a file, entered in command line, etc...?
Aug 20 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.