Loading...
Searching...
No Matches
ExactSchur.h File Reference

Correctly rounded Schur-complement diagonals from Cholesky solves. More...

#include <Eigen/Core>
#include <Eigen/Dense>
#include <algorithm>
#include <atomic>
#include <cmath>
#include <limits>
#include <stdexcept>
#include "../../backend/Macros.h"
#include "ExactSum.h"

Go to the source code of this file.

Classes

class  gpr::linalg::StableVarianceError
 Raised when a stable posterior variance is not finite, is materially negative, or its operands do not match. More...

Namespaces

namespace  gpr
 Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
namespace  gpr::linalg
 Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection.

Functions

void gpr::linalg::configureStablePosteriorVariance (bool enabled) noexcept
 Turn stable posterior variance reductions on or off for the process.
bool gpr::linalg::stablePosteriorVarianceEnabled () noexcept
 Whether stable posterior variance reductions are enabled.
bool gpr::linalg::acceptStablePosteriorVariance (double &variance, double signal_variance, double relative_allowance) noexcept
 Accept one stable posterior variance.
bool gpr::linalg::acceptStablePosteriorVariance (double &variance, double signal_variance) noexcept
 acceptStablePosteriorVariance with the compensated-sum allowance.
bool gpr::linalg::acceptStablePosteriorVariance (Eigen::VectorXd &variance, const Eigen::VectorXd &signal) noexcept
 Accept every entry of a stable posterior variance vector.
void gpr::linalg::requireStablePosteriorVariance (double &variance, double signal_variance, double relative_allowance)
 Accept one stable posterior variance or throw.
void gpr::linalg::requireStablePosteriorVariance (double &variance, double signal_variance)
void gpr::linalg::requireStablePosteriorVariance (Eigen::VectorXd &variance, const Eigen::VectorXd &signal)
 Accept every entry of a stable posterior variance vector or throw.
template<typename RelativeError>
void gpr::linalg::requireStableSchurDiagonal (Eigen::VectorXd &variance, const Eigen::VectorXd &signal, RelativeError &&relative_error)
 requireStablePosteriorVariance over a Schur diagonal whose allowance is the forward error of a solve.
template<typename Solve, typename SolveTranspose>
double gpr::linalg::estimateLowerInverseNorm1 (Eigen::Index order, Solve &&solve, SolveTranspose &&solve_transpose)
 Estimate of ||L^-1||_1 for a lower triangular L (Hager, with Higham's alternating-sign probe).
double gpr::linalg::choleskySchurRelativeError (Eigen::Index order, double factor_frobenius_norm, double inverse_norm1) noexcept
 Relative forward error of a Schur complement computed from a rounded Cholesky factor and triangular solve.
double gpr::linalg::upperInverseNorm1FromComputed (double computed_norm, Eigen::Index order) noexcept
 Upper bound on ||L^-1||_1 from a computed inverse's 1-norm.
double gpr::linalg::upperInverseNorm1FromResidual (double computed_norm, double residual_norm, double factor_abs_norm, Eigen::Index order) noexcept
 Upper bound on ||L^-1||_1 from a computed triangular solve.
template<typename Derived>
double gpr::linalg::upperInverseNorm1 (const Eigen::MatrixBase< Derived > &factor)
 Upper bound on ||L^-1||_1 for an explicit lower-triangular factor.
template<typename Derived>
double gpr::linalg::denseCholeskySchurRelativeError (const Eigen::MatrixBase< Derived > &factor)
 choleskySchurRelativeError of a dense lower Cholesky factor.
template<typename Backend, typename Derived>
double gpr::linalg::subsetFactorSchurRelativeError (Backend &backend, const Eigen::MatrixBase< Derived > &factor, int order)
template<typename Derived, typename RelativeError>
Eigen::VectorXd gpr::linalg::borderedCholeskyDiagonalWith (const Eigen::VectorXd &prior, const Eigen::MatrixBase< Derived > &whitened, RelativeError &&relative_error)
 Squared final pivots of bordered Cholesky factorizations.
template<typename Derived>
Eigen::VectorXd gpr::linalg::borderedCholeskyDiagonal (const Eigen::VectorXd &prior, const Eigen::MatrixBase< Derived > &whitened)
 borderedCholeskyDiagonal for a whitened block L^-1 K_tq with no factor in hand: the allowance is the rounding of the compensated sum alone.
template<typename Derived, typename FactorDerived>
Eigen::VectorXd gpr::linalg::borderedCholeskyDiagonal (const Eigen::VectorXd &prior, const Eigen::MatrixBase< Derived > &whitened, const Eigen::MatrixBase< FactorDerived > &factor)
 borderedCholeskyDiagonal for W = L^-1 K_tq solved with the dense lower factor factor; the allowance is choleskySchurRelativeError of that factor.
template<typename PriorDerived, typename WeightDerived, typename SolvedDerived, typename RelativeError>
double gpr::linalg::borderedCholeskyActionVarianceWith (const Eigen::MatrixBase< PriorDerived > &prior, const Eigen::MatrixBase< WeightDerived > &weights, const Eigen::MatrixBase< SolvedDerived > &whitened_action, RelativeError &&relative_error)
 Variance of a linear query action from its bordered Cholesky solve.
template<typename PriorDerived, typename WeightDerived, typename SolvedDerived>
double gpr::linalg::borderedCholeskyActionVariance (const Eigen::MatrixBase< PriorDerived > &prior, const Eigen::MatrixBase< WeightDerived > &weights, const Eigen::MatrixBase< SolvedDerived > &whitened_action)
 borderedCholeskyActionVariance with the compensated-sum allowance.
template<typename PriorDerived, typename WeightDerived, typename SolvedDerived, typename FactorDerived>
double gpr::linalg::borderedCholeskyActionVariance (const Eigen::MatrixBase< PriorDerived > &prior, const Eigen::MatrixBase< WeightDerived > &weights, const Eigen::MatrixBase< SolvedDerived > &whitened_action, const Eigen::MatrixBase< FactorDerived > &factor)
 borderedCholeskyActionVariance for L^-1 K_tq w solved with the dense lower factor factor, with the allowance of choleskySchurRelativeError.

Variables

std::atomic_bool gpr::linalg::stable_posterior_variance {false}
 Process-wide switch for stable posterior variance reductions. Off by default; set through configureStablePosteriorVariance.
constexpr int gpr::linalg::kStablePosteriorVarianceRoundoffUlps = 4
 Ulps of the signal variance that a compensated posterior variance may sit below zero.

Detailed Description

Correctly rounded Schur-complement diagonals from Cholesky solves.

Definition in file ExactSchur.h.