trws_base::DynamicProgramming< GM, ACC, InputIterator > Class Template Reference

#include <trws_subproblemsolver.hxx>

Inheritance diagram for trws_base::DynamicProgramming< GM, ACC, InputIterator >:
Inheritance graph
[legend]
Collaboration diagram for trws_base::DynamicProgramming< GM, ACC, InputIterator >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef GM GMType
typedef ACC ACCType
typedef GM::ValueType ValueType
typedef GM::IndexType IndexType
typedef GM::LabelType LabelType
typedef InputIterator InputIteratorType
typedef SequenceStorage< GM > Storage
typedef Storage::IndexList IndexList
typedef Storage::UnaryFactor UnaryFactor
typedef Storage::MoveDirection MoveDirection
typedef std::vector< IndexListIndexTable
typedef FunctionParameters< GM > FactorProperties
typedef UnaryFactor::const_iterator ConstIterator
typedef GM::FactorType Factor
typedef std::pair< typename
UnaryFactor::const_iterator,
typename
UnaryFactor::const_iterator > 
const_iterators_pair

Public Member Functions

 DynamicProgramming (Storage &storage, const FactorProperties &factorProperties, bool fastComputations=true)
virtual ~DynamicProgramming ()
void InitMove ()
void InitMove (MoveDirection movedirection)
virtual void InitReverseMove ()
virtual void Move ()
 >initializes move, which is reverse to the current one//TODO: remove virtual ?
virtual void PushBack ()
virtual void MoveBack ()
const_iterators_pair GetMarginals () const
const_iterators_pair GetMarginals (IndexType indx) const
ValueType GetObjectiveValue () const
virtual ValueType ComputeObjectiveValue ()=0
virtual void IncreaseUnaryWeights (InputIteratorType begin, InputIteratorType end)
virtual void FinalizeMove ()
LabelType numOfLabels () const
virtual void UpdateMarginals ()
virtual IndexType getNextPWId () const
 > updates marginals in the current node so, that they correspond to the forward (backward) accumulated probabilities of labels
virtual IndexType getPrevPWId () const
 > returns an external (_gm[.]) pairwise index, which follows the current variable. For the last variable this::NaN is returned
MoveDirection getMoveDirection () const
 > returns an external (_gm[.]) pairwise index, which is in front of the current variable. For the first variable this::NaN is returned
IndexType size () const
template<class ITERATOR >
ValueType evaluate (ITERATOR labeling)
void SetFastComputation (bool fc)

Static Public Attributes

static const IndexType NaN = std::numeric_limits<IndexType>::max()

Protected Member Functions

void _PottsUnaryTransform (LabelType newSize, const typename FactorProperties::ParameterStorageType &params)
void _InitReverseMoveBack ()
void _InitMove (ValueType rho, MoveDirection movedirection)
 >initializes move, which is reverse to the current one
virtual void _Push ()
void _core_InitMoves (ValueType rho, MoveDirection movedirection)
void _PushMessagesToFactor ()
void _ClearMessages (UnaryFactor *pbuffer=0)
virtual void _makeLocalCopyOfPWFactor (LabelType trgsize)
void _SumUpBufferToMarginals ()
virtual void _BackUpForwardMarginals ()
virtual void _InitCurrentUnaryBuffer (IndexType index)
IndexType _core_next (IndexType begin, MoveDirection dir) const
IndexType _next (IndexType begin) const
IndexType _previous (IndexType begin) const
IndexType _nextPWIndex () const

Protected Attributes

bool _fastComputation
Storage_storage
const FactorProperties_factorProperties
std::vector< UnaryFactor_marginals
ValueType _objectiveValue
ValueType _rho
MoveDirection _moveDirection
bool _bInitializationNeeded
UnaryFactor _currentPWFactor
UnaryFactor _currentUnaryFactor
IndexType _currentUnaryIndex
UnaryFactor _unaryTemp
Pseudo2DArray< ValueType_spst

Detailed Description

template<class GM, class ACC, class InputIterator>
class trws_base::DynamicProgramming< GM, ACC, InputIterator >

Definition at line 171 of file trws_subproblemsolver.hxx.


Member Typedef Documentation

template<class GM, class ACC, class InputIterator>
typedef ACC trws_base::DynamicProgramming< GM, ACC, InputIterator >::ACCType

Definition at line 175 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef std::pair<typename UnaryFactor::const_iterator,typename UnaryFactor::const_iterator> trws_base::DynamicProgramming< GM, ACC, InputIterator >::const_iterators_pair
template<class GM, class ACC, class InputIterator>
typedef UnaryFactor::const_iterator trws_base::DynamicProgramming< GM, ACC, InputIterator >::ConstIterator

Definition at line 187 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef GM::FactorType trws_base::DynamicProgramming< GM, ACC, InputIterator >::Factor
template<class GM, class ACC, class InputIterator>
typedef FunctionParameters<GM> trws_base::DynamicProgramming< GM, ACC, InputIterator >::FactorProperties
template<class GM, class ACC, class InputIterator>
typedef GM trws_base::DynamicProgramming< GM, ACC, InputIterator >::GMType

