#include "intflapack.h" // ... // Use FortranMemoryMapping as default BaseArray::SetDefaultMemoryMapping(BaseArray::FortranMemoryMapping); // Create an fill the arrays A and its copy AA int n = 20; Matrix A(n , n), AA; A = RandomSequence(RandomSequence::Gaussian, 0., 4.); AA = A; // AA is a copy of A // Compute the SVD decomposition Vector S; // Vector of singular values Matrix U, VT; LapackServer<r_8> lpks; lpks.SVD(AA, S, U, VT); // We create a diagonal matrix using S Matrix SM(n, n); for(int k=0; k<n; k++) SM(k,k) = S(k); // Check the result : A = U*SM*VT Matrix diff = U*(SM*VT) - A; double min, max; diff.MinMax(min, max); cout << " Min/Max difference Matrix (?=0) , Min= " << min << " Max= " << max << endl;
The FFTWServer class (in module FFTW) implements FFTServerInterface class methods, for one dimensional and multi-dimensional Fourier transforms on double precision data using the FFTW package (available from http://www.fftw.org).