Loading...
Searching...
No Matches
gpr::linalg::linop::DenseResultCache Class Reference

#include <gpr/linalg/linop/CovarianceSolver.h>

Public Member Functions

const EigenMatrix * inverse (const EigenMatrix &factor) const
void storeInverse (const EigenMatrix &factor, const EigenMatrix &inverse)
void clear ()
long inverseEvaluations () const noexcept
 Evaluations that missed, for tests.

Detailed Description

Results of the dense backend for the factor they were computed from. A hit requires the factor to be equal entry for entry, so a hit returns the bits a recomputation would. Only the inverse is kept: the entry compare costs O(n^2) per call, which an O(n^3) inverse repays and a variance diagonal, already cached upstream by the variance solve, does not.

Definition at line 72 of file CovarianceSolver.h.

Member Function Documentation

◆ clear()

void gpr::linalg::linop::DenseResultCache::clear ( )

Definition at line 59 of file CovarianceSolver.cpp.

60{
61 inverse_factor_.resize(0, 0);
62 inverse_.resize(0, 0);
63 inverse_valid_ = false;
64}

◆ inverse()

const EigenMatrix * gpr::linalg::linop::DenseResultCache::inverse ( const EigenMatrix & factor) const
nodiscard

Definition at line 38 of file CovarianceSolver.cpp.

39{
40 return factor.size() != 0 && inverse_valid_ &&
41 sameEntries(factor, inverse_factor_)
42 ? &inverse_
43 : nullptr;
44}

◆ inverseEvaluations()

long gpr::linalg::linop::DenseResultCache::inverseEvaluations ( ) const
inlinenodiscardnoexcept

Evaluations that missed, for tests.

Definition at line 79 of file CovarianceSolver.h.

80 {
81 return inverse_evaluations_;
82 }

◆ storeInverse()

void gpr::linalg::linop::DenseResultCache::storeInverse ( const EigenMatrix & factor,
const EigenMatrix & inverse )

Definition at line 46 of file CovarianceSolver.cpp.

48{
49 ++inverse_evaluations_;
50 if (factor.size() == 0) {
51 inverse_valid_ = false;
52 return;
53 }
54 inverse_factor_ = factor;
55 inverse_ = inverse;
56 inverse_valid_ = true;
57}
const EigenMatrix * inverse(const EigenMatrix &factor) const

The documentation for this class was generated from the following files: