16
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ Looks interesting! $\endgroup$
    – Bob Jansen
    Jan 12, 2012 at 10:32
  • $\begingroup$ Hello Dmitri, this question most likely receives a decent amount of traffic and activity on this site and the link towards the end of your question seems to be broken. If that is purposeful, in that you removed it because it has sensitive information then it would be useful to delete that line altogether. However if this is not the case, fixing the link would be beneficial! $\endgroup$
    – Theodore
    Oct 10, 2018 at 0:07

7 Answers 7

20
$\begingroup$

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.

$\endgroup$
12
  • $\begingroup$ Hey Dirk, I thought R already used BLAS. If so, what does Armadillo add for an R user? $\endgroup$ Jan 10, 2012 at 23:06
  • 3
    $\begingroup$ 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. $\endgroup$ Jan 10, 2012 at 23:21
  • $\begingroup$ So, you're just advocating C++ over R, eh? ;) $\endgroup$ Jan 11, 2012 at 0:02
  • 1
    $\begingroup$ Nope, I advocate using C++ and R. A happy marriage. ;-) $\endgroup$ Jan 11, 2012 at 0:03
  • 2
    $\begingroup$ 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? $\endgroup$ Jan 11, 2012 at 17:37
10
$\begingroup$

What I use in my job:

  • boost (the mathematical part)

  • Eigen

  • gsl

  • glpk

and some scary legacy code ;-)

$\endgroup$
8
$\begingroup$

The NAG library is quite commonly used

$\endgroup$
5
$\begingroup$

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

$\endgroup$
1
  • 2
    $\begingroup$ 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. $\endgroup$ Jan 11, 2012 at 18:02
2
$\begingroup$

Just wanted to add one more library that may be of interest: http://www.yeppp.info/. It's not strictly a quant library but a:

"SIMD-optimized mathematical library for x86, ARM, and MIPS processors on Windows, Android, Mac OS X, and GNU/Linux systems."

$\endgroup$
2
$\begingroup$

On my capstone project on Extreme Value Theory, LMM and Swap Pricing I used dlib . It has a lot of various mathematical capabilities. My use focused on vector and optimization calculations.

$\endgroup$
2
$\begingroup$

There's also the Intel math libraries.

See: https://software.intel.com/en-us/mkl

$\endgroup$
1
  • 1
    $\begingroup$ Could you please provide some links to enhance a bit the content of your answer? $\endgroup$
    – SRKX
    Aug 25, 2013 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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