4 std::vector<datastructures::SampledDerivationRef<T>> sorted_derivs;
5 for (
auto& der : derivs) sorted_derivs.emplace_back(der);
8 const auto& cell1 = p_cell1->cell();
9 const auto& cell2 = p_cell2->cell();
10 return lower_lt_lower(cell1, cell2) || (lower_eq_lower(cell1, cell2) && upper_lt_upper(cell2, cell1));
13 std::vector<datastructures::SampledDerivationRef<T>> min_derivs;
14 auto iter = sorted_derivs.begin();
15 while (iter != sorted_derivs.end()) {
16 min_derivs.emplace_back(*iter);
17 auto& last_cell = (*iter)->cell();
19 while (iter != sorted_derivs.end() && !
upper_lt_upper(last_cell, (*iter)->cell())) iter++;
28 for (
auto it = cells.begin(); it != cells.end()-1; it++) {
29 if (enable_weak && (!std::next(it)->description.lower().is_strict() || !it->description.upper().is_strict())) {
30 ordering.
add_leq(std::next(it)->description.lower().value(), it->description.upper().value());
32 if (std::next(it)->description.lower().value() == it->description.upper().value()) {
33 ordering.
add_eq(std::next(it)->description.lower().value(), it->description.upper().value());
35 ordering.
add_less(std::next(it)->description.lower().value(), it->description.upper().value());
49 for (
auto& iter : min_derivs) {
51 result.cells.emplace_back(cell_result);
64 for (
auto& iter : min_derivs) {
66 result.cells.emplace_back(cell_result);
81 for (
auto& iter : min_derivs) {
83 result.cells.emplace_back(cell_result);
98 for (
auto& iter : min_derivs) {
100 result.cells.emplace_back(cell_result);
101 tmp_ordering = cell_result.
ordering;
114 for (
auto& iter : min_derivs) {
116 result.cells.emplace_back(cell_result);
119 result.ordering.set_projective();
130 for (
auto& iter : min_derivs) {
132 result.cells.emplace_back(cell_result);
145 for (
auto& iter : min_derivs) {
147 result.cells.emplace_back(cell_result);
158 auto cell_a = a->cell();
159 auto cell_b = b->cell();
167 if (set.empty())
return false;
168 auto current_max = set.end();
169 for (
auto iter = set.begin(); iter != set.end(); iter++) {
170 if (current_max == set.end()) {
171 if ((*iter)->cell().lower_unbounded()) {
186 return (*current_max)->cell().upper_unbounded();
199 std::vector<Data> sorted_by_tdeg;
200 for (
auto& deriv : derivs) {
201 std::size_t tdeg = 0;
202 for (
const auto& e : deriv->delin().roots()) {
203 for (
const auto& e2 : e.second) {
204 tdeg = std::max(tdeg, deriv->proj().total_degree(e2.root.poly));
207 bool nullified = deriv->cell().is_sector() && !deriv->delin().nullified().empty();
208 sorted_by_tdeg.push_back(Data{deriv, tdeg, nullified});
210 std::sort(sorted_by_tdeg.begin(), sorted_by_tdeg.end(), [](
const Data& a,
const Data& b) {
211 return (a.nullified && !b.nullified) || (a.nullified == b.nullified && a.tdeg > b.tdeg);
214 for (
const auto& e : sorted_by_tdeg) {
222 for (
auto& deriv : set) {
224 result.cells.emplace_back(cell_result);
241 std::vector<std::size_t> ord_idx;
242 for (
auto& iter : min_derivs) {
243 result.cells.emplace_back(iter);
244 auto& cell_result =
result.cells.back();
247 if ((iter)->
cell().is_section()) {
251 ord_idx.push_back(
result.cells.size()-1);
253 auto subdelin_int = subdelin.
delineate_cell((iter)->main_var_sample());
259 assert (ord_idx.size() > 0);
260 auto& proj = (*min_derivs.begin())->proj();
262 for (
const auto& poly_delin : poly_delins.
data) {
265 for (std::size_t idx : ord_idx) {
Represents the delineation of a set of polynomials (at a sample), that is.
void merge_with(const Delineation &other)
void add_root(RAN root, TaggedIndexedRoot tagged_root)
auto delineate_cell(const RAN &sample) const
Computes the bounds of the interval around the given sample w.r.t.
Describes an ordering of IndexedRoots.
void add_eq(RootFunction first, RootFunction second)
void add_leq(RootFunction first, RootFunction second)
void add_less(RootFunction first, RootFunction second)
void sort(T *array, int size, LessThan lt)
bool upper_lt_upper(const DelineationInterval &del1, const DelineationInterval &del2)
Compares the upper bounds of two DelineationIntervals.
bool lower_lt_lower(const DelineationInterval &del1, const DelineationInterval &del2)
Compares the lower bounds of two DelineationIntervals.
bool upper_lt_lower(const DelineationInterval &del1, const DelineationInterval &del2)
Compares an upper bound with a lower bound of DelineationIntervals.
bool lower_eq_lower(const DelineationInterval &del1, const DelineationInterval &del2)
Compares the lower bounds of two DelineationIntervals.
std::shared_ptr< SampledDerivation< Properties > > SampledDerivationRef
void chain_ordering(const datastructures::PolyRef poly, const PolyDelineation &poly_delin, datastructures::IndexedRootOrdering &ordering)
void simplest_chain_ordering(datastructures::Projections &proj, const datastructures::Delineation &delin, datastructures::IndexedRootOrdering &ordering, bool enable_weak=false)
bool is_covering(const DerivationSet< T > &set)
datastructures::SymbolicInterval compute_simplest_cell(datastructures::Projections &proj, const datastructures::DelineationInterval &del, bool enable_weak=false)
boost::container::flat_set< datastructures::SampledDerivationRef< T >, IntervalCompare< T > > DerivationSet
void decompose(datastructures::Delineation &delin, const datastructures::DelineationInterval &delin_interval, PolyDelineations &poly_delins)
Heuristics for computing representations.
std::vector< datastructures::SampledDerivationRef< T > > compute_min_derivs(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
void handle_section_all_equational(const datastructures::Delineation &delin, datastructures::CellRepresentation< T > &response)
datastructures::CellRepresentation< T > compute_cell_lowest_degree_barriers(datastructures::SampledDerivationRef< T > &der, LocalDelMode ldel_mode=LocalDelMode::NONE, bool enable_weak=false, bool use_global_cache=false, datastructures::IndexedRootOrdering global_ordering=datastructures::IndexedRootOrdering())
datastructures::IndexedRootOrdering compute_default_ordering(const std::vector< datastructures::CellRepresentation< T >> &cells, bool enable_weak=false)
@ BIGGEST_CELL_COVERING_FILTER_ONLY_INDEPENDENT
@ LDB_COVERING_CACHE_GLOBAL
@ BIGGEST_CELL_COVERING_MIN_TDEG
@ BIGGEST_CELL_COVERING_PDEL
@ BIGGEST_CELL_COVERING_FILTER
IndexedRootOrdering ordering
An ordering on the roots that protects the cell.
Represents a covering over a cell.
Note: If connected(i) holds, then the indexed root ordering must contain an ordering between the inte...
static datastructures::CellRepresentation< T > compute(datastructures::SampledDerivationRef< T > &der)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
static datastructures::CoveringRepresentation< T > compute(const std::vector< datastructures::SampledDerivationRef< T >> &derivs)
constexpr bool operator()(const datastructures::SampledDerivationRef< T > &a, const datastructures::SampledDerivationRef< T > &b) const
boost::container::flat_map< datastructures::PolyRef, PolyDelineation > data