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?
This is a discussion on Matrices... within the C++ Programming forums, part of the General Programming Boards category; For anybody here who's taken Algebra II or higher or knows about matrices: Is there any way to use 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?
Multidimensional arrays would be a good idea.
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 )
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...
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
There is a way! Although I've not used them (yet...) they are called Valarrays, and "The C++ Standard Library" says:
Sounds good doesn't it?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.
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"
I might be reading more about these tonight :P
Code:#include <valarray>
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared