programming my c++ matrix

S

sarah

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?=

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-lite/operator-overloading.html#faq-13.10
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-lite/how-to-post.html#faq-5.8
 
K

Kai-Uwe Bux

sarah said:
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.

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
 

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
474,291
Messages
2,571,453
Members
48,132
Latest member
AnneHarpur

Latest Threads

Top