6 #include <boost/container/flat_set.hpp>
44 std::vector<CellRepresentation<P>>
cells;
51 for (
const auto& cell :
cells) {
52 cov.
add(cell.description);
58 std::vector<SampledDerivationRef<P>> cov;
59 for (
const auto& cell :
cells) {
60 cov.push_back(cell.derivation);
67 auto cell =
cells.begin();
70 if (!cell->derivation->cell().lower_unbounded())
return false;
71 while (cell != std::prev(
cells.end())) {
73 if (std::prev(cell)->derivation->cell().upper_unbounded())
return false;
74 if (cell->derivation->cell().lower_unbounded())
return false;
75 if (
upper_lt_lower(std::prev(cell)->derivation->cell(), cell->derivation->cell()))
return false;
77 if (!cell->derivation->cell().upper_unbounded())
return false;
81 while (cell != std::prev(
cells.end())) {
83 if (std::prev(cell)->derivation->cell().upper_unbounded())
return false;
84 if (cell->derivation->cell().lower_unbounded())
return false;
85 if (cell->derivation->cell().upper_unbounded())
continue;
86 if (
upper_lt_upper(cell->derivation->cell(), std::prev(cell)->derivation->cell()))
return false;
95 os <<
"(cells: " << data.
cells <<
", ordering: " << data.
ordering <<
")";
Describes a covering of the real line by SymbolicIntervals (given an appropriate sample).
void add(const SymbolicInterval &c)
Add a SymbolicInterval to the covering.
Describes an ordering of IndexedRoots.
A symbolic interal whose bounds are defined by indexed root expressions.
std::ostream & operator<<(std::ostream &os, const TaggedIndexedRoot &data)
bool upper_lt_upper(const DelineationInterval &del1, const DelineationInterval &del2)
Compares the upper bounds of two DelineationIntervals.
bool upper_lt_lower(const DelineationInterval &del1, const DelineationInterval &del2)
Compares an upper bound with a lower bound of DelineationIntervals.
std::shared_ptr< SampledDerivation< Properties > > SampledDerivationRef
IndexedRootOrdering ordering
An ordering on the roots that protects the cell.
boost::container::flat_set< PolyRef > ordering_polys
Polys considered in the indexed root ordering.
SymbolicInterval description
Description of a cell.
boost::container::flat_set< PolyRef > equational
Polynomials that should be projected using the equational constraints projection.
boost::container::flat_set< PolyRef > ordering_non_projective_polys
Polys that are considered "non-projectively" in the ordering.
CellRepresentation(SampledDerivationRef< P > &deriv)
SampledDerivationRef< P > derivation
Derivation.
Represents a covering over a cell.
IndexedRootOrdering ordering
An ordering on the roots for the cell boundaries mainting the covering.
std::vector< CellRepresentation< P > > cells
Cells of the covering in increasing order and no cell is contained in another cell.
CoveringDescription get_covering() const
Returns a descriptions of the covering.
std::vector< SampledDerivationRef< P > > sampled_derivations()
Returns the derivations.
bool is_valid() const
Checks whether this represents a proper non-redundant covering.