ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::RatioPolicy Struct Reference

the default recompute policy: from scratch when the net events exceed \( \rho \) times the size, a repair abandoned when its work exceeds \( \alpha \) times that of a computation from scratch or when an element is extracted again more than \( \beta \) times; the values that are not exact (floating point) summed again after \( \mathit{period} \) times the size of changes, by the compensated sum of Neumaier when asked More...

#include <ADS/Modification.h>

Public member functions

bool scratch (const ReoptStats &s) const
 whether to compute from scratch: \( e > \rho \max( n , 1 ) \), with \( e \) and \( n \) the events and the size of \( s \), and at the close of a batch only if early
bool abandon (const ReoptStats &s, double w) const
 whether to abandon the repair after the work \( w \): \( w > \alpha \) times the work of a scratch, or more than \( \beta > 0 \) reinsertions of one element
void record (int, double) const
 nothing: this policy keeps no history
bool refresh (std::size_t c, std::size_t n) const
 whether the values that are not exact are to be summed again after \( c \) changes of an instance of size \( n \): \( c \ge \mathit{period} \max( n , 1 ) \)

Public attributes

double rho = 0.25
 the ratio of the events to the size
double alpha = 0.5
 the ratio of the work to a scratch
int beta = 0
 the reinsertions of one element, 0 off
bool early = false
 whether scratch() acts at the close of
double period = 1
 the changes between two sums, in units
bool compensated = false
 whether the sums are compensated

Detailed description

the default recompute policy: from scratch when the net events exceed \( \rho \) times the size, a repair abandoned when its work exceeds \( \alpha \) times that of a computation from scratch or when an element is extracted again more than \( \beta \) times; the values that are not exact (floating point) summed again after \( \mathit{period} \) times the size of changes, by the compensated sum of Neumaier when asked

Member function documentation

◆ abandon()

bool ADS::RatioPolicy::abandon ( const ReoptStats & s,
double w ) const
inlinenodiscard

whether to abandon the repair after the work \( w \): \( w > \alpha \) times the work of a scratch, or more than \( \beta > 0 \) reinsertions of one element

◆ record()

void ADS::RatioPolicy::record ( int ,
double  ) const
inline

nothing: this policy keeps no history

◆ refresh()

bool ADS::RatioPolicy::refresh ( std::size_t c,
std::size_t n ) const
inlinenodiscard

whether the values that are not exact are to be summed again after \( c \) changes of an instance of size \( n \): \( c \ge \mathit{period} \max( n , 1 ) \)

◆ scratch()

bool ADS::RatioPolicy::scratch ( const ReoptStats & s) const
inlinenodiscard

whether to compute from scratch: \( e > \rho \max( n , 1 ) \), with \( e \) and \( n \) the events and the size of \( s \), and at the close of a batch only if early

Member data documentation

◆ alpha

double ADS::RatioPolicy::alpha = 0.5

the ratio of the work to a scratch

◆ beta

int ADS::RatioPolicy::beta = 0

the reinsertions of one element, 0 off

◆ compensated

bool ADS::RatioPolicy::compensated = false

whether the sums are compensated

◆ early

bool ADS::RatioPolicy::early = false

whether scratch() acts at the close of

a batch, which then sends Rebuilt

◆ period

double ADS::RatioPolicy::period = 1

the changes between two sums, in units

of the size, 0 never

◆ rho

double ADS::RatioPolicy::rho = 0.25

the ratio of the events to the size


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