Loading...
Searching...
No Matches
KernelInverse.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
31
32#ifndef GPR_LINALG_KERNEL_INVERSE_H_
33#define GPR_LINALG_KERNEL_INVERSE_H_
34
35#include <Eigen/Core>
36
38
39namespace gpr {
40namespace linalg {
41
43public:
44 enum class Kind {
45 // The operator's solve / solve_mat run rank-locally on whatever
46 // CPU the caller invokes them on. ProbeExecutor parallelises the
47 // probe loop by partitioning probes round-robin across MPI ranks
48 // and Allreduce-summing the per-rank partial result vectors.
50 // The operator's solve / solve_mat are MPI collectives (e.g. the
51 // ScaLAPACK pdtrsm path). ProbeExecutor runs the probe loop on
52 // every rank because all ranks must enter each solve together.
54 };
55
56 virtual ~KernelInverse() = default;
57
61 [[nodiscard]] virtual Kind kind() const noexcept = 0;
62
64 [[nodiscard]] virtual Eigen::VectorXd solve(
65 const Eigen::VectorXd& b) const = 0;
66
68 [[nodiscard]] virtual EigenMatrix solve_mat(const EigenMatrix& B) const = 0;
69
71 [[nodiscard]] virtual double log_det() const = 0;
72
81 [[nodiscard]] virtual double trace_inv_times(
82 const EigenMatrix& A) const = 0;
83};
84
85} // namespace linalg
86} // namespace gpr
87
88#endif // GPR_LINALG_KERNEL_INVERSE_H_
virtual double trace_inv_times(const EigenMatrix &A) const =0
virtual EigenMatrix solve_mat(const EigenMatrix &B) const =0
Solve K X = B for a multi right-hand side.
virtual double log_det() const =0
Returns the log determinant of K.
virtual ~KernelInverse()=default
virtual Kind kind() const noexcept=0
virtual Eigen::VectorXd solve(const Eigen::VectorXd &b) const =0
Solve K x = b for a single right-hand side.
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