4#include "bk_maxflow_impl/energy.h"
17 typedef Energy<T, T, T> EnergyT;
25 e =
new EnergyT(var_num_max, edge_num_max);
36 T E00, T E01, T E10, T E11)
override { e->add_term2(x, y, E00, E01, E10, E11); }
37 T
minimize()
override {
return e->minimize(); }
MaxFlowSolver backed by the Boykov–Kolmogorov max-flow algorithm.
Definition BKSolver.hpp:16
int get_var(typename MaxFlowSolver< T >::Var x) override
Definition BKSolver.hpp:38
void add_term2(typename MaxFlowSolver< T >::Var x, typename MaxFlowSolver< T >::Var y, T E00, T E01, T E10, T E11) override
Definition BKSolver.hpp:35
void add_term1(typename MaxFlowSolver< T >::Var x, T E0, T E1) override
Definition BKSolver.hpp:34
T minimize() override
Minimizes the energy and returns the minimum value.
Definition BKSolver.hpp:37
~BKSolver() override
Definition BKSolver.hpp:28
BKSolver(int var_num_max, int edge_num_max)
Constructs the solver with pre-allocated capacity.
Definition BKSolver.hpp:24
MaxFlowSolver< T >::Var add_variable() override
Introduces a new binary variable and returns its handle.
Definition BKSolver.hpp:32
void add_constant(T E) override
Adds a constant term to the energy function.
Definition BKSolver.hpp:33
Abstract interface for a binary max-flow / QPBO solver.
Definition MaxFlowSolver.hpp:15
int Var
Integer handle identifying a binary variable.
Definition MaxFlowSolver.hpp:20