dReal4
brancher.h
1 #pragma once
2 
3 #include <utility>
4 
5 #include "dreal/util/box.h"
6 #include "dreal/util/dynamic_bitset.h"
7 
8 namespace dreal {
9 
10 /// Finds the dimension with the maximum diameter in a @p box. It only
11 /// consider the dimensions enabled in @p active_set.
12 ///
13 /// @returns a pair of (max dimension, variable index).
14 std::pair<double, int> FindMaxDiam(const Box& box,
15  const DynamicBitset& active_set);
16 
17 /// Finds the largest dimension in `active_set` and partitions `box`
18 /// into two sub-boxes by branching on the chosen dimension. It
19 /// traverses only the variables enabled by @p active_set, to find a
20 /// branching dimension.
21 ///
22 /// @param[in] box The box to branch.
23 /// @param[in] active_set A subset of dimensions of the input box that is active
24 /// in the given constraints.
25 /// @param[out] left The left sub-box.
26 /// @param[out] right The right sub-box.
27 ///
28 /// @returns the branching dimension if found, otherwise returns -1.
29 int BranchLargestFirst(const Box& box, const DynamicBitset& active_set,
30  Box* left, Box* right);
31 
32 } // namespace dreal
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
pair< double, int > FindMaxDiam(const Box &box, const DynamicBitset &active_set)
Finds the dimension with the maximum diameter in a box.
Definition: brancher.cc:11
int BranchLargestFirst(const Box &box, const DynamicBitset &active_set, Box *const left, Box *const right)
Finds the largest dimension in active_set and partitions box into two sub-boxes by branching on the c...
Definition: brancher.cc:28