Definition at line 174 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef Storage::IndexList trws_base::DynamicProgramming< GM, ACC, InputIterator >::IndexList

Definition at line 182 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef std::vector<IndexList> trws_base::DynamicProgramming< GM, ACC, InputIterator >::IndexTable

Definition at line 185 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
typedef GM::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::IndexType
template<class GM, class ACC, class InputIterator>
typedef InputIterator trws_base::DynamicProgramming< GM, ACC, InputIterator >::InputIteratorType
template<class GM, class ACC, class InputIterator>
typedef GM::LabelType trws_base::DynamicProgramming< GM, ACC, InputIterator >::LabelType
template<class GM, class ACC, class InputIterator>
typedef Storage::MoveDirection trws_base::DynamicProgramming< GM, ACC, InputIterator >::MoveDirection
template<class GM, class ACC, class InputIterator>
typedef SequenceStorage<GM> trws_base::DynamicProgramming< GM, ACC, InputIterator >::Storage
template<class GM, class ACC, class InputIterator>
typedef Storage::UnaryFactor trws_base::DynamicProgramming< GM, ACC, InputIterator >::UnaryFactor
template<class GM, class ACC, class InputIterator>
typedef GM::ValueType trws_base::DynamicProgramming< GM, ACC, InputIterator >::ValueType

Constructor & Destructor Documentation

template<class GM , class ACC , class InputIterator >
trws_base::DynamicProgramming< GM, ACC, InputIterator >::DynamicProgramming ( Storage storage,
const FactorProperties factorProperties,
bool  fastComputations = true 
) [inline]

Definition at line 614 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

template<class GM, class ACC, class InputIterator>
virtual trws_base::DynamicProgramming< GM, ACC, InputIterator >::~DynamicProgramming (  )  [inline, virtual]

Definition at line 196 of file trws_subproblemsolver.hxx.


Member Function Documentation

template<class GM, class ACC, class InputIterator>
virtual void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_BackUpForwardMarginals (  )  [inline, protected, virtual]

Definition at line 271 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_ClearMessages ( UnaryFactor pbuffer = 0  )  [inline, protected]

Definition at line 738 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_core_InitMoves ( ValueType  rho,
MoveDirection  movedirection 
) [inline, protected]

Definition at line 831 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_core_next ( IndexType  begin,
MoveDirection  dir 
) const [inline, protected]

Definition at line 646 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_InitCurrentUnaryBuffer ( IndexType  index  )  [inline, protected, virtual]

Reimplemented in trws_base::SumProdSolver< GM, ACC, InputIterator >, and trws_base::SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >.

Definition at line 720 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_InitMove ( ValueType  rho,
MoveDirection  movedirection 
) [inline, protected]

>initializes move, which is reverse to the current one

Definition at line 846 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM, class ACC, class InputIterator>
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_InitReverseMoveBack (  )  [inline, protected]

Definition at line 263 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_makeLocalCopyOfPWFactor ( LabelType  trgsize  )  [inline, protected, virtual]

Reimplemented in trws_base::SumProdSolver< GM, ACC, InputIterator >, and trws_base::SumProdSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >.

Definition at line 689 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_next ( IndexType  begin  )  const [inline, protected]

Definition at line 662 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_nextPWIndex (  )  const [inline, protected]

Definition at line 679 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_PottsUnaryTransform ( LabelType  newSize,
const typename FactorProperties::ParameterStorageType &  params 
) [inline, protected]

> if anti-Potts model

> if anti-Potts model

Definition at line 398 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_previous ( IndexType  begin  )  const [inline, protected]

Definition at line 669 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_Push (  )  [inline, protected, virtual]
template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_PushMessagesToFactor (  )  [inline, protected]

Definition at line 702 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::_SumUpBufferToMarginals (  )  [inline, protected]

Definition at line 775 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM, class ACC, class InputIterator>
virtual ValueType trws_base::DynamicProgramming< GM, ACC, InputIterator >::ComputeObjectiveValue (  )  [pure virtual]
template<class GM, class ACC, class InputIterator>
template<class ITERATOR >
ValueType trws_base::DynamicProgramming< GM, ACC, InputIterator >::evaluate ( ITERATOR  labeling  )  [inline]

Definition at line 249 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::FinalizeMove (  )  [inline, virtual]

Reimplemented in trws_base::MaxSumSolver< GM, ACC, InputIterator >, and trws_base::MaxSumSolver< GM, ACC, std::vector< GM::ValueType >::const_iterator >.

Definition at line 854 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM, class ACC, class InputIterator>
const_iterators_pair trws_base::DynamicProgramming< GM, ACC, InputIterator >::GetMarginals ( IndexType  indx  )  const [inline]

Definition at line 220 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
const_iterators_pair trws_base::DynamicProgramming< GM, ACC, InputIterator >::GetMarginals (  )  const [inline]

