#include #include #include #include "dpf.hpp" /// Every input of the domain, from `numeric_limits::min()` through /// `max()`. Same shape as `eval_interval`. int main() { const std::uint8_t alpha = 42; const std::uint64_t beta = 7; auto [k0, k1] = dpf::make_dpf(alpha, beta); //! [eval-full] auto [buf0, iter0] = dpf::eval_full(k0); auto [buf1, iter1] = dpf::eval_full(k1); auto it0 = std::begin(iter0); auto it1 = std::begin(iter1); for (int x = std::numeric_limits::min(); x <= std::numeric_limits::max(); ++x, ++it0, ++it1) { std::uint64_t got = dpf::reconstruct(*it0, *it1); std::uint64_t expect = (static_cast(x) == alpha) ? beta : 0; if (got != expect) { std::cerr << "eval_full\n"; return 1; } } //! [eval-full] if (it0 != std::end(iter0) || it1 != std::end(iter1)) { std::cerr << "eval_full length\n"; return 1; } std::cout << beta << "\n"; (void)buf0; (void)buf1; return 0; }