You are not logged in.
I'm a physics student doing some calculations and learning C++ in the process. Not so long a go, I started using boost library in my applications and found it to be a great help. Is there any other great C++ libraries I should definitely know about (programming in general, BLAS, etc) ?
Offline
For general purpose computing, Boost and STL are the obvious places to start. It's hard to image a frequently occurring programming problem that hasn't been addressed by Boost.
If you plan on running your codes in a distributed memory environment (e.g. linux cluster), you will probably want to learn the basics of MPI. MPI-2 does define a C++ API, however, if you read the official MPI-2 documentation, you'll find that the entire C++ API has been depreciated. There are some 3rd party libraries out their that provide a more modern C++ interface to MPI (e.g. Boost MPI) than that defined by the MPI standard.
There are numerous C++ libraries out there for numerical computing (c.f. oonumerics.org). However, I don't think there is a "standard" C++ library for numerical computing. Even BLAS and LAPACK do not define C++ APIs. The Boost uBLAS library is popular, but it only implements BLAS functionality (e.g. uBLAS does not provide the tools needed to solve equations). In the end, you might be better served by first identifying what your specific needs are, focus on learning the fundamentals of modern C++ software design, and then patch together a custom C++ library (or libraries) that meets your specific needs. It's usually a good idea to try to reuse the tools that are already out there; however, sometimes there are pragmatic and/or pedagogical reasons to develop some tools from scratch.
For my own research (application of Finite Volume Methods to problems in aeroelasticity and flight dynamics), I have my own C++ numerical library that I've developed mostly from scratch, which provides the building blocks I need to compose a "physics" based model ("classical" continuum mechanics) of my problem. The linear algebra library (or sub-library) is just a C++ wrapper around BLAS and LAPACK; I find it difficult to beat the performance of vendor supplied math libraries--even with modern template meta-programming libraries such as uBLAS.
Also, Fortran 2003 introduced features for binding fortran code with C. Most modern compiler suites (e.g. GCC, Intel, Open64) implement the ISO C Binding features of Fortran 2003. This means that you can now implement C bindings to legacy fortran libraries without having to guess the name mangling scheme used by a particular fortran compiler. Also, C structs and Fortran derived types are now inter-operable. I don't necessarily recommend developing in Fortran, but if you come across a mature library that was written in Fortran, you could potentially create C++ bindings (via C) to that library if need be.
I hope this helps.
- Good judgement comes from experience; experience comes from bad judgement. -- Mark Twain
- There's a remedy for everything but death. -- The wise fool, Sancho Panza
- The purpose of a system is what it does. -- Anthony Stafford Beer
Offline
I second the importance of MPI. If you're into high energy physics, two big ones are Root and Geant4. There's also ALPS for many-body quantum problems, which I've never used. I'm pretty sure all that is in the AUR.
6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.
Offline
Wow, thanks for the great answers. I was thinking about writing custom C++ library for the stuff I need, but it seemed as something with only "to learn how to do it" meaning.
Is there any general things to avoid in C++ for speed and stability?
Offline
You didn't specify what domains and use case are you interested in, what would probably help to give more specific list.
Apart from Boost C++ Libraries, there is also collection of POCO C++ Libraries you may want to check out.
I'd add two libraries for networking and communication:
* C++ Network Library (candidate to become Boost.Network)
* YAMI4
If you are after database use cases too, you may check SOCI.
Plenty of general purpose libraries, but also some domain specific ones like PCL - Point Cloud Library.
But, it is not very sensible generate yet another list of C++ libraries as a decent Web search engine will do that for you or List of C++ template libraries.
So, give your wishlist and then you will likely get less chaotic listing.
Mateusz Loskot | github | archlinux-config
Arch (x86-64) | ThinkPad T400 | Intel P8600| Intel i915
Arch (x86-64) | ThinkPad W700 | Intel T9600 | NVIDIA Quadro FX 2700M
Offline
I would highly recommend armadillo for linear algebra stuff. The design is simple to use, and BLAS routines are fed to Netlib, MKL, GOTO, etc to maintain efficiency.
Another thing to dive into is OpenCL, which implements a neat approach to massive parallellization, in particular GPU computing.
Last edited by toffyrn (2012-06-19 05:10:23)
Offline
@mloskot as I stated in the first post - numerical calculations, but as I am quite new programmer, selecting the "good and efficient" libraries and not choosing the not so "good" libraries with similar functionality is really hard.
@toffyrn I noticed armadillo in the "List of C++ template libraries" from mloskot post and decided to try it out .. just finished porting my code to armadillo and together with atlas-lapack it cuts calculation time by 40%. I did look into OpenCL, but it seems that there is no support for complex numbers and it looks promising, but no complex numbers at the moment .
Offline
Yeah, there is no built-in support for complex numbers in OpenCL ATM. It is however included in pyopencl, and I believe the source code could be used in C++/CL projects as well. Another thing to look at is cublas or AMD APPML, which are blas libraries written for GPUs using either cuda or OpenCL. At least AMD's implementation includes BLAS routines for complex numbers.
Refs:
http://developer.amd.com/libraries/appm … fault.aspx
http://documen.tician.de/pyopencl/array … ex-numbers
Offline