26 switch (samplingAlgorithm) {
28 return "LOWER_UPPER_BETWEEN_SAMPLING";
35 switch (samplingAlgorithm) {
50 template<SamplingAlgorithm S>
63 template<IsSampleOuts
ideAlgorithm S>
76 std::vector<cadcells::datastructures::SampledDerivationRef<T>> derivationsVector;
77 auto iter = derivationsSet.begin();
78 while (iter != derivationsSet.end()) {
79 derivationsVector.push_back(*iter);
80 auto& last_cell = (*iter)->cell();
86 if (derivationsVector.empty()) {
92 if (!derivationsVector.front()->cell().lower_unbounded()) {
94 sample = carl::sample_below(derivationsVector.front()->cell().lower()->first);
98 if (!derivationsVector.back()->cell().upper_unbounded()) {
100 sample = carl::sample_above(derivationsVector.back()->cell().upper()->first);
105 for (
size_t i = 0; i + 1 < derivationsVector.size(); i++) {
107 if (!derivationsVector[i]->cell().upper_unbounded() && !derivationsVector[i + 1]->cell().lower_unbounded() &&
cadcells::datastructures::upper_lt_lower(derivationsVector[i]->cell(), derivationsVector[i + 1]->cell())) {
108 if (derivationsVector[i]->cell().upper()->first == derivationsVector[i + 1]->cell().lower()->first) {
109 sample = derivationsVector[i]->cell().upper()->first;
112 sample = carl::sample_between(derivationsVector[i]->cell().upper()->first, derivationsVector[i + 1]->cell().lower()->first);
128 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Checking if " << sample <<
" is outside of " << derivations);
130 if (derivations.empty()) {
131 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"No cells, so " << sample <<
" is outside");
135 for (
const auto& deriv : derivations) {
136 auto& cell = deriv->cell();
137 SMTRAT_LOG_DEBUG(
"smtrat.covering",
"Checking if " << sample <<
" is outside of " << cell);
138 SMTRAT_LOG_DEBUG(
"smtrat.covering",
" Lower unbounded " << cell.lower_unbounded() <<
" Upper unbounded " << cell.upper_unbounded());
141 if (cell.lower_unbounded() && cell.upper_unbounded()) {
144 }
else if (!cell.lower_unbounded() && cell.upper_unbounded()) {
146 if (sample > cell.lower()->first) {
149 }
else if (cell.lower_unbounded() && !cell.upper_unbounded()) {
151 if (sample < cell.upper()->first) {
156 if (cell.is_section()) {
159 if (cell.lower()->first <= sample && sample <= cell.upper()->first) {
165 if (cell.lower()->first < sample && sample < 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::shared_ptr< SampledDerivation< Properties > > SampledDerivationRef
Class to create the formulas for axioms.
std::string get_name(SamplingAlgorithm samplingAlgorithm)
@ LOWER_UPPER_BETWEEN_SAMPLING
#define SMTRAT_LOG_DEBUG(channel, msg)
static bool is_outside(const cadcells::RAN &sample, const std::set< cadcells::datastructures::SampledDerivationRef< T >, SampledDerivationRefCompare > &derivations)
static bool is_outside(const cadcells::RAN &sample, const std::set< cadcells::datastructures::SampledDerivationRef< T >, SampledDerivationRefCompare > &derivations)
static size_t sample_outside(cadcells::RAN &sample, const std::set< cadcells::datastructures::SampledDerivationRef< T >, SampledDerivationRefCompare > &derivationsSet)
static size_t sample_outside(cadcells::RAN &sample, const std::set< cadcells::datastructures::SampledDerivationRef< T >, SampledDerivationRefCompare > &derivations)