|
| | BKSolver (int var_num_max, int edge_num_max) |
| | Constructs the solver with pre-allocated capacity.
|
| |
| | ~BKSolver () override |
| |
| MaxFlowSolver< T >::Var | add_variable () override |
| | Introduces a new binary variable and returns its handle.
|
| |
| void | add_constant (T E) override |
| | Adds a constant term to the energy function.
|
| |
| void | add_term1 (typename MaxFlowSolver< T >::Var x, T E0, T E1) override |
| |
| void | add_term2 (typename MaxFlowSolver< T >::Var x, typename MaxFlowSolver< T >::Var y, T E00, T E01, T E10, T E11) override |
| |
| T | minimize () override |
| | Minimizes the energy and returns the minimum value.
|
| |
| int | get_var (typename MaxFlowSolver< T >::Var x) override |
| |
| virtual | ~MaxFlowSolver ()=default |
| |
| virtual void | add_term1 (Var x, T E0, T E1)=0 |
| | Adds a unary term E(x) where x ∈ {0, 1}.
|
| |
| virtual void | add_term2 (Var x, Var y, T E00, T E01, T E10, T E11)=0 |
| | Adds a pairwise term E(x, y) where x, y ∈ {0, 1}.
|
| |
| virtual int | get_var (Var x)=0 |
| | Returns the optimal value of variable x (0 or 1) after minimize().
|
| |
template<typename T>
class BKSolver< T >
MaxFlowSolver backed by the Boykov–Kolmogorov max-flow algorithm.
This solver wraps the original BK implementation by Yuri Boykov and Vladimir Kolmogorov. It is the default solver and is available in all builds.
License note: The underlying BK implementation is restricted to non-commercial, research use only. See the project README for details.
- Template Parameters
-
| T | Numeric cost type (int32_t, float, or double). |