1 #ifndef OPENGM_LINEAR_CONSTRAINT_FUNCTION_BASE_HXX_ 2 #define OPENGM_LINEAR_CONSTRAINT_FUNCTION_BASE_HXX_ 15 template <
typename LINEAR_CONSTRAINT_FUNCTION_TYPE>
21 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
22 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> {
28 typedef typename LinearConstraintFunctionTraitsType::IndexType
IndexType;
29 typedef typename LinearConstraintFunctionTraitsType::LabelType
LabelType;
37 LinearConstraintsIteratorType linearConstraintsBegin()
const;
38 LinearConstraintsIteratorType linearConstraintsEnd()
const;
39 IndicatorVariablesIteratorType indicatorVariablesOrderBegin()
const;
40 IndicatorVariablesIteratorType indicatorVariablesOrderEnd()
const;
42 template <
class LABEL_ITERATOR>
43 void challenge(ViolatedLinearConstraintsIteratorType& violatedConstraintsBegin, ViolatedLinearConstraintsIteratorType& violatedConstraintsEnd, ViolatedLinearConstraintsWeightsIteratorType& violatedConstraintsWeightsBegin, LABEL_ITERATOR labelingBegin,
const ValueType tolerance = 0.0)
const;
44 template <
class LABEL_ITERATOR>
45 void challengeRelaxed(ViolatedLinearConstraintsIteratorType& violatedConstraintsBegin, ViolatedLinearConstraintsIteratorType& violatedConstraintsEnd, ViolatedLinearConstraintsWeightsIteratorType& violatedConstraintsWeightsBegin, LABEL_ITERATOR labelingBegin,
const ValueType tolerance = 0.0)
const;
48 bool isLinearConstraint()
const;
257 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
262 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
267 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
272 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
277 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
278 template <
class LABEL_ITERATOR>
280 return static_cast<const LinearConstraintFunctionType*
>(
this)->challenge_impl(violatedConstraintsBegin, violatedConstraintsEnd, violatedConstraintsWeightsBegin, labelingBegin, tolerance);
283 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
284 template <
class LABEL_ITERATOR>
286 return static_cast<const LinearConstraintFunctionType*
>(
this)->challengeRelaxed_impl(violatedConstraintsBegin, violatedConstraintsEnd, violatedConstraintsWeightsBegin, labelingBegin, tolerance);
289 template<
class LINEAR_CONSTRAINT_FUNCTION_TYPE>
LinearConstraintFunctionTraitsType::ViolatedLinearConstraintsWeightsIteratorType ViolatedLinearConstraintsWeightsIteratorType
Typedef of the violated linear constraints weights iterator type used by the linear constraint functi...
IndicatorVariablesIteratorType indicatorVariablesOrderBegin() const
Get the begin iterator to the set of indicator variables used by the linear constraint function...
Fallback implementation of member functions of OpenGM functions.
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...
LinearConstraintFunctionTraits< LinearConstraintFunctionType > LinearConstraintFunctionTraitsType
Typedef of the LinearConstraintFunctionTraits class with appropriate template parameter.
LinearConstraintFunctionTraitsType::LinearConstraintsIteratorType LinearConstraintsIteratorType
Typedef of the linear constraints iterator type used by the linear constraint function to iterate ove...
LinearConstraintsIteratorType linearConstraintsEnd() const
Get the end iterator to the set of linear constraints represented by the 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...
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.
A linear constraint function class ensuring the correct label order for two variables.
LinearConstraintFunctionTraitsUndefined ValueType
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.
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...
IndicatorVariablesIteratorType indicatorVariablesOrderEnd() const
Get the end iterator to the set of indicator variables used by the linear constraint function...
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...