本文整理汇总了C++中box::get_values方法的典型用法代码示例。如果您正苦于以下问题:C++ box::get_values方法的具体用法?C++ box::get_values怎么用?C++ box::get_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类box
的用法示例。
在下文中一共展示了box::get_values方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: integer_pruning
void tilingInterpolation::integer_pruning(box const & old_box, box const & new_box, int i) {
Enode * it;
//TODO what about shared ? should we rather take the projections
if (is_a_var(i)) {
it = make_false();
} else {
assert(is_b_var(i));
it = make_true();
}
if (new_box.get_values()[i].is_empty()) {
//if the new box is empty then we have a leaf
push_partial_interpolant(it);
proof_size += 1;
} else {
//we need to figure out what parts are pruned
auto const fst_value = old_box.get_value(i);
auto const snd_value = new_box.get_value(i);
//pruning on the lower end
if (fst_value.lb() < snd_value.lb()) {
std::tuple<bool,int,double,bool> pivot(false, i, snd_value.lb(), false);
split_stack.push(pivot);
push_partial_interpolant(it);
proof_size += 1;
}
//pruning on the upper end
if (fst_value.ub() > snd_value.ub()) {
std::tuple<bool,int,double,bool> pivot(true, i, snd_value.ub(), false);
split_stack.push(pivot);
push_partial_interpolant(it);
proof_size += 1;
}
}
}
示例2: prune
box contractor_int::prune(box b, SMTConfig & config) const {
// ======= Proof =======
thread_local static box old_box(b);
if (config.nra_proof) { old_box = b; }
m_input = ibex::BitSet::empty(b.size());
m_output = ibex::BitSet::empty(b.size());
unsigned i = 0;
ibex::IntervalVector & iv = b.get_values();
for (Enode * e : b.get_vars()) {
if (e->hasSortInt()) {
auto old_iv = iv[i];
iv[i] = ibex::integer(iv[i]);
if (old_iv != iv[i]) {
m_input.add(i);
m_output.add(i);
}
if (iv[i].is_empty()) {
b.set_empty();
break;
}
}
i++;
}
// ======= Proof =======
if (config.nra_proof) {
output_pruning_step(config.nra_proof_out, old_box, b, config.nra_readable_proof, "integer pruning");
}
return b;
}
示例3: sample_point
box sample_point(box b) {
static thread_local std::mt19937_64 rg(std::chrono::system_clock::now().time_since_epoch().count());
unsigned const n = b.size();
ibex::IntervalVector & values = b.get_values();
for (unsigned i = 0; i < n; i++) {
ibex::Interval & iv = values[i];
double const lb = iv.lb();
double const ub = iv.ub();
if (lb != ub) {
std::uniform_real_distribution<double> m_dist(lb, ub);
iv = ibex::Interval(m_dist(rg));
}
}
return b;
}