473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

programming my c++ matrix

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

Jul 19 '07 #1
2 1752
On 2007-07-19 10:26, sarah wrote:
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
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
Jul 19 '07 #2
sarah wrote:
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
Jul 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Roman Suzi | last post by:
Hi, I wonder, does Python support generic programming paradigm, and to what extent (I guess, it doesn't do it in full)? And (or) does it move in that direction? Will we ever see concept...
6
by: Ben Ingram | last post by:
Hi all, I am writing a template matrix class in which the template parameters are the number of rows and number of columns. There are a number of reasons why this is an appropriate tradeoff for...
5
by: Jason | last post by:
Hello. I am trying to learn how operator overloading works so I wrote a simple class to help me practice. I understand the basic opertoar overload like + - / *, but when I try to overload more...
4
by: Leslaw Bieniasz | last post by:
Cracow, 20.10.2004 Hello, As far as I understand, the generic programming basically consists in using templates for achieving a static polymorphism of the various code fragments, and their...
16
by: E. Robert Tisdale | last post by:
C++ Programming Style Guidelines http://geosoft.no/development/cppstyle.html I think that these guidelines are almost *all* wrong. For example: 11. Private class variables should have...
1
by: Scott Chang | last post by:
Hi All I tried to use the attached OpenGL code to draw a Star-shaped figure on my Microsoft Visual C++ .NET 2002-Windows XP Pro PC. When I did 'Build' in Debug Mode, I got an error C2065:...
18
by: Jedora | last post by:
Hi all, I want to write a C program to compute eigenvalues and eigenvectors. But the matrix is a complex matrix which has all complex numbers. Like this: 5.8751 5.8774 + 1.5423i ...
3
by: sarahdiginets | last post by:
can any one help me doing my c++ matrix programming please
0
by: Gary Herron | last post by:
A. Joseph wrote: Your question was completely understandable, but so incredibly vague as to be a waste of bandwidth to send and a waste of time to answer. What kind of matrix programming do...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.