Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

Before you mark question as off-topic, please read it - it is, actually, quant-related.

Basically, I'm working on an app that spits out a lot of C++ math. When it comes to simple things like exponents and trig, I can use an STL function. But when it comes to things like matrix operations or normal distributions or anything else that's not part of the STL, I'm not quite sure which library to support.

That's the reason for this question - I'd like to know what kind of C++ libs quants typically use (in addition to the STL and such) most. My idea is to support those which are the most common. (I'm thinking of things like BLAS, MKL, Boost.Math, etc.)

BTW, if anyone's interested, here's an overview of what I'm building.

share|improve this question
    
Looks interesting! –  Bob Jansen Jan 12 '12 at 10:32
add comment

5 Answers

up vote 15 down vote accepted

For linear algebra etc, I am partial to Armadillo with Eigen as an alternative. Both are modern (eg templated), actively developed and fairly high-performance.

I like my C++ together with R and stand behind a few projects like Rcpp and RInside which facilitate that integration; RcppArmadillo then brings Armadillo to R.

For quant stuff, there is of course QuantLib and my (too slow-moving :-/) RQuantLib.

share|improve this answer
    
Hey Dirk, I thought R already used BLAS. If so, what does Armadillo add for an R user? –  chrisaycock Jan 10 '12 at 23:06
3  
It helps to look at it the other way: RcppArmadillo helps you to write simple C++ linear algebra, almost Matlab style, that is C++ fast. At run-time, it will indeed refer to whichever BLAS R uses, which may well be optimised, multicore, ... such as Goto or MKL. Makes sense? So the point is when you need to code something that R doesn't yet do, or does too slowly, the RcppArmadillo integration makes it pretty easy to get the job done. –  Dirk Eddelbuettel Jan 10 '12 at 23:21
    
So, you're just advocating C++ over R, eh? ;) –  chrisaycock Jan 11 '12 at 0:02
1  
Nope, I advocate using C++ and R. A happy marriage. ;-) –  Dirk Eddelbuettel Jan 11 '12 at 0:03
2  
I have worked with C++ for twenty years and your statement still makes no sense to me. Why don't you focus on release early, release often and feedback on actual code? –  Dirk Eddelbuettel Jan 11 '12 at 17:37
show 7 more comments

There's also the Intel math libraries.

share|improve this answer
1  
Could you please provide some links to enhance a bit the content of your answer? –  SRKX Aug 25 '13 at 9:04
add comment

The NAG library is quite commonly used

share|improve this answer
add comment

For many numerical procedures you can link against Octave libraries if Octave is installed.

share|improve this answer
2  
While technically true, you should keep in mind that Octave is written to support its interpreter, not provide an API. Hence little use of Octave as a library in the sense of the original question. –  Dirk Eddelbuettel Jan 11 '12 at 18:02
add comment

What I use in my job:

  • boost (the mathematical part)

  • Eigen

  • gsl

  • glpk

and some scary legacy code ;-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.