Loading...
Searching...
No Matches
DenseLLTInverse.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
13
14#ifndef GPR_LINALG_DENSE_LLT_INVERSE_H_
15#define GPR_LINALG_DENSE_LLT_INVERSE_H_
16
17#include <Eigen/Cholesky>
18
19#include "KernelInverse.h"
20
21namespace gpr {
22namespace linalg {
23
24class DenseLLTInverse final : public KernelInverse {
25public:
31 [[nodiscard]] bool factorise(const EigenMatrix& K);
32
33 [[nodiscard]] Kind kind() const noexcept override
34 {
35 return Kind::RankLocal;
36 }
37 [[nodiscard]] Eigen::VectorXd solve(
38 const Eigen::VectorXd& b) const override;
39 [[nodiscard]] EigenMatrix solve_mat(const EigenMatrix& B) const override;
40 [[nodiscard]] double log_det() const override;
41 [[nodiscard]] double trace_inv_times(const EigenMatrix& A) const override;
42
43private:
44 Eigen::LLT<EigenMatrix> llt_;
45 bool factored_{false};
46};
47
48} // namespace linalg
49} // namespace gpr
50
51#endif // GPR_LINALG_DENSE_LLT_INVERSE_H_
Abstract operator interface for K^{-1} actions used by Laplace Hessian probe loops and Williams-Rasmu...
Kind kind() const noexcept override
double trace_inv_times(const EigenMatrix &A) const override
EigenMatrix solve_mat(const EigenMatrix &B) const override
Solve K X = B for a multi right-hand side.
Eigen::VectorXd solve(const Eigen::VectorXd &b) const override
Solve K x = b for a single right-hand side.
bool factorise(const EigenMatrix &K)
double log_det() const override
Returns the log determinant of K.
Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators,...
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
Eigen::Matrix< double, EigenDynamic, EigenDynamic, EigenMatrixStorage > EigenMatrix
Definition Macros.h:20