Loading...
Searching...
No Matches
CusolverInverse.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
20
21#ifndef GPR_LINALG_CUSOLVER_INVERSE_H_
22#define GPR_LINALG_CUSOLVER_INVERSE_H_
23
24#include "Backend.h"
25#include "KernelInverse.h"
26
27namespace gpr {
28namespace linalg {
29
30class CusolverInverse final : public KernelInverse {
31public:
37 [[nodiscard]] bool factorise(const EigenMatrix& K);
38
39 [[nodiscard]] Kind kind() const noexcept override
40 {
41 return Kind::RankLocal;
42 }
43 [[nodiscard]] Eigen::VectorXd solve(
44 const Eigen::VectorXd& b) const override;
45 [[nodiscard]] EigenMatrix solve_mat(const EigenMatrix& B) const override;
46 [[nodiscard]] double log_det() const override;
47 [[nodiscard]] double trace_inv_times(const EigenMatrix& A) const override;
48
49private:
50 EigenMatrix L_;
51 bool factored_{false};
52};
53
54} // namespace linalg
55} // namespace gpr
56
57#endif // GPR_LINALG_CUSOLVER_INVERSE_H_
Linear algebra abstraction layer for GPR hot-path operations.
Abstract operator interface for K^{-1} actions used by Laplace Hessian probe loops and Williams-Rasmu...
bool factorise(const EigenMatrix &K)
double trace_inv_times(const EigenMatrix &A) const override
Eigen::VectorXd solve(const Eigen::VectorXd &b) const override
Solve K x = b for a single right-hand side.
double log_det() const override
Returns the log determinant of K.
EigenMatrix solve_mat(const EigenMatrix &B) const override
Solve K X = B for a multi right-hand side.
Kind kind() const noexcept override
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