Returns NON-normalized marginals ...(logSumProd or maxSum marginals)

Definition at line 219 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM, class ACC, class InputIterator>
MoveDirection trws_base::DynamicProgramming< GM, ACC, InputIterator >::getMoveDirection (  )  const [inline]

> returns an external (_gm[.]) pairwise index, which is in front of the current variable. For the first variable this::NaN is returned

Definition at line 246 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::getNextPWId (  )  const [inline, virtual]

> updates marginals in the current node so, that they correspond to the forward (backward) accumulated probabilities of labels

Definition at line 884 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

template<class GM, class ACC, class InputIterator>
ValueType trws_base::DynamicProgramming< GM, ACC, InputIterator >::GetObjectiveValue (  )  const [inline]

Definition at line 222 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::getPrevPWId (  )  const [inline, virtual]

> returns an external (_gm[.]) pairwise index, which follows the current variable. For the last variable this::NaN is returned

Definition at line 872 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::IncreaseUnaryWeights ( InputIteratorType  begin,
InputIteratorType  end 
) [inline, virtual]

Definition at line 862 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

template<class GM, class ACC, class InputIterator>
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::InitMove ( MoveDirection  movedirection  )  [inline]

Definition at line 211 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::InitMove (  )  [inline]

Inference: usage: InitMove(rho);//once initialize smoothing value

then

Move();/MoveBack(); parent::_moveDirection or

PushBack();....PushBack();FinalizeMove();

Definition at line 210 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
virtual void trws_base::DynamicProgramming< GM, ACC, InputIterator >::InitReverseMove (  )  [inline, virtual]

Definition at line 212 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::Move (  )  [inline, virtual]

>initializes move, which is reverse to the current one//TODO: remove virtual ?

Definition at line 784 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::MoveBack (  )  [inline, virtual]

performs size() steps with PushBack();

Definition at line 821 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

template<class GM, class ACC, class InputIterator>
LabelType trws_base::DynamicProgramming< GM, ACC, InputIterator >::numOfLabels (  )  const [inline]

Returns number of labels in the current node

Definition at line 240 of file trws_subproblemsolver.hxx.

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::PushBack (  )  [inline, virtual]

performs a single step of the move and sums up corresponding fw-bk marginals

Definition at line 806 of file trws_subproblemsolver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class GM, class ACC, class InputIterator>
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::SetFastComputation ( bool  fc  )  [inline]

Tests

Definition at line 257 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::size (  )  const [inline]

Definition at line 247 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:

template<class GM , class ACC , class InputIterator >
void trws_base::DynamicProgramming< GM, ACC, InputIterator >::UpdateMarginals (  )  [inline, virtual]

Definition at line 769 of file trws_subproblemsolver.hxx.

Here is the caller graph for this function:


Member Data Documentation

template<class GM, class ACC, class InputIterator>
bool trws_base::DynamicProgramming< GM, ACC, InputIterator >::_bInitializationNeeded [protected]

Definition at line 288 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
UnaryFactor trws_base::DynamicProgramming< GM, ACC, InputIterator >::_currentPWFactor [protected]

Definition at line 291 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
UnaryFactor trws_base::DynamicProgramming< GM, ACC, InputIterator >::_currentUnaryFactor [protected]

Definition at line 292 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_currentUnaryIndex [protected]

Definition at line 293 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
const FactorProperties& trws_base::DynamicProgramming< GM, ACC, InputIterator >::_factorProperties [protected]

Definition at line 281 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
bool trws_base::DynamicProgramming< GM, ACC, InputIterator >::_fastComputation [protected]

Definition at line 279 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
std::vector<UnaryFactor> trws_base::DynamicProgramming< GM, ACC, InputIterator >::_marginals [protected]

Definition at line 283 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
MoveDirection trws_base::DynamicProgramming< GM, ACC, InputIterator >::_moveDirection [protected]

Definition at line 287 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
ValueType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_objectiveValue [protected]

Definition at line 285 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
ValueType trws_base::DynamicProgramming< GM, ACC, InputIterator >::_rho [protected]

Definition at line 286 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
Pseudo2DArray<ValueType> trws_base::DynamicProgramming< GM, ACC, InputIterator >::_spst [mutable, protected]

Definition at line 296 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
Storage& trws_base::DynamicProgramming< GM, ACC, InputIterator >::_storage [protected]

Definition at line 280 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
UnaryFactor trws_base::DynamicProgramming< GM, ACC, InputIterator >::_unaryTemp [mutable, protected]

Definition at line 295 of file trws_subproblemsolver.hxx.

template<class GM, class ACC, class InputIterator>
const DynamicProgramming< GM, ACC, InputIterator >::IndexType trws_base::DynamicProgramming< GM, ACC, InputIterator >::NaN = std::numeric_limits<IndexType>::max() [inline, static]

Definition at line 192 of file trws_subproblemsolver.hxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Jun 17 16:31:14 2013 for OpenGM by  doxygen 1.6.3