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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

#include <br />

...<br />

int main () {<br />

int n=100;<br />

// Define a real n x n matrix<br />

glas::dense matrix< double > matrix( n, n ) ;<br />

// Define a complex n vector<br />

glas::dense vector< std::complex > eigval( n ) ;<br />

// Fill the matrix<br />

...<br />

// Call LAPACK routine DGEES <strong>for</strong> computing the eigenvalue Schur <strong>for</strong>m.<br />

// We create workspace <strong>for</strong> best per<strong>for</strong>mance.<br />

bindings::lapack::gees( matrix, eigval, bindings::lapack::optimal workspace() ) ;<br />

...<br />

}<br />

Figure 11.4: Example <strong>for</strong> LAPACK bindings and matrix bindings traits

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

Saved successfully!

Ooh no, something went wrong!