30 for (
int i = 0; i < 5; ++i) {
32 sample.time =
static_cast<double>(i) * 0.5;
33 sample.meanX =
static_cast<double>(i);
37 if (history.
size() != 3u) {
38 error =
"bounded history did not trim to maximum size";
41 if (std::fabs(history.
samples().front().time - 1.0) > 1.0e-12 ||
42 std::fabs(history.
samples().back().time - 2.0) > 1.0e-12) {
43 error =
"bounded history kept the wrong sample range";
48 if (history.
size() != 2u ||
49 std::fabs(history.
samples().front().meanX - 3.0) > 1.0e-12) {
50 error =
"setMaximumSamples did not preserve newest samples";
55 if (!history.
empty()) {
56 error =
"clear did not empty the history";
61 }
catch (
const std::exception &e) {
Implements the Observables Time Series2D component.
void setMaximumSamples(std::size_t maximumSamples)
Sets maximum samples.
void clear() noexcept
Clears stored state and returns the component to its empty/default state.
std::size_t size() const noexcept
Returns size.
bool empty() const noexcept
Returns whether the object contains no data.
const std::vector< ObservablesTimeSeries2DSample > & samples() const noexcept
Samples s.
void append(const ObservablesTimeSeries2DSample &sample)
Carries out append.
bool runObservablesTimeSeries2DTests(std::string &error)
Runs observables time series2 d tests.
Declares the observablestimeseries2d physics/numerical component used by QPE experiments.
Declares regression and invariant tests for observablestimeseries2d tests.
Data record containing Observables Time Series2D Sample.