Boost logo

Ublas :

From: Georg Baum (Georg.Baum_at_[hidden])
Date: 2007-05-29 14:50:01


Hi,

the bindings are designed in a way that switching the type of complex
numbers that is used with ublas containers is easy: You have to change one
(or two if you also use single precision) typedefs in
boost/numeric/bindings/traits/type.hpp. Unfortunately that means that you
have to modify that file, which is not so good if you have a central
installation that is used for several projects.
You are not completely free in the choice of complex type (the memory
layout has to be compatible with FORTRAN), but there is a good reason not
to use std::complex:
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2002/n1388.pdf

This patch (the part that applies to type.hpp) introduces a define
BOOST_NUMERIC_BINDINGS_USE_CUSTOM_COMPLEX_TYPE that controls these types:
If you define it you have to put the necessary typedefs somewhere in your
own code.

The rest of the patch corrects some type inconsistencies that are not
noticed when using std::complex, but lead to compile errors when using an
alternative type.

It would be nice if somebody with write access to the sandbox svn could put
this in (at least the second part if the first one is not OK).

Georg