Hermitian
The Hermitians of vectors will be available as soon as transposition is implemented.
Hermitians of matrices are calculated as conjugates of transposed:
#include <iostream> #include <boost/numeric/mtl/mtl.hpp> int main(int, char**) { using namespace mtl; typedef std::complex<double> cdouble; const unsigned xd= 2, yd= 5, n= xd * yd; compressed2D<cdouble> A(n, n); matrix::laplacian_setup(A, xd, yd); // Fill imaginary part of the matrix A*= cdouble(1, -1); std::cout << "A is\n" << with_format(A, 7, 1) << "\n"; std::cout << "trace(A) is " << trace(A) << "\n\n"; std::cout << "conj(A) is\n" << with_format(conj(A), 7, 1) << "\n"; std::cout << "trans(A) is\n" << with_format(trans(A), 7, 1) << "\n"; std::cout << "hermitian(A) is\n" << with_format(hermitian(A), 7, 1) << "\n"; return 0; }
It returns an immutable view on the matrix (expression).
Return to Transposed Table of Content Proceed to Sub-matrices
Hermitian -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine
-- Gen. with
rev. 7542
on Sat Aug 11 2012 by doxygen 1.7.6.1 -- © 2010 by SimuNova UG.