473,386 Members | 1,698 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.

Fastest math library for C++

I am using the gsl math library for C++.
But I need more speed. Can anybody suggest a faster one?
Thanks.
Anna
Oct 30 '08 #1
13 4254
Anna Smidt wrote:
I am using the gsl math library for C++.
But I need more speed. Can anybody suggest a faster one?
Thanks.
Anna
Sorry Anna, but this is a typical VB speak...
Afraid you'll never become a c++ ace :)

--PA
Oct 30 '08 #2

"Anna Smidt" <a.*****@nospamgmail.comha scritto nel messaggio
news:OM**************@TK2MSFTNGP03.phx.gbl...
>I am using the gsl math library for C++.
But I need more speed. Can anybody suggest a faster one?
I don't know what math features you need from a math library (array and
matrices? Special functions? etc.).

However, you may consider Blitz++ - it uses template metaprogramming
techniques to speed up matrix computations:

http://www.oonumerics.org/blitz/

If you need top speed, you may also consider optimizing and crafting the
code manually, e.g. inlining vector computations, avoiding things like
struct vec { double x, y, z } and using double v[3] instead, avoid virtual
functions in time-critical code, etc.

Giovanni


Oct 30 '08 #3
I will take a look into Blitz++, thanks.
I think inlining skills will have to wait for me some time still :-)

Anna
"Anna Smidt" <a.*****@nospamgmail.comha scritto nel messaggio
news:OM**************@TK2MSFTNGP03.phx.gbl...
>I am using the gsl math library for C++.
But I need more speed. Can anybody suggest a faster one?

I don't know what math features you need from a math library (array and
matrices? Special functions? etc.).

However, you may consider Blitz++ - it uses template metaprogramming
techniques to speed up matrix computations:

http://www.oonumerics.org/blitz/

If you need top speed, you may also consider optimizing and crafting the
code manually, e.g. inlining vector computations, avoiding things like
struct vec { double x, y, z } and using double v[3] instead, avoid virtual
functions in time-critical code, etc.

Giovanni

Oct 30 '08 #4
Sorry Anna, but this is a typical VB speak...
Afraid you'll never become a c++ ace :)

--PA
You estimate me wrong. I even tweaked VB6 with assembler code when I
needed it.
There are bad programmers in VB6 and good ones. The bad thing with VB6
is that it allows you really bad programming which some people abuse.
For example in a VB6 newsgroup somebody once said that he sells his
application for 5 years now and suddenly has a problem with it. And from
the code he posted I could see that (believe it or not) he stored
variables in Labels (these are standard controls in VB6) (which got
mixed up when VB6 converted Unicode to ANSI which caused his trouble, btw).

I wanted to say: When I wouldn't have wanted to become good at C++, I
would not have come here, would I?

Anna

Oct 30 '08 #5


"Anna Smidt" <a.*****@nospamgmail.comwrote in message
news:uc**************@TK2MSFTNGP02.phx.gbl...
>Sorry Anna, but this is a typical VB speak...
Afraid you'll never become a c++ ace :)

--PA

You estimate me wrong. I even tweaked VB6 with assembler code when I
needed it.
You might be a good VB6 programmer, but I think Pavel is saying that you are
(for the moment) a bad question asker. Giovanni tried to answer your
question, but had to ask for additional details (which math functions are
you using) which you still haven't provided. We aren't telepathic, can't
read your mind. That's all.

Oct 31 '08 #6
Oh sorry!!
Oct 31 '08 #7
Matrix and vector.
The GSL lib I'm using is already inline, but I'm feeling (it's a feeling
only, I cannot describe why I feel it... oh wait... I'm a woman, that
tells it all) that it's still slow/ too slow.
Oct 31 '08 #8

"Anna Smidt" <a.*****@nospamgmail.comha scritto nel messaggio
news:Oz**************@TK2MSFTNGP06.phx.gbl...
The GSL lib I'm using is already inline, but I'm feeling (it's a feeling
only, I cannot describe why I feel it... oh wait... I'm a woman, that
tells it all) that it's still slow/ too slow.
I think that in programming you don't use "feelings" to analyze performance
(?!).
You should *measure* performance, you could use benchmarks, etc.

Giovanni
Oct 31 '08 #9
"Giovanni Dicanio" <gi****************@REMOVEMEgmail.comschrieb
>
I think that in programming you don't use "feelings" to analyze
performance (?!).
You should *measure* performance, you could use benchmarks, etc.
After measuring performance, you know it takes 12.34 seconds. Is this good
or bad? Without a feeling that tells you if it's slow or fast, the number
doesn't have a meaning. That's why I think that the feeling can also be
important.

