#include <gpr/ml/laplace/ScopedKernelState.h>
Public Member Functions | |
| ScopedKernelState (SexpatCF &kernel, double &sigma2, LikGaussian *likelihood=nullptr) noexcept | |
| ~ScopedKernelState () noexcept | |
| void | restore () noexcept |
| ScopedKernelState (const ScopedKernelState &)=delete | |
| ScopedKernelState (ScopedKernelState &&)=delete | |
| ScopedKernelState & | operator= (const ScopedKernelState &)=delete |
| ScopedKernelState & | operator= (ScopedKernelState &&)=delete |
| void | applyTheta (const Eigen::VectorXd &theta) |
RAII guard: snapshots (magnSigma2, lengthScales, sigma2) at construction and restores them at destruction.
Used by Laplace and SVGD grid/particle loops to mutate hyperparameters without leaking rank-local state across early returns.
Non-copyable, non-movable: the guard owns a fixed scope.
Definition at line 22 of file ScopedKernelState.h.
|
inlinenoexcept |
| kernel | SexpAt covariance function whose magn + ls to snapshot |
| sigma2 | reference to the noise variance member in the GPR |
| likelihood | optional Gaussian likelihood whose noise is theta-owned |
Definition at line 28 of file ScopedKernelState.h.
|
inlinenoexcept |
Definition at line 41 of file ScopedKernelState.h.
|
delete |
|
delete |
|
inline |
Apply a theta vector to the kernel state. theta = (log magn, log ls_1, ..., log ls_nls, log noise).
Definition at line 68 of file ScopedKernelState.h.
|
delete |
|
delete |
|
inlinenoexcept |
Restore the snapshot mid-scope. Called automatically by the dtor; exposed publicly so callers that need the snapshot's state side-effects (e.g. re-decomposing the covariance matrix at theta_star while still owning the guard) don't have to drop the guard. Idempotent.
Definition at line 51 of file ScopedKernelState.h.