16 template<SamplingAlgorithm S>
18 template<
typename FE,
typename PropertiesSet>
25 template<
typename FE,
typename PropertiesSet>
29 std::vector<Interval<PropertiesSet>> derivs;
30 auto iter = intervals.begin();
31 while (iter != intervals.end()) {
32 derivs.push_back(*iter);
33 auto& last_cell = (*iter)->cell();
42 }
else if (!derivs.front()->cell().lower_unbounded()) {
44 return carl::sample_below(derivs.front()->cell().lower()->first);
45 }
else if (!derivs.back()->cell().upper_unbounded()) {
47 return carl::sample_above(derivs.back()->cell().upper()->first);
50 for (
size_t i = 0; i + 1 < derivs.size(); i++) {
53 if (derivs[i]->cell().upper()->first == derivs[i + 1]->cell().lower()->first) {
54 return derivs[i]->cell().upper()->first;
56 return carl::sample_between(derivs[i]->cell().upper()->first, derivs[i + 1]->cell().lower()->first);
69 template<
typename FE,
typename PropertiesSet>
71 std::vector<Interval<PropertiesSet>> derivs;
72 auto iter = intervals.begin();
73 while (iter != intervals.end()) {
74 derivs.push_back(*iter);
75 auto& last_cell = (*iter)->cell();
83 }
else if (!derivs.front()->cell().lower_unbounded()) {
84 return carl::sample_below(derivs.front()->cell().lower()->first);
85 }
else if (!derivs.back()->cell().upper_unbounded()) {
86 return carl::sample_above(derivs.back()->cell().upper()->first);
88 for (
size_t i = 0; i + 1 < derivs.size(); i++) {
90 if (derivs[i]->cell().upper()->first != derivs[i + 1]->cell().lower()->first) {
91 return carl::sample_between(derivs[i]->cell().upper()->first, derivs[i + 1]->cell().lower()->first);
95 for (
size_t i = 0; i + 1 < derivs.size(); i++) {
97 assert (derivs[i]->cell().upper()->first == derivs[i + 1]->cell().lower()->first);
98 return derivs[i]->cell().upper()->first;
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::set< Interval< PropertiesSet >, IntervalCompare< PropertiesSet > > IntervalSet
@ LOWER_UPPER_BETWEEN_SAMPLING
@ LOWER_UPPER_BETWEEN_SAMPLING_AVOID_RAN
@ LOWER_UPPER_BETWEEN_SAMPLING
static std::optional< cadcells::RAN > sample_outside(const IntervalSet< PropertiesSet > &intervals, const FE &)
static std::optional< cadcells::RAN > sample_outside(const IntervalSet< PropertiesSet > &intervals, const FE &)
static std::optional< cadcells::RAN > sample_outside(const IntervalSet< PropertiesSet > &derivations, const FE &f)