:-)
Armin

Oct 31 '08 #10

"Armin Zingler" <az*******@freenet.deha scritto nel messaggio
news:e9**************@TK2MSFTNGP04.phx.gbl...
"Giovanni Dicanio" <gi****************@REMOVEMEgmail.comschrieb
>>
I think that in programming you don't use "feelings" to analyze
performance (?!).
You should *measure* performance, you could use benchmarks, etc.

After measuring performance, you know it takes 12.34 seconds. Is this good
or bad? Without a feeling that tells you if it's slow or fast, the number
doesn't have a meaning. That's why I think that the feeling can also be
important.

:-)
This kind of feeling is OK, and it makes sense after you measured
performance.

But I can't have a feeling that a library is fast or slow without concrete
data.

I meant just that :)

Giovanni
Oct 31 '08 #11
"Giovanni Dicanio" <gi****************@REMOVEMEgmail.comschrieb

After measuring performance, you know it takes 12.34 seconds. Is
this good or bad? Without a feeling that tells you if it's slow or
fast, the number doesn't have a meaning. That's why I think that
the feeling can also be important.

:-)

This kind of feeling is OK, and it makes sense after you measured
performance.

But I can't have a feeling that a library is fast or slow without
concrete data.

I meant just that :)
Like a "felt temperature", there is also a "felt duration". It sometimes
matters, too. ;-)
Armin

Oct 31 '08 #12
good or bad are relative terms. What you are comparing to?
Find alternatives to your approach and benchmark them.
"Armin Zingler" <az*******@freenet.dewrote in message
news:e9**************@TK2MSFTNGP04.phx.gbl...
"Giovanni Dicanio" <gi****************@REMOVEMEgmail.comschrieb
>>
I think that in programming you don't use "feelings" to analyze
performance (?!).
You should *measure* performance, you could use benchmarks, etc.

After measuring performance, you know it takes 12.34 seconds. Is this good
or bad? Without a feeling that tells you if it's slow or fast, the number
doesn't have a meaning. That's why I think that the feeling can also be
important.

:-)
Armin
Nov 3 '08 #13
"Sheng Jiang[MVP]" <sh*********@hotmail.com.discussschrieb
good or bad are relative terms. What you are comparing to?
Compare to what you expect. I think, Anna's expectation has been
disapointed, therefore she considered the current solution not good enough.
Find alternatives to your approach and benchmark them.
If you find a faster approach, it is better but you can still feel it is too
slow. That was my point. It was only about the feeling. Maybe you took it
too serious (watch the ":-)")
Armin

Nov 3 '08 #14

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

Similar topics

7
by: bluekite2000 | last post by:
new/delete, std::allocator, pool_allocator or mt_allocator??? What r the pros and cons if each method? PS: I m designing a matrix/tensor/vector lib, all of which call base_constructor of class...
8
by: Sensei | last post by:
I have a quick question about the math library included in the standard C90 (and 99). The gcc, xlc and possibly other compilers/linkers on some unix platforms cannot use any math functions in...
2
by: Michael | last post by:
I'm looking for the fastest (dare I say best) C# math library for basic linear algebra, such as matrix inversion, singular value decomposition, and multivariate regression. I've found many...
6
by: Mitchell Vincent | last post by:
Just making sure I'm not missing the boat here, but are there any special routines for doing currency math (fixed precision stuff) in .NET? The wonderful problems of doing math on decimals tend...
5
by: Martin Vilcans | last post by:
Hi, I'm new to this mailing list and fairly new to Python as well. I'm working on a prototype for a 3D game using OpenGL, and take this opportunity to learn Python better. I'm looking for a good...
110
by: Gregory Pietsch | last post by:
I'm writing a portable implementation of the C standard library for http://www.clc-wiki.net and I was wondering if someone could check the functions in math.h for sanity/portability/whatever. I'm...
15
by: Chris | last post by:
>>from math import * 0.0 1.2246063538223773e-016 -2.4492127076447545e-016 1.0 -1.0 1.0 The cosine function works fine, but I'm getting weird answers for sine. Is this a bug? Am I doing...
5
by: aguirre.adolfo | last post by:
Hi, I am a very newbie who would very much appreciate some hints. Python 2.52. on Windows XP for now. Soon on Ubuntu 8 I am teaching myself Python following free tutorials. I can solve...
0
by: dantz | last post by:
After reading all of the materials in msdn about interprocess communication now I am confused. I hope someone can give me some enlightment. I am developing a multithreaded client-server...
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: 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
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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.