numerics
0.1.0
Loading...
Searching...
No Matches
jacobi_eig.hpp
Go to the documentation of this file.
1
/// @file eigen/jacobi_eig.hpp
2
/// @brief Full symmetric eigendecomposition via cyclic Jacobi sweeps.
3
///
4
/// Applies orthogonal plane rotations until
5
/// \f$\sum_{i\ne j} A_{ij}^2 < \mathrm{tol}^2\f$.
6
#pragma once
7
8
#include "
core/matrix.hpp
"
9
#include "
core/policy.hpp
"
10
#include "
core/vector.hpp
"
11
12
namespace
num
{
13
14
/// @brief Symmetric eigendecomposition \f$A=V\Lambda V^T\f$.
15
struct
EigenResult
{
16
Vector
values
;
17
Matrix
vectors
;
18
idx
sweeps
= 0;
19
bool
converged
=
false
;
20
};
21
22
EigenResult
eig_sym
(
const
Matrix
& A,
23
real
tol = 1
e
-12,
24
idx
max_sweeps = 100,
25
Backend
backend =
lapack_backend
);
26
27
}
// namespace num
num::BasicMatrix< real >
num::BasicVector< real >
policy.hpp
Backend enum and default backend selection.
matrix.hpp
Dense row-major matrix templated over scalar type T.
num
Definition
quadrature.hpp:8
num::real
double real
Definition
types.hpp:10
num::Backend
Backend
Definition
policy.hpp:7
num::idx
std::size_t idx
Definition
types.hpp:11
num::lapack_backend
constexpr Backend lapack_backend
Definition
policy.hpp:66
num::e
constexpr real e
Definition
math.hpp:44
num::eig_sym
EigenResult eig_sym(const Matrix &A, real tol=1e-12, idx max_sweeps=100, Backend backend=lapack_backend)
Definition
eig.cpp:11
num::EigenResult
Symmetric eigendecomposition .
Definition
jacobi_eig.hpp:15
num::EigenResult::values
Vector values
Definition
jacobi_eig.hpp:16
num::EigenResult::converged
bool converged
Definition
jacobi_eig.hpp:19
num::EigenResult::sweeps
idx sweeps
Definition
jacobi_eig.hpp:18
num::EigenResult::vectors
Matrix vectors
Definition
jacobi_eig.hpp:17
vector.hpp
Dense vector storage and operations.
include
linalg
eigen
jacobi_eig.hpp
Generated by
1.9.8