C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden C++ for Scientists - Technische Universität Dresden

math.tu.dresden.de
from math.tu.dresden.de More from this publisher
03.12.2012 Views

248 CHAPTER 11. C++ LIBRARIES FOR SCIENTIFIC COMPUTING #include #include #include #include #include #include ... int main () { int n=100; // Define a real n x n matrix glas::dense matrix< double > matrix( n, n ) ; // Define a complex n vector glas::dense vector< std::complex > eigval( n ) ; // Fill the matrix ... // Call LAPACK routine DGEES for computing the eigenvalue Schur form. // We create workspace for best performance. bindings::lapack::gees( matrix, eigval, bindings::lapack::optimal workspace() ) ; ... } Figure 11.4: Example for LAPACK bindings and matrix bindings traits

11.4. MATRIX TEMPLATE LIBRARY 249 coordinate format. The matrix is stored column wise. The template argument 1 indicates that row and column numbers start from one, which is required for the Fortran 90 code MUMPS. Finally, the last argument indicates that the row and column indices are stored in type int, which is also a requirement for the Fortran 90 interface. The solve consists of three phases : (1) the analysis phase, which only needs the matrix’ integer data, (2) the factorization phase, where also the numerical values are required and (3) the solution phase (or backtransformation), where the right-hand side vector is passed on. The included files contain the specializations of the dense matrix and sparse matrix traits for uBLAS and the MUMPS bindings. 11.4 Matrix Template Library 11.5 Blitz++ TODO: We can ask Todd to write something himself — Peter 11.6 Graph Libraries TODO: Few introducing words from Peter 11.6.1 Boost Graph Library TODO: I can write something about it — Peter 11.6.2 LEDA LEDA implements advanced container types and combinatorial algorithms, especially graph algorithms. Containers are parameterized by element type and implementation strategies. Algorithms in general work only with the data structure of the library itself. 11.7 Geometric Libraries TODO: Few introducing words from René and Philipp 11.7.1 CGAL TODO: Ask Sylvain to write something? Or can René and Philipp write it? CGAL implements generic classes and procedures for geometric computing. The data structure complexity is at a very high level.

11.4. MATRIX TEMPLATE LIBRARY 249<br />

coordinate <strong>for</strong>mat. The matrix is stored column wise. The template argument 1 indicates that<br />

row and column numbers start from one, which is required <strong>for</strong> the Fortran 90 code MUMPS.<br />

Finally, the last argument indicates that the row and column indices are stored in type int,<br />

which is also a requirement <strong>for</strong> the Fortran 90 interface. The solve consists of three phases :<br />

(1) the analysis phase, which only needs the matrix’ integer data, (2) the factorization phase,<br />

where also the numerical values are required and (3) the solution phase (or backtrans<strong>for</strong>mation),<br />

where the right-hand side vector is passed on. The included files contain the specializations of<br />

the dense matrix and sparse matrix traits <strong>for</strong> uBLAS and the MUMPS bindings.<br />

11.4 Matrix Template Library<br />

11.5 Blitz++<br />

TODO: We can ask Todd to write something himself — Peter<br />

11.6 Graph Libraries<br />

TODO: Few introducing words from Peter<br />

11.6.1 Boost Graph Library<br />

TODO: I can write something about it — Peter<br />

11.6.2 LEDA<br />

LEDA implements advanced container types and combinatorial algorithms, especially graph<br />

algorithms. Containers are parameterized by element type and implementation strategies. Algorithms<br />

in general work only with the data structure of the library itself.<br />

11.7 Geometric Libraries<br />

TODO: Few introducing words from René and Philipp<br />

11.7.1 CGAL<br />

TODO: Ask Sylvain to write something? Or can René and Philipp write it?<br />

CGAL implements generic classes and procedures <strong>for</strong> geometric computing. The data structure<br />

complexity is at a very high level.

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

Saved successfully!

Ooh no, something went wrong!