当前位置: 首页>>代码示例>>C++>>正文


C++ box::get_values方法代码示例

本文整理汇总了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;
        }
    }
}
开发者ID:dzufferey,项目名称:dreal3,代码行数:33,代码来源:tilingInterpolation.cpp

示例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;
}
开发者ID:kquine,项目名称:dreal3,代码行数:31,代码来源:contractor_basic.cpp

示例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;
}
开发者ID:kquine,项目名称:dreal3,代码行数:15,代码来源:box.cpp


注:本文中的box::get_values方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。