Some days ago a had a little Aha effect about Sfinae (Substitution failure is not an error). I know about Sfinae for a while and I know about the enable_if library in the current standard and in the boost libraries, but I was not aware of all its usefulness. Continue reading

# Tag Archives: C++

# VexCL – High-level OpenCL

Some days ago I found a very nice library for building OpenCL applications: VexCL. It is really high level such that you must not care about things like memory management. It uses expression templates, such that you can write very compact and readable code. It is also possible to use VexCL with odeint, I will show in the next days some examples here.

# Talk about the Taylor series method

# Using Boost Build

I use bjam and Boost.Build since a while and they are really great. You can easily use them to build multi-platform applications and they automatically resolve the C++ header dependencies, which is difficult to realize with make and makefiles. Writing Jamfiles is in principle easy, but in the beginning it is hard to figure out how it works, especially if you are following the official documentation. Today, I found an easy way to link the boost libraries and how easy the boost headers can be included: Continue reading

# odeint v2 released

We have worked for one year on a new version of odeint – a highly flexible library for solving ordinary differential equations. It was hidden in some branch of the boost sandbox. Today, we put this version into the github:

https://github.com/headmyshoulder/odeint-v2

It is not compatible with the old version such that we call the library odeint v2. Some nice and new features are:

- Algebras and operations which can be adapted for nearly all container types. For example, a specialized algebra for thrust exists, such that you can use the power of modern graphics cards and CUDA for solving ODEs.
- A generic implementation of the Runge-Kutta solvers. Any Butcher tableau can now be used without any performance loss.
- Methods with dense output for example the Dopri5 solver.
- Methods for stiff ODEs.
- …

# Advanced expression tree manipulations

I have created a github project for the Taylor series method of ordinary differential equations. It is an addon to odeint and will be one day a part of it.

The Taylor series methods determines the solution of an ODE by its Taylor coefficients. The theory is extremely simple but the difficulty is to determine these coefficients numerically and in an unique way. To do so automatic differentiation is used where the formulas defining the ODE are given as expression trees and are then sequentially evaluated to obtain the n-the derivative or the n-th Taylor coefficient. Continue reading

# Numerical algorithms and template meta programmiming

Here is an article about template-meta-programming and numerical algorithms. It illustrates how one can construct an numerical algorithm during compile-time. The example for this technique is the family of explicit Runge-Kutta solvers for ordinary differential equation.

www.c-plusplus.de/forum/282091

Sorry, it is only in German.

# Run-time performance of expression trees

A few days ago, I played around with proto, a C++ library the for construction and evaluation of expression trees. I wanted to write a small application allowing me to write classical vector operations in a neat way like b+2*c+d*e. With proto this is possible with only a few lines of code. Surprisingly, it turned out that the run-time performance for large expressions was about 10 to 20 percent better than a naive implementation. Continue reading

# Progress bar made really simple

This post is more or less for my archive. It shows how to implement a mini progress display which can be used in console applications. It does not work in all console applications, especially if the output is piped to some files. Continue reading