# Matrices...

• 10-15-2003
gcn_zelda
Matrices...
For anybody here who's taken Algebra II or higher or knows about matrices:

Is there any way to use matrices in C++?

Maybe

[code]
matrix a = {3 4 5}{6 7 8}{9 10 11};
matrix b = {1 2 3}{4 5 6}{7 8 9};
matrix c;

c = a*b;

or something?

possible?
• 10-15-2003
Dante Shamest
Multidimensional arrays would be a good idea.
• 10-15-2003
agony
it is posible to use matrices ( more dimensional arrays ) but u ll have to tell the compiler how to add them togather (not only that, every single matrix calculation form - and there are many as you know) .... if u need help with maths i would recommend maple 7 ( great program, matrix , laplace transf., furier theorems and so on - very easy to use ) ... try it out ( i ll check out how you calculate matrix in ms visual and write back .... but again try maple 7 first )
• 10-15-2003
gcn_zelda
I was thinking about that, but that would mean more work for me, and I'm lazy :P

Well, I guess I'm stuck with Multi-D Arrays...
• 10-15-2003
gcn_zelda
And my program's done. I found a way to do it w/o arrays. I was making a 3D Systems of Equations program thing. Now I can cheat in math class :P
• 10-15-2003
JaWiB
There is a way! Although I've not used them (yet...) they are called Valarrays, and "The C++ Standard Library" says:

Quote:

The C++ standard library provides the class valarray for the processing of arrays of numeric values. A valarray is a representation of the mathematical concept of a linear sequence of values. It has one dimension, but you can get the illusion of higher dimensionality by special techniques of computed indices and powerful subsetting capabilities. Therefore, a valarray can be used as a base both for vector and matrix operations as well as for the processing of mathematical systems of polynomial equations with good performance.
Sounds good doesn't it?
An example of the usefulness of valarrays:

z = a*x*x + b*x + c

where each variable is an array of "hundreds of numeric values"