GPRidge v1.0.0
GPR-accelerated saddle point searches on potential energy surfaces
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
DenseFactorTrace.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
// Copyright (c) gpridge developers
3
4
#ifndef GPR_LINALG_DENSE_FACTOR_TRACE_H_
5
#define GPR_LINALG_DENSE_FACTOR_TRACE_H_
6
7
#include <limits>
8
9
#include "
../../backend/Macros.h
"
10
11
namespace
gpr::linalg
{
12
19
inline
double
trace_solve_product
(
const
EigenMatrix
& L,
const
EigenMatrix
& A)
20
{
21
if
(L.rows() != L.cols() || A.rows() != L.rows() || A.cols() != L.cols())
22
return
std::numeric_limits<double>::quiet_NaN();
23
if
(L.rows() == 0)
return
0.0;
24
const
EigenMatrix
solved =
25
L.transpose().triangularView<Eigen::Upper>().solve(
26
L.triangularView<Eigen::Lower>().solve(A));
27
return
solved.trace();
28
}
29
32
inline
double
dense_factor_inverse_trace
(
const
EigenMatrix
& L)
33
{
34
if
(L.rows() != L.cols())
return
std::numeric_limits<double>::quiet_NaN();
35
if
(L.rows() == 0)
return
0.0;
36
return
L.triangularView<Eigen::Lower>()
37
.solve(EigenMatrix::Identity(L.rows(), L.cols()))
38
.squaredNorm();
39
}
40
41
}
// namespace gpr::linalg
42
43
#endif
// GPR_LINALG_DENSE_FACTOR_TRACE_H_
Macros.h
gpr::linalg
Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators,...
Definition
ConditionedKernel.h:14
gpr::linalg::dense_factor_inverse_trace
double dense_factor_inverse_trace(const EigenMatrix &L)
Definition
DenseFactorTrace.h:32
gpr::linalg::trace_solve_product
double trace_solve_product(const EigenMatrix &L, const EigenMatrix &A)
Definition
DenseFactorTrace.h:19
gpr::EigenMatrix
Eigen::Matrix< double, EigenDynamic, EigenDynamic, EigenMatrixStorage > EigenMatrix
Definition
Macros.h:20
gpr
linalg
DenseFactorTrace.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf