03.12.2012 Views

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

244 CHAPTER 11. <strong>C++</strong> LIBRARIES FOR SCIENTIFIC COMPUTING<br />

We now briefly explain how the goals are met be<strong>for</strong>e entering a more detailed discussion of the<br />

software design.<br />

The GLAS should be considered as an interface to other software <strong>for</strong> linear algebra, e.g. the<br />

BLAS, MTL, or other linear algebra software. Such interface is provided by the Back-ends,<br />

whereas the syntax <strong>for</strong> using such backends does not change. For example, if we want to add a<br />

scaled vector to another vector (an axpy), then we write<br />

y + = a ∗ x ;<br />

but the implementation can use the BLAS (e.g. daxpy), or MTL, or another package. We have<br />

provided a reference <strong>C++</strong> implementation, that is an illustration of how the expressions are<br />

dispatched to the actual implementation.<br />

The concepts mainly contain free functions and meta functions, so that external objects can be<br />

used in GLAS provided these functions are specialized. As an exercise, we show how this can<br />

be done <strong>for</strong> an std::vector.<br />

For more in<strong>for</strong>mation, see [?].<br />

11.1.3 Status<br />

GLAS is still under development. Currently, there are features <strong>for</strong> working with dense vectors<br />

and matrices, and sparse matrices. There is support to the Boost.Sandbox.Bindings and Toolboxes<br />

<strong>for</strong> working with LAPACK, Structured Matrices (mase toolbox), and iterative methods<br />

(iterative toolbox).<br />

11.2 Boost<br />

Boost is a bit out of line in this chapter. Firstly, it is not a library itself but a whole collection<br />

of freely available C ++ libraries. Secondly, not all of the contained libraries deal directly with<br />

scientific computing. However, many of the “non-scientific” libraries provide useful functionality<br />

<strong>for</strong> scientific libraries and applications.<br />

Boost provides free portable <strong>C++</strong> libraries.<br />

Currently, the following Boost libraries are available that are useful <strong>for</strong> numerical software:<br />

• Data structures<br />

– tuple: pairs, triples, etc, e.g. tuple<br />

– smart ptr: smart pointers<br />

• Correctness and testing<br />

– static assert: compile time assertions<br />

• Template programming<br />

– enable if, mpl, type traits<br />

– static assert: compile time assertions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!