1 #ifndef OPENGM_LINEAR_CONSTRAINT_FUNCTION_BASE_HXX_
2 #define OPENGM_LINEAR_CONSTRAINT_FUNCTION_BASE_HXX_
11 template <
typename LINEAR_CONSTRAINT_FUNCTION_TYPE>
14 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
15 class LinearConstraintFunctionBase :
public FunctionBase<LINEAR_CONSTRAINT_FUNCTION_TYPE, typename LinearConstraintFunctionTraits<LINEAR_CONSTRAINT_FUNCTION_TYPE>::ValueType, typename LinearConstraintFunctionTraits<LINEAR_CONSTRAINT_FUNCTION_TYPE>::IndexType, typename LinearConstraintFunctionTraits<LINEAR_CONSTRAINT_FUNCTION_TYPE>::LabelType> {
20 typedef typename LinearConstraintFunctionTraitsType::ValueType
ValueType;
21 typedef typename LinearConstraintFunctionTraitsType::IndexType
IndexType;
22 typedef typename LinearConstraintFunctionTraitsType::LabelType
LabelType;
35 template <
class LABEL_ITERATOR>
36 void challenge(ViolatedLinearConstraintsIteratorType& violatedConstraintsBegin, ViolatedLinearConstraintsIteratorType& violatedConstraintsEnd, ViolatedLinearConstraintsWeightsIteratorType& violatedConstraintsWeightsBegin, LABEL_ITERATOR labelingBegin,
const ValueType tolerance = 0.0)
const;
37 template <
class LABEL_ITERATOR>
38 void challengeRelaxed(ViolatedLinearConstraintsIteratorType& violatedConstraintsBegin, ViolatedLinearConstraintsIteratorType& violatedConstraintsEnd, ViolatedLinearConstraintsWeightsIteratorType& violatedConstraintsWeightsBegin, LABEL_ITERATOR labelingBegin,
const ValueType tolerance = 0.0)
const;
250 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
255 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
260 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
265 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
270 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
271 template <
class LABEL_ITERATOR>
273 return static_cast<const LinearConstraintFunctionType*
>(
this)->challenge_impl(violatedConstraintsBegin, violatedConstraintsEnd, violatedConstraintsWeightsBegin, labelingBegin, tolerance);
276 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
277 template <
class LABEL_ITERATOR>
279 return static_cast<const LinearConstraintFunctionType*
>(
this)->challengeRelaxed_impl(violatedConstraintsBegin, violatedConstraintsEnd, violatedConstraintsWeightsBegin, labelingBegin, tolerance);
282 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
LinearConstraintFunctionTraitsType::ViolatedLinearConstraintsWeightsIteratorType ViolatedLinearConstraintsWeightsIteratorType
Typedef of the violated linear constraints weights iterator type used by the linear constraint functi...
void challenge(ViolatedLinearConstraintsIteratorType &violatedConstraintsBegin, ViolatedLinearConstraintsIteratorType &violatedConstraintsEnd, ViolatedLinearConstraintsWeightsIteratorType &violatedConstraintsWeightsBegin, LABEL_ITERATOR labelingBegin, const ValueType tolerance=0.0) const
Challenge the linear constraint function and get all linear constraints which are violated by a given...
Fallback implementation of member functions of OpenGM functions.
IndicatorVariablesIteratorType indicatorVariablesOrderBegin() const
Get the begin iterator to the set of indicator variables used by the linear constraint function...
LinearConstraintsIteratorType linearConstraintsBegin() const
Get the begin iterator to the set of linear constraints represented by the linear constraint function...
bool isLinearConstraint() const
Function specialization for each linear constraint function.
void challengeRelaxed(ViolatedLinearConstraintsIteratorType &violatedConstraintsBegin, ViolatedLinearConstraintsIteratorType &violatedConstraintsEnd, ViolatedLinearConstraintsWeightsIteratorType &violatedConstraintsWeightsBegin, LABEL_ITERATOR labelingBegin, const ValueType tolerance=0.0) const
Challenge the linear constraint function and get all linear constraints which are violated by a given...
LinearConstraintFunctionTraits< LinearConstraintFunctionType > LinearConstraintFunctionTraitsType
Typedef of the LinearConstraintFunctionTraits class with appropriate template parameter.
IndicatorVariablesIteratorType indicatorVariablesOrderEnd() const
Get the end iterator to the set of indicator variables used by the linear constraint function...
LinearConstraintFunctionTraitsType::LinearConstraintsIteratorType LinearConstraintsIteratorType
Typedef of the linear constraints iterator type used by the linear constraint function to iterate ove...
Base class for linear constraint functions.
Traits class for linear constraint functions.
LinearConstraintFunctionTraitsType::IndexType IndexType
Typedef of the index type used by the linear constraint function.
LinearConstraintFunctionTraitsType::LabelType LabelType
Typedef of the label type used by the linear constraint function.
LinearConstraintsIteratorType linearConstraintsEnd() const
Get the end iterator to the set of linear constraints represented by the linear constraint function...
LinearConstraintFunctionTraitsType::ViolatedLinearConstraintsIteratorType ViolatedLinearConstraintsIteratorType
Typedef of the violated linear constraints iterator type used by the linear constraint function to it...
LINEAR_CONSTRAINT_FUNCTION_TYPE LinearConstraintFunctionType
Typedef of the LINEAR_CONSTRAINT_FUNCTION_TYPE template parameter from the class LinearConstraintFunc...
LinearConstraintFunctionTraitsType::LinearConstraintType LinearConstraintType
Typedef of the linear constraint type used by the linear constraint function.
LinearConstraintFunctionTraitsType::ValueType ValueType
Typedef of the value type used by the linear constraint function.
LinearConstraintFunctionTraitsType::IndicatorVariablesIteratorType IndicatorVariablesIteratorType
Typedef of the indicator variables iterator type used by the linear constraint function to iterate ov...