2026-09-26 23:51:06 -06:00
# Comparisons & ranges {#comparisons}
2026-09-28 05:59:19 -06:00
\htmlonly
< div class = "eli5" > < b > ELI5.< / b > The predicate is part of the key, not a test you run after expanding a point key. Greater-than, less-than, and equality each return one payload on the true side and another on the false side. Interval containment is one key for both endpoints. Shares of a comparison add.< / div >
\endhtmlonly
2026-09-26 23:51:06 -06:00
A distributed comparison function returns a payload when a predicate holds
on the secret point. Shares are additive: `reconstruct` adds them.
| Call | When it is hot |
| --- | --- |
| `dpf::lt` / `leq` / `gt` / `geq` | The public query is on that side of the secret point |
| `dpf::eq` | The public query equals the secret point |
| `dpf::ic` | The secret point lies in a public interval |
| `dpf::idcf` / `cmp_prefix<L>` | A correction at every depth, or only the first `L` bits |
| `dpf::block_width<B>` | Ring words only at checkpoints `B` levels apart |
```cpp
auto [k0, k1] = dpf::make_dpf(std::uint8_t{40}, dpf::gt(std::uint64_t{1}));
auto opened = dpf::reconstruct(
dpf::eval_point(dpf::cmp, k0, std::uint8_t{50}),
dpf::eval_point(dpf::cmp, k1, std::uint8_t{50}));
// opened == 1
```
A wildcard comparison payload is filled later with `assign_cmp` .
Eval before that throws.
**Go deeper:** [dcf.hpp ](@ref dpf/dcf.hpp ), [interval.hpp ](@ref dpf/interval.hpp ),
[blocked_dcf.hpp ](@ref dpf/blocked_dcf.hpp ), [F_DCF ](@ref dcf.hpp ).