473,386 Members | 1,745 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,386 software developers and data experts.

Is there any Matrix in the STL?


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

Jul 22 '05 #1
8 22553
On Thu, 05 Feb 2004 14:06:23 +0100, DeMarcus wrote:

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

Jul 22 '05 #2
DeMarcus wrote:

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.

--
To get my real email adress, remove the two onkas
--
Dipl.-Inform. Hendrik Belitz
Central Institute of Electronics
Research Center Juelich
Jul 22 '05 #3

Thanks!
Martijn Lievaart wrote:
On Thu, 05 Feb 2004 14:06:23 +0100, DeMarcus wrote:

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


Jul 22 '05 #4

Thanks!
Hendrik Belitz wrote:
DeMarcus wrote:

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.


Jul 22 '05 #5
DeMarcus wrote:

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


You might also want to have a look at the Matrix Template Library at
http://www.osl.iu.edu/research/mtl/intro.php3

hth,
Andreas
Jul 22 '05 #6
DeMarcus wrote:
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/

Jul 22 '05 #7

Thanks!

Andreas Cardeneo wrote:
DeMarcus wrote:

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

You might also want to have a look at the Matrix Template Library at
http://www.osl.iu.edu/research/mtl/intro.php3

hth,
Andreas


Jul 22 '05 #8

Thanks!

E. Robert Tisdale wrote:
DeMarcus wrote:
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/


Jul 22 '05 #9

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

Similar topics

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...
6
by: memocan | last post by:
#include <iostream> using namespace std; int x; //global variable matrix int main() { x= new float ; //initialize the size now }
14
by: amitnanda | last post by:
Hi Guys, I have a matrix multiplication program in C that multiplies two matrices. When their size is 3*3 or 800*800, the program runs fine. But above that size, I get a "segmentation fault"....
20
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've...
1
by: Peterwkc | last post by:
Hello all expert, i have two program which make me desperate bu after i have noticed the forum, my future is become brightness back. By the way, my problem is like this i the first program was...
2
by: DarrenWeber | last post by:
Below is a module (matrix.py) with a class to implement some basic matrix operations on a 2D list. Some things puzzle me about the best way to do this (please don't refer to scipy, numpy and...
0
by: DarrenWeber | last post by:
# Copyright (C) 2007 Darren Lee Weber # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
18
by: Hypnotik | last post by:
Hello everyone. I'm writing a program which uses a class called matrix. I have written all of the different functions, constructor, etc. When I run the program I receive "Constructor", which I...
2
by: rijaalu | last post by:
I am designing a matrix class that performs addition, multicpication, substraction and division. When ever i complie the code it shows an error. include <iostream> using namespace std; class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.