FML
|
This namespace deals with computing the Hessian of a grid and related algorithms that rely on this. More...
Typedefs | |
template<int N> | |
using | FFTWGrid = FML::GRID::FFTWGrid< N > |
Functions | |
template<int N> | |
void | ComputeHessianWithFT (const FFTWGrid< N > &f_real, std::vector< FFTWGrid< N > > &hessian_real, double norm=1.0, bool hessian_of_potential_of_f=false) |
Computes the Hessian matrix of a grid [norm * f] via Fourier transforms. More... | |
template<int N> | |
void | SymmetricTensorEigensystem (std::vector< FFTWGrid< N > > &tensor_real, std::vector< FFTWGrid< N > > &eigenvalues, std::vector< FFTWGrid< N > > &eigenvectors, bool compute_eigenvectors=false) |
For each point in the grid compute eigenvectors and eigenvalues of the tensor \( H_{ij} \) where tensor_real contains the \( N(N-1)/2 \) grids [ 00,01,02,..,11,12,...,NN ]. More... | |
This namespace deals with computing the Hessian of a grid and related algorithms that rely on this.
using FML::HESSIAN::FFTWGrid = typedef FML::GRID::FFTWGrid<N> |
void FML::HESSIAN::ComputeHessianWithFT | ( | const FFTWGrid< N > & | f_real, |
std::vector< FFTWGrid< N > > & | hessian_real, | ||
double | norm = 1.0 , |
||
bool | hessian_of_potential_of_f = false |
||
) |
Computes the Hessian matrix of a grid [norm * f] via Fourier transforms.
If hessian_of_potential_of_f is true then we compute the Hessian \( \phi_{ij} \) where \( \nabla^2 \phi = norm * f_{\rm real} \) Since \( f_{ij} = f_{ji} \) we only compute the elements for \( j \geq i \) and they are stored in the order fxx fxy ... fyy fyz ... etc. in hessian_real In 2D: [fxx fxy fyy] In 3D: [fxx fxy fxz fyy fyz fzz]
N | The dimension we are working in |
[in] | f_real | The grid we are to compute the hessian of |
[out] | hessian_real | The hessian of the grid (or its potential, see below) |
[in] | norm | A number to scale the grid by if needed (default is 1.0) |
[in] | hessian_of_potential_of_f | Compute the hessian of the potential of the grid (default is false) |
Definition at line 37 of file Hessian.h.
void FML::HESSIAN::SymmetricTensorEigensystem | ( | std::vector< FFTWGrid< N > > & | tensor_real, |
std::vector< FFTWGrid< N > > & | eigenvalues, | ||
std::vector< FFTWGrid< N > > & | eigenvectors, | ||
bool | compute_eigenvectors = false |
||
) |
For each point in the grid compute eigenvectors and eigenvalues of the tensor \( H_{ij} \) where tensor_real contains the \( N(N-1)/2 \) grids [ 00,01,02,..,11,12,...,NN ].
Eigenvalues are ordered in descending order
Eigenvectors are stored in row major order in the grid vector
This allocates N grids if compute_eigenvectors = false and N(N+1) grids otherwise
Definition at line 115 of file Hessian.h.