|
OpenGM
2.3.x
Discrete Graphical Model Library
|
Base class for linear constraint functions. More...
#include <linear_constraint_function_base.hxx>
Inheritance diagram for opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >:
Collaboration diagram for opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >:Public Types | |
| typedef LINEAR_CONSTRAINT_FUNCTION_TYPE | LinearConstraintFunctionType |
| Typedef of the LINEAR_CONSTRAINT_FUNCTION_TYPE template parameter from the class LinearConstraintFunctionBase. More... | |
| typedef LinearConstraintFunctionTraits< LinearConstraintFunctionType > | LinearConstraintFunctionTraitsType |
| Typedef of the LinearConstraintFunctionTraits class with appropriate template parameter. More... | |
| typedef LinearConstraintFunctionTraitsType::ValueType | ValueType |
| Typedef of the value type used by the linear constraint function. More... | |
| typedef LinearConstraintFunctionTraitsType::IndexType | IndexType |
| Typedef of the index type used by the linear constraint function. More... | |
| typedef LinearConstraintFunctionTraitsType::LabelType | LabelType |
| Typedef of the label type used by the linear constraint function. More... | |
| typedef LinearConstraintFunctionTraitsType::LinearConstraintType | LinearConstraintType |
| Typedef of the linear constraint type used by the linear constraint function. More... | |
| typedef LinearConstraintFunctionTraitsType::LinearConstraintsIteratorType | LinearConstraintsIteratorType |
| Typedef of the linear constraints iterator type used by the linear constraint function to iterate over the set of linear constraints. More... | |
| typedef LinearConstraintFunctionTraitsType::ViolatedLinearConstraintsIteratorType | ViolatedLinearConstraintsIteratorType |
| Typedef of the violated linear constraints iterator type used by the linear constraint function to iterate over the set of violated linear constraints. More... | |
| typedef LinearConstraintFunctionTraitsType::ViolatedLinearConstraintsWeightsIteratorType | ViolatedLinearConstraintsWeightsIteratorType |
| Typedef of the violated linear constraints weights iterator type used by the linear constraint function to iterate over the weights of the violated linear constraints. More... | |
| typedef LinearConstraintFunctionTraitsType::IndicatorVariablesIteratorType | IndicatorVariablesIteratorType |
| Typedef of the indicator variables iterator type used by the linear constraint function to iterate over the indicator variables. More... | |
Public Types inherited from opengm::FunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE, LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::ValueType, LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::IndexType, LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LabelType > | |
| typedef AccessorIterator< FunctionShapeAccessorType, true > | FunctionShapeIteratorType |
Public Member Functions | |
| LinearConstraintsIteratorType | linearConstraintsBegin () const |
| Get the begin iterator to the set of linear constraints represented by the linear constraint function. More... | |
| LinearConstraintsIteratorType | linearConstraintsEnd () const |
| Get the end iterator to the set of linear constraints represented by the linear constraint function. More... | |
| IndicatorVariablesIteratorType | indicatorVariablesOrderBegin () const |
| Get the begin iterator to the set of indicator variables used by the linear constraint function. More... | |
| IndicatorVariablesIteratorType | indicatorVariablesOrderEnd () const |
| Get the end iterator to the set of indicator variables used by the linear constraint function. More... | |
| template<class LABEL_ITERATOR > | |
| 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 labeling. More... | |
| template<class LABEL_ITERATOR > | |
| 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 labeling. More... | |
| bool | isLinearConstraint () const |
| Function specialization for each linear constraint function. More... | |
Public Member Functions inherited from opengm::FunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE, LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::ValueType, LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::IndexType, LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LabelType > | |
| bool | isPotts () const |
| bool | isGeneralizedPotts () const |
| bool | isSubmodular () const |
| bool | isSquaredDifference () const |
| bool | isTruncatedSquaredDifference () const |
| bool | isAbsoluteDifference () const |
| bool | isTruncatedAbsoluteDifference () const |
| bool | isLinearConstraint () const |
| MinMaxFunctor< LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::ValueType > | minMax () const |
| find minimum and maximum of the function in a single sweep More... | |
| ReturnType | min () const |
| ReturnType | max () const |
| ReturnType | sum () const |
| ReturnType | product () const |
| ReturnType | accumulate () const |
| accumulate all values of the function More... | |
| void | forAllValuesInOrder (FUNCTOR &functor) const |
| call a functor for each value of the function (in lexicographical order of the variable indices) More... | |
| void | forAllValuesInSwitchedOrder (FUNCTOR &functor) const |
| void | forAllValuesInAnyOrder (FUNCTOR &functor) const |
| call a functor for each value of the function (in un-specified order) More... | |
| void | forAtLeastAllUniqueValues (FUNCTOR &functor) const |
| call a functor for at least all unique values of the function More... | |
| void | forAllValuesInOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const |
| void | forAllValuesInAnyOrderWithCoordinate (COORDINATE_FUNCTOR &functor) const |
| void | forAtLeastAllUniqueValuesWithCoordinate (COORDINATE_FUNCTOR &functor) const |
| bool | operator== (const LINEAR_CONSTRAINT_FUNCTION_TYPE &) const |
| FunctionShapeIteratorType | functionShapeBegin () const |
| FunctionShapeIteratorType | functionShapeEnd () const |
| size_t | numberOfParameters () const |
| LinearConstraintFunctionTraits< LINEAR_CONSTRAINT_FUNCTION_TYPE >::IndexType | parameterIndex (const size_t paramNumber) const |
Base class for linear constraint functions.
This class defines a base class for all linear constraint functions. It uses the curiously recurring template pattern (CRTP) to provide static polymorphism. It defines the interface which can be used to access the linear constraints which are defined by a linear constraint function.
| LINEAR_CONSTRAINT_FUNCTION_TYPE | The child class which inherits from LinearConstraintFunctionBase and thus defines a linear constraint function. |
Definition at line 15 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::IndexType |
Typedef of the index type used by the linear constraint function.
Definition at line 21 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::IndicatorVariablesIteratorType |
Typedef of the indicator variables iterator type used by the linear constraint function to iterate over the indicator variables.
Definition at line 27 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LabelType |
Typedef of the label type used by the linear constraint function.
Definition at line 22 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LinearConstraintFunctionTraitsType |
Typedef of the LinearConstraintFunctionTraits class with appropriate template parameter.
Definition at line 19 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LinearConstraintFunctionType |
Typedef of the LINEAR_CONSTRAINT_FUNCTION_TYPE template parameter from the class LinearConstraintFunctionBase.
Definition at line 18 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LinearConstraintsIteratorType |
Typedef of the linear constraints iterator type used by the linear constraint function to iterate over the set of linear constraints.
Definition at line 24 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::LinearConstraintType |
Typedef of the linear constraint type used by the linear constraint function.
Definition at line 23 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::ValueType |
Typedef of the value type used by the linear constraint function.
Definition at line 20 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::ViolatedLinearConstraintsIteratorType |
Typedef of the violated linear constraints iterator type used by the linear constraint function to iterate over the set of violated linear constraints.
Definition at line 25 of file linear_constraint_function_base.hxx.
| opengm::LinearConstraintFunctionBase< LINEAR_CONSTRAINT_FUNCTION_TYPE >::ViolatedLinearConstraintsWeightsIteratorType |
Typedef of the violated linear constraints weights iterator type used by the linear constraint function to iterate over the weights of the violated linear constraints.
Definition at line 26 of file linear_constraint_function_base.hxx.
|
inline |
Challenge the linear constraint function and get all linear constraints which are violated by a given labeling.
This function returns all linear constraints which are violated by a given labeling, furthermore it returns the weights telling how much each constraint is violated. It uses only the labeling for the first order variables of the function to evaluate the indicator variables of the function. Hence it is not qualified to challenge the liner function against a relaxed labeling where each indicator variable can take values in the range [0.0, 1.0]. Use LinearConstraintFunctionBase::challengeRelaxed for this case.
| LABEL_ITERATOR | Iterator type to iterate over the labels for the variables. |
| [out] | violatedConstraintsBegin | Iterator pointing to the begin of the set of violated constraints. |
| [out] | violatedConstraintsEnd | Iterator pointing to the end of the set of violated constraints. |
| [out] | violatedConstraintsWeightsBegin | Iterator pointing to the begin of the weights for the set of violated constraints. |
| [in] | labelingBegin | Iterator pointing to the begin of the labeling for the first order variables. |
| [in] | tolerance | The tolerance value defines how much a constraint is allowed to be violated without returning it as a violated constraint. |
Definition at line 272 of file linear_constraint_function_base.hxx.
|
inline |
Challenge the linear constraint function and get all linear constraints which are violated by a given labeling.
This function returns all linear constraints which are violated by a given labeling, furthermore it returns the weights telling how much each constraint is violated. Unlike the LinearConstraintFunctionBase::challenge function it takes the labeling for all indicator variables into account and therefore is capable of dealing with a relaxed labeling where each indicator variable can take values in the range [0.0, 1.0]. The order of the relaxed labeling for the indicator variables has to follow the order which is given by the iterators returned from indicatorVariablesOrderBegin() and indicatorVariablesOrderEnd().
| LABEL_ITERATOR | Iterator type to iterate over the relaxed labeling for the indicator variables. |
| [out] | violatedConstraintsBegin | Iterator pointing to the begin of the set of violated constraints. |
| [out] | violatedConstraintsEnd | Iterator pointing to the end of the set of violated constraints. |
| [out] | violatedConstraintsWeightsBegin | Iterator pointing to the begin of the weights for the set of violated constraints. |
| [in] | labelingBegin | Iterator pointing to the begin of the relaxed labeling for each indicator variable. |
| [in] | tolerance | The tolerance value defines how much a constraint is allowed to be violated without returning it as a violated constraint. |
Definition at line 278 of file linear_constraint_function_base.hxx.
|
inline |
Get the begin iterator to the set of indicator variables used by the linear constraint function.
Definition at line 261 of file linear_constraint_function_base.hxx.
|
inline |
Get the end iterator to the set of indicator variables used by the linear constraint function.
Definition at line 266 of file linear_constraint_function_base.hxx.
|
inline |
Function specialization for each linear constraint function.
Definition at line 283 of file linear_constraint_function_base.hxx.
|
inline |
Get the begin iterator to the set of linear constraints represented by the linear constraint function.
Definition at line 251 of file linear_constraint_function_base.hxx.
|
inline |
Get the end iterator to the set of linear constraints represented by the linear constraint function.
Definition at line 256 of file linear_constraint_function_base.hxx.
1.8.9.1