Is there any Matrix in the STL?

D

DeMarcus

Hi,

Is there any kind of "std::matrix<>" in the STL that is optimized
for matrix operations, or do I have to do a
std::vector< std::vector<someType> > myMatrix;

Best regards

Daniel
 
M

Martijn Lievaart

Hi,

Is there any kind of "std::matrix<>" in the STL that is optimized
for matrix operations, or do I have to do a
std::vector< std::vector<someType> > myMatrix;

IMO, multiple dimension arrays in C and C++ are a pain in the ass, an
issue that should have been addressed way earlier. Luckily boost
(www.boost.org) has a multi_array that is likely to meet your needs.

For 2d arrays, also have a look at uBLAS (also at boost). This also
mentiones other math-libraries that may offer other advantages, most
notably Blitz++.

HTH,
M4
 
H

Hendrik Belitz

DeMarcus said:
Hi,

Is there any kind of "std::matrix<>" in the STL that is optimized
for matrix operations, or do I have to do a
std::vector< std::vector<someType> > myMatrix;

Best regards

Daniel

Try to use the Blitz++ library for maximum performance and usability.
 
D

DeMarcus

Thanks!


Martijn said:
IMO, multiple dimension arrays in C and C++ are a pain in the ass, an
issue that should have been addressed way earlier. Luckily boost
(www.boost.org) has a multi_array that is likely to meet your needs.

For 2d arrays, also have a look at uBLAS (also at boost). This also
mentiones other math-libraries that may offer other advantages, most
notably Blitz++.

HTH,
M4
 
E

E. Robert Tisdale

DeMarcus said:
Is there any kind of "std::matrix<>" in the STL
that is optimized for matrix operations
or do I have to do a

std::vector<std::vector<someType> > myMatrix;

The valarray class templates are the closest to what you want.

Take a look at The Object-Oriented Numerics web page:

http://www.oonumerics.org/oon/

In particular, take a look at
The C++ Scalar, Vector, Matrix and Tensor class Library

http://www.netwood.net/~edwin/svmtl/
 

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
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top