Connecting Tech Pros Worldwide Forums | Help | Site Map

programming my c++ matrix

sarah
Guest
 
Posts: n/a
#1: Jul 19 '07
hi all
I'm trying to program a c++ matrix. can anybody help me?
how can i attach the file to be programmed with this post?
sarah


=?ISO-8859-1?Q?Erik_Wikstr=F6m?=
Guest
 
Posts: n/a
#2: Jul 19 '07

re: programming my c++ matrix


On 2007-07-19 10:26, sarah wrote:
Quote:
hi all
I'm trying to program a c++ matrix. can anybody help me?
Possibly, if you tell us what you are trying to do and why it does not
work. The FAQ also has a section about operator-overloadinf for matrices
that might be of interest:
http://www.parashift.com/c++-faq-lit...html#faq-13.10
Quote:
how can i attach the file to be programmed with this post?
For help on using your news-client you have to post in a forum for your
news-client, notice thought that we don't accept attachments in this
group, if you want to post code you should paste it in the message.
However make sure to read the FAQ about how to post questions before you
do: http://www.parashift.com/c++-faq-lit...t.html#faq-5.8

--
Erik Wikström
Kai-Uwe Bux
Guest
 
Posts: n/a
#3: Jul 19 '07

re: programming my c++ matrix


sarah wrote:
Quote:
I'm trying to program a c++ matrix. can anybody help me?
Don't do this unless you are going for the educational experience. There are
many matrix libraries out there that you can use. It's by and large a waste
of resources to redo this. Also, it is _very_ hard to come up that can
compete with what is out there.

If you want to do this just because you want to learn, by all means, go
ahead. Start by writing some specs. Things to consider:

a) Do you want a linear algebra class or just a 2D-array like data
structure? (I will assume linear algebra from now on.)

b) Do you want a template or should it be just doubles?

c) Make a list of algorithms that you need to support eventually, e.g.:
- coefficient access
- operator<< and operator>>
- +, -, *
- row-reduction
- inversion
- block-matrix composition, extraction
- determinant
- transpose
- row/column extractors
(in this case, you should consider a companion class for vectors)

Before even starting to code your matrix class, write some test code, say
for operator<< and operator>>. Then implement your matrix class and make it
pass the tests.

Now add test code for addition. Implement addition in your class and make it
pass the test.

Go down your list and write some tests and then make your implementation
pass those tests.


If you run into problems, post a more specific question.

Quote:
how can i attach the file to be programmed with this post?
Code to be discusses is just text and goes directly into the post.
Attachments are not needed.



Best

Kai-Uwe Bux
Closed Thread