Loading...
Searching...
No Matches
gpr::optim::MinimumSpectrumCache Struct Reference

#include <gpr/optimization/EndpointConnectivity.h>

Classes

struct  Key
struct  Hash

Public Member Functions

bool recall (const Eigen::VectorXd &position, EndpointSpectrum &out) const
void store (const Eigen::VectorXd &position, const EndpointSpectrum &spectrum)

Public Attributes

std::unordered_map< Key, EndpointSpectrum, Hash > spectra

Detailed Description

A minimum spectrum cached by the exact coordinate bytes. Matching coordinates return the stored spectrum without another stencil.

Definition at line 753 of file EndpointConnectivity.h.

Member Function Documentation

◆ recall()

bool gpr::optim::MinimumSpectrumCache::recall ( const Eigen::VectorXd & position,
EndpointSpectrum & out ) const
inline

Definition at line 781 of file EndpointConnectivity.h.

782 {
783 const auto found = spectra.find(Key{position});
784 if (found == spectra.end()) return false;
785 out = found->second;
786 return out.ok;
787 }
eon_relax_band_t eon_relax_surface_fn void eon_relax_outcome_t * out
std::unordered_map< Key, EndpointSpectrum, Hash > spectra

◆ store()

void gpr::optim::MinimumSpectrumCache::store ( const Eigen::VectorXd & position,
const EndpointSpectrum & spectrum )
inline

Definition at line 789 of file EndpointConnectivity.h.

791 {
792 if (!spectrum.ok || position.size() == 0 || !position.allFinite())
793 return;
794 spectra.emplace(Key{position}, spectrum);
795 }

Member Data Documentation

◆ spectra

std::unordered_map<Key, EndpointSpectrum, Hash> gpr::optim::MinimumSpectrumCache::spectra

Definition at line 779 of file EndpointConnectivity.h.


The documentation for this struct was generated from the following file: