syev.hpp
Go to the documentation of this file.
1 /*!
2  *
3  *
4  * \brief Symmetric eigenvalue decomposition
5  *
6  * \author O. Krause
7  * \date 2012
8  *
9  *
10  * \par Copyright 1995-2015 Shark Development Team
11  *
12  * <BR><HR>
13  * This file is part of Shark.
14  * <http://image.diku.dk/shark/>
15  *
16  * Shark is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU Lesser General Public License as published
18  * by the Free Software Foundation, either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * Shark is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public License
27  * along with Shark. If not, see <http://www.gnu.org/licenses/>.
28  *
29  */
30 #ifndef REMORA_KERNELS_SYEV_HPP
31 #define REMORA_KERNELS_SYEV_HPP
32 
33 
34 #ifdef REMORA_USE_LAPACK
35 #include "lapack/syev.hpp"
36 #else
37 #include "default/syev.hpp"
38 #endif
39 
40 namespace remora{ namespace kernels{
41 
42 ///\brief Well known SYmmetric EigenValue function (SYEV).
43 ///
44 /// A given matrix A is decomposed as
45 /// A=QDQ^T
46 /// where Q is an orthogonal (or unitary) matrix with QQ^T=Q^TQ=I and D are the eigenvalue
47 /// of A. As A is symmetric, only the lower part of it is accessed for reading.
48 /// The wholee matrix will in the end contain the eigenvectors of A and thus
49 /// A is replaced by Q.
50 /// Additionally the eigenvalues are stored in the second argument.
51 template <typename MatA, typename VectorB>
52 void syev(
53  matrix_expression<MatA, cpu_tag>& matA,
54  vector_expression<VectorB, cpu_tag>& eigenValues
55 ) {
56  bindings::syev(matA,eigenValues);
57 }
58 
59 
60 }}
61 #endif