Factor (with corresponding function and variable indices), independent of a GraphicalModel. More...
#include <graphicalmodel_factor.hxx>
Public Types | |
enum | FunctionInformation { NrOfFunctionTypes = 1 } |
typedef T | ValueType |
typedef I | IndexType |
typedef L | LabelType |
typedef ExplicitFunction < ValueType, IndexType, LabelType > | FunctionType |
typedef meta::TypeListGenerator < FunctionType >::type | FunctionTypeList |
typedef const size_t * | ShapeIteratorType |
typedef std::vector< IndexType > ::const_iterator | VariablesIteratorType |
Public Member Functions | |
IndependentFactor () | |
IndependentFactor (const ValueType) | |
construct a constant (order 0) independent factor | |
template<class VARIABLE_INDEX_ITERATOR , class SHAPE_ITERATOR > | |
IndependentFactor (VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR, SHAPE_ITERATOR, SHAPE_ITERATOR) | |
construct an independent factor using variable indices and the extension of a value table | |
template<class VARIABLE_INDEX_ITERATOR , class SHAPE_ITERATOR > | |
IndependentFactor (VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR, SHAPE_ITERATOR, SHAPE_ITERATOR, const ValueType) | |
template<class GRAPHICAL_MODEL , class VARIABLE_INDEX_ITERATOR > | |
IndependentFactor (const GRAPHICAL_MODEL &, VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR, const ValueType=ValueType()) | |
IndependentFactor (const IndependentFactor &) | |
template<class GRAPHICAL_MODEL > | |
IndependentFactor (const Factor< GRAPHICAL_MODEL > &) | |
IndependentFactor & | operator= (const IndependentFactor &) |
template<class GRAPHICAL_MODEL > | |
IndependentFactor & | operator= (const Factor< GRAPHICAL_MODEL > &) |
template<class VARIABLE_INDEX_ITERATOR , class SHAPE_ITERATOR > | |
void | assign (VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR, SHAPE_ITERATOR, SHAPE_ITERATOR) |
template<class VARIABLE_INDEX_ITERATOR , class SHAPE_ITERATOR > | |
void | assign (VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR, SHAPE_ITERATOR, SHAPE_ITERATOR, const ValueType) |
template<class GRAPHICAL_MODEL , class VARIABLE_INDEX_ITERATOR > | |
void | assign (const GRAPHICAL_MODEL &, VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR) |
template<class GRAPHICAL_MODEL , class VARIABLE_INDEX_ITERATOR > | |
void | assign (const GRAPHICAL_MODEL &, VARIABLE_INDEX_ITERATOR, VARIABLE_INDEX_ITERATOR, const ValueType) |
void | assign (const ValueType) |
ShapeIteratorType | shapeBegin () const |
ShapeIteratorType | shapeEnd () const |
VariablesIteratorType | variableIndicesBegin () const |
VariablesIteratorType | variableIndicesEnd () const |
const std::vector< IndexType > & | variableIndexSequence () const |
template<size_t FUNCTION_TYPE_INDEX> | |
const FunctionType & | function () const |
size_t | numberOfVariables () const |
IndexType | numberOfLabels (const IndexType) const |
return the number of labels of a specific variable | |
IndexType | shape (const size_t dimIndex) const |
return the extension of the value table of the of the function in a specific dimension | |
size_t | size () const |
return the number of entries of the value table of the function | |
IndexType | variableIndex (const size_t) const |
return the index of the j-th variable | |
template<class ITERATOR > | |
void | variableIndices (ITERATOR) const |
template<class ITERATOR > | |
T | operator() (ITERATOR) const |
evaluate the function underlying the factor, given labels to be assigned the variables | |
T | operator() (const IndexType) const |
evaluate an independent factor with 1 variable | |
T | operator() (const IndexType, const IndexType) const |
evaluate an independent factor with 2 variables | |
T | operator() (const IndexType, const IndexType, const IndexType) const |
evaluate an independent factor with 3 variables | |
T | operator() (const IndexType, const IndexType, const IndexType, const IndexType) const |
evaluate an independent factor with 4 variables | |
template<class INDEX_ITERATOR , class STATE_ITERATOR > | |
void | fixVariables (INDEX_ITERATOR, INDEX_ITERATOR, STATE_ITERATOR) |
assign specific labels to a specific subset of variables (reduces the order) | |
template<class ITERATOR > | |
T & | operator() (ITERATOR) |
evaluate the independent factor | |
T & | operator() (const IndexType) |
evaluate an independent factor with 1 variables | |
T & | operator() (const IndexType, const IndexType) |
evaluate an independent factor with 2 variables | |
T & | operator() (const IndexType, const IndexType, const IndexType) |
evaluate an independent factor with 3 variables | |
T & | operator() (const IndexType, const IndexType, const IndexType, const IndexType) |
evaluate an independent factor with 4 variables | |
template<class UNARY_OPERATOR_TYPE > | |
void | operateUnary (UNARY_OPERATOR_TYPE unaryOperator) |
template<class BINARY_OPERATOR_TYPE > | |
void | operateBinary (const T value, BINARY_OPERATOR_TYPE binaryOperator) |
template<class GRAPHICAL_MODEL , class BINARY_OPERATOR_TYPE > | |
void | operateBinary (const Factor< GRAPHICAL_MODEL > &, BINARY_OPERATOR_TYPE binaryOperator) |
template<class BINARY_OPERATOR_TYPE > | |
void | operateBinary (const IndependentFactor< T, I, L > &, BINARY_OPERATOR_TYPE binaryOperator) |
template<class BINARY_OPERATOR_TYPE > | |
void | operateBinary (const IndependentFactor< T, I, L > &, const IndependentFactor< T, I, L > &, BINARY_OPERATOR_TYPE binaryOperator) |
void | subtractOffset () |
template<class ACCUMULATOR > | |
void | accumulate (ValueType &, std::vector< LabelType > &) const |
template<class ACCUMULATOR > | |
void | accumulate (ValueType &) const |
template<class ACCUMULATOR , class VariablesIterator > | |
void | accumulate (VariablesIterator, VariablesIterator, IndependentFactor< T, I, L > &) const |
template<class ACCUMULATOR , class VariablesIterator > | |
void | accumulate (VariablesIterator, VariablesIterator) |
const FunctionType & | function () const |
bool | isPotts () |
bool | isGeneralizedPotts () |
bool | isSubmodular () |
bool | isSquaredDifference () |
bool | isTruncatedSquaredDifference () |
bool | isAbsoluteDifference () |
bool | isTruncatedAbsoluteDifference () |
T | min () |
T | max () |
T | sum () |
T | product () |
Friends | |
template<class ACC , class A , class ViAccIterator > | |
void | accumulate (A &, ViAccIterator, ViAccIterator) |
Factor (with corresponding function and variable indices), independent of a GraphicalModel.
Definition at line 214 of file graphicalmodel_factor.hxx.
typedef ExplicitFunction<ValueType,IndexType,LabelType> opengm::IndependentFactor< T, I, L >::FunctionType |
Definition at line 219 of file graphicalmodel_factor.hxx.
typedef meta::TypeListGenerator<FunctionType>::type opengm::IndependentFactor< T, I, L >::FunctionTypeList |
Definition at line 220 of file graphicalmodel_factor.hxx.
typedef I opengm::IndependentFactor< T, I, L >::IndexType |
Definition at line 217 of file graphicalmodel_factor.hxx.
typedef L opengm::IndependentFactor< T, I, L >::LabelType |
Definition at line 218 of file graphicalmodel_factor.hxx.
typedef const size_t* opengm::IndependentFactor< T, I, L >::ShapeIteratorType |
Definition at line 224 of file graphicalmodel_factor.hxx.
typedef T opengm::IndependentFactor< T, I, L >::ValueType |
Definition at line 216 of file graphicalmodel_factor.hxx.
typedef std::vector<IndexType>::const_iterator opengm::IndependentFactor< T, I, L >::VariablesIteratorType |
Definition at line 225 of file graphicalmodel_factor.hxx.
enum opengm::IndependentFactor::FunctionInformation |
Definition at line 221 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | ) | [inline] |
Definition at line 865 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | const ValueType | constant | ) | [inline] |
construct a constant (order 0) independent factor
Definition at line 873 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | VARIABLE_INDEX_ITERATOR | beginVi, | |
VARIABLE_INDEX_ITERATOR | endVi, | |||
SHAPE_ITERATOR | beginShape, | |||
SHAPE_ITERATOR | endShape | |||
) | [inline] |
construct an independent factor using variable indices and the extension of a value table
beginVi | iterator to the beginning of a sequence of variable indices | |
endVi | iterator to the end of a sequence of variable indices | |
shapeBegin | iterator to the beginning of a sequence of extensions | |
shapeBegin | iterator to the end of a sequence of extensions |
Definition at line 888 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | VARIABLE_INDEX_ITERATOR | beginVi, | |
VARIABLE_INDEX_ITERATOR | endVi, | |||
SHAPE_ITERATOR | beginShape, | |||
SHAPE_ITERATOR | endShape, | |||
const ValueType | constant | |||
) | [inline] |
Definition at line 904 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | const GRAPHICAL_MODEL & | gm, | |
VARIABLE_INDEX_ITERATOR | begin, | |||
VARIABLE_INDEX_ITERATOR | end, | |||
const ValueType | value = ValueType() | |||
) | [inline] |
Definition at line 1030 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | const IndependentFactor< T, I, L > & | src | ) | [inline] |
Definition at line 1049 of file graphicalmodel_factor.hxx.
opengm::IndependentFactor< T, I, L >::IndependentFactor | ( | const Factor< GRAPHICAL_MODEL > & | src | ) | [inline] |
Definition at line 1066 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::accumulate | ( | VariablesIterator | begin, | |
VariablesIterator | end | |||
) | [inline] |
Definition at line 1417 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::accumulate | ( | VariablesIterator | begin, | |
VariablesIterator | end, | |||
IndependentFactor< T, I, L > & | dstFactor | |||
) | const [inline] |
Definition at line 1406 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::accumulate | ( | ValueType & | result | ) | const [inline] |
Definition at line 1396 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::accumulate | ( | ValueType & | result, | |
std::vector< LabelType > & | resultState | |||
) | const [inline] |
Definition at line 1385 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::assign | ( | const ValueType | constant | ) | [inline] |
Definition at line 978 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::assign | ( | const GRAPHICAL_MODEL & | gm, | |
VARIABLE_INDEX_ITERATOR | begin, | |||
VARIABLE_INDEX_ITERATOR | end, | |||
const ValueType | value | |||
) | [inline] |
Definition at line 1009 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::assign | ( | const GRAPHICAL_MODEL & | gm, | |
VARIABLE_INDEX_ITERATOR | begin, | |||
VARIABLE_INDEX_ITERATOR | end | |||
) | [inline] |
Definition at line 990 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::assign | ( | VARIABLE_INDEX_ITERATOR | beginVi, | |
VARIABLE_INDEX_ITERATOR | endVi, | |||
SHAPE_ITERATOR | beginShape, | |||
SHAPE_ITERATOR | endShape, | |||
const ValueType | constant | |||
) | [inline] |
Definition at line 937 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::assign | ( | VARIABLE_INDEX_ITERATOR | beginVi, | |
VARIABLE_INDEX_ITERATOR | endVi, | |||
SHAPE_ITERATOR | beginShape, | |||
SHAPE_ITERATOR | endShape | |||
) | [inline] |
Definition at line 921 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::fixVariables | ( | INDEX_ITERATOR | beginIndex, | |
INDEX_ITERATOR | endIndex, | |||
STATE_ITERATOR | beginLabels | |||
) | [inline] |
assign specific labels to a specific subset of variables (reduces the order)
beginIndex | iterator to the beginning of a sequence of variable indices | |
endIndex | iterator to the end of a sequence of variable indices | |
beginLabels | iterator to the beginning of a sequence of labels |
Definition at line 1499 of file graphicalmodel_factor.hxx.
const FunctionType& opengm::IndependentFactor< T, I, L >::function | ( | ) | const |
const IndependentFactor< T, I, L >::FunctionType & opengm::IndependentFactor< T, I, L >::function | ( | ) | const [inline] |
Definition at line 962 of file graphicalmodel_factor.hxx.
bool opengm::IndependentFactor< T, I, L >::isAbsoluteDifference | ( | ) | [inline] |
bool opengm::IndependentFactor< T, I, L >::isGeneralizedPotts | ( | ) | [inline] |
bool opengm::IndependentFactor< T, I, L >::isPotts | ( | ) | [inline] |
bool opengm::IndependentFactor< T, I, L >::isSquaredDifference | ( | ) | [inline] |
bool opengm::IndependentFactor< T, I, L >::isSubmodular | ( | ) | [inline] |
bool opengm::IndependentFactor< T, I, L >::isTruncatedAbsoluteDifference | ( | ) | [inline] |
bool opengm::IndependentFactor< T, I, L >::isTruncatedSquaredDifference | ( | ) | [inline] |
T opengm::IndependentFactor< T, I, L >::max | ( | ) | [inline] |
T opengm::IndependentFactor< T, I, L >::min | ( | ) | [inline] |
IndependentFactor< T, I, L >::IndexType opengm::IndependentFactor< T, I, L >::numberOfLabels | ( | const IndexType | index | ) | const [inline] |
return the number of labels of a specific variable
Definition at line 1149 of file graphicalmodel_factor.hxx.
size_t opengm::IndependentFactor< T, I, L >::numberOfVariables | ( | ) | const [inline] |
Definition at line 1140 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::operateBinary | ( | const IndependentFactor< T, I, L > & | srcA, | |
const IndependentFactor< T, I, L > & | srcB, | |||
BINARY_OPERATOR_TYPE | binaryOperator | |||
) | [inline] |
Definition at line 1373 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::operateBinary | ( | const IndependentFactor< T, I, L > & | srcB, | |
BINARY_OPERATOR_TYPE | binaryOperator | |||
) | [inline] |
Definition at line 1362 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::operateBinary | ( | const Factor< GRAPHICAL_MODEL > & | srcB, | |
BINARY_OPERATOR_TYPE | binaryOperator | |||
) | [inline] |
Definition at line 1351 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::operateBinary | ( | const T | value, | |
BINARY_OPERATOR_TYPE | binaryOperator | |||
) | [inline] |
Definition at line 1333 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::operateUnary | ( | UNARY_OPERATOR_TYPE | unaryOperator | ) | [inline] |
Definition at line 1316 of file graphicalmodel_factor.hxx.
T & opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0, | |
const IndexType | x1, | |||
const IndexType | x2, | |||
const IndexType | x3 | |||
) | [inline] |
evaluate an independent factor with 4 variables
Definition at line 1468 of file graphicalmodel_factor.hxx.
T & opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0, | |
const IndexType | x1, | |||
const IndexType | x2 | |||
) | [inline] |
evaluate an independent factor with 3 variables
Definition at line 1457 of file graphicalmodel_factor.hxx.
T & opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0, | |
const IndexType | x1 | |||
) | [inline] |
evaluate an independent factor with 2 variables
Definition at line 1447 of file graphicalmodel_factor.hxx.
T & opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0 | ) | [inline] |
evaluate an independent factor with 1 variables
Definition at line 1438 of file graphicalmodel_factor.hxx.
T & opengm::IndependentFactor< T, I, L >::operator() | ( | ITERATOR | begin | ) | [inline] |
evaluate the independent factor
begin | iterator to the beginning of a sequence of labels |
Definition at line 1429 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0, | |
const IndexType | x1, | |||
const IndexType | x2, | |||
const IndexType | x3 | |||
) | const [inline] |
evaluate an independent factor with 4 variables
Definition at line 1301 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0, | |
const IndexType | x1, | |||
const IndexType | x2 | |||
) | const [inline] |
evaluate an independent factor with 3 variables
Definition at line 1287 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0, | |
const IndexType | x1 | |||
) | const [inline] |
evaluate an independent factor with 2 variables
Definition at line 1274 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::operator() | ( | const IndexType | x0 | ) | const [inline] |
evaluate an independent factor with 1 variable
Definition at line 1263 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::operator() | ( | ITERATOR | begin | ) | const [inline] |
evaluate the function underlying the factor, given labels to be assigned the variables
begin | iterator to the beginning of a sequence of labels |
Definition at line 1239 of file graphicalmodel_factor.hxx.
IndependentFactor< T, I, L > & opengm::IndependentFactor< T, I, L >::operator= | ( | const Factor< GRAPHICAL_MODEL > & | src | ) | [inline] |
Definition at line 1111 of file graphicalmodel_factor.hxx.
IndependentFactor< T, I, L > & opengm::IndependentFactor< T, I, L >::operator= | ( | const IndependentFactor< T, I, L > & | src | ) | [inline] |
Definition at line 1096 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::product | ( | ) | [inline] |
IndependentFactor< T, I, L >::IndexType opengm::IndependentFactor< T, I, L >::shape | ( | const size_t | dimIndex | ) | const [inline] |
return the extension of the value table of the of the function in a specific dimension
Definition at line 1169 of file graphicalmodel_factor.hxx.
IndependentFactor< T, I, L >::ShapeIteratorType opengm::IndependentFactor< T, I, L >::shapeBegin | ( | ) | const [inline] |
Definition at line 1181 of file graphicalmodel_factor.hxx.
IndependentFactor< T, I, L >::ShapeIteratorType opengm::IndependentFactor< T, I, L >::shapeEnd | ( | ) | const [inline] |
Definition at line 1188 of file graphicalmodel_factor.hxx.
size_t opengm::IndependentFactor< T, I, L >::size | ( | ) | const [inline] |
return the number of entries of the value table of the function
Definition at line 1160 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::subtractOffset | ( | ) | [inline] |
Definition at line 1221 of file graphicalmodel_factor.hxx.
T opengm::IndependentFactor< T, I, L >::sum | ( | ) | [inline] |
I opengm::IndependentFactor< T, I, L >::variableIndex | ( | const size_t | index | ) | const [inline] |
return the index of the j-th variable
Definition at line 1212 of file graphicalmodel_factor.hxx.
const std::vector< I > & opengm::IndependentFactor< T, I, L >::variableIndexSequence | ( | ) | const [inline] |
Definition at line 1254 of file graphicalmodel_factor.hxx.
void opengm::IndependentFactor< T, I, L >::variableIndices | ( | ITERATOR | out | ) | const [inline] |
Definition at line 1482 of file graphicalmodel_factor.hxx.
IndependentFactor< T, I, L >::VariablesIteratorType opengm::IndependentFactor< T, I, L >::variableIndicesBegin | ( | ) | const [inline] |
Definition at line 1195 of file graphicalmodel_factor.hxx.
IndependentFactor< T, I, L >::VariablesIteratorType opengm::IndependentFactor< T, I, L >::variableIndicesEnd | ( | ) | const [inline] |
Definition at line 1202 of file graphicalmodel_factor.hxx.
void accumulate | ( | A & | , | |
ViAccIterator | , | |||
ViAccIterator | ||||
) | [friend] |