OpenGM  2.3.x
Discrete Graphical Model Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
opengm::trws_base::TRWSPrototype< SubSolver > Class Template Referenceabstract

#include <trws_base.hxx>

+ Inheritance diagram for opengm::trws_base::TRWSPrototype< SubSolver >:
+ Collaboration diagram for opengm::trws_base::TRWSPrototype< SubSolver >:

Public Types

typedef SubSolver::GMType GM
 
typedef GM GraphicalModelType
 
typedef SubSolver::ACCType ACC
 
typedef ACC AccumulationType
 
typedef SubSolver SubSolverType
 
typedef FunctionParameters< GMFactorProperties
 
typedef visitors::EmptyVisitor< TRWSPrototype< SubSolverType > > EmptyVisitorParent
 
typedef visitors::VisitorWrapper< EmptyVisitorParent, TRWSPrototype< SubSolver > > EmptyVisitorType
 
typedef SubSolver::const_iterators_pair const_marginals_iterators_pair
 
typedef GM::ValueType ValueType
 
typedef GM::IndexType IndexType
 
typedef GM::LabelType LabelType
 
typedef opengm::InferenceTermination InferenceTermination
 
typedef std::vector< ValueTypeOutputContainerType
 
typedef OutputContainerType::iterator OutputIteratorType
 
typedef TRWSPrototype_Parameters< ValueTypeParameters
 
typedef SequenceStorage< GMSubModel
 
typedef DecompositionStorage< GMStorage
 
typedef Storage::UnaryFactor UnaryFactor
 

Public Member Functions

 TRWSPrototype (Storage &storage, const Parameters &params)
 
virtual ~TRWSPrototype ()
 
virtual ValueType GetBestIntegerBound () const
 
virtual ValueType value () const
 
virtual ValueType bound () const
 
virtual const std::vector< LabelType > & arg () const
 
bool CheckDualityGap (ValueType primalBound, ValueType dualBound)
 
virtual std::pair< ValueType, ValueTypeGetMarginals (IndexType variable, OutputIteratorType begin)
 
void GetMarginalsMove ()
 >returns "averaged" over subsolvers marginals More...
 
void BackwardMove ()
 
ValueType getBound (size_t i) const
 
virtual InferenceTermination infer ()
 
template<class VISITOR >
InferenceTermination infer (VISITOR &)
 
void ForwardMove ()
 
void EstimateIntegerLabelingAndBound ()
 
ValueType lastDualUpdate () const
 
template<class VISITOR >
InferenceTermination infer_visitor_updates (VISITOR &visitor, size_t *pinterCounter=0)
 
InferenceTermination core_infer (size_t *piterCounter=0)
 
const FactorPropertiesgetFactorProperties () const
 

Protected Member Functions

void _EstimateIntegerLabeling ()
 
template<class VISITOR >
InferenceTermination _core_infer (VISITOR &visitor, size_t *piterCounter=0)
 
virtual ValueType _GetPrimalBound ()
 
virtual void _postprocessMarginals (typename std::vector< ValueType >::iterator begin, typename std::vector< ValueType >::iterator end)=0
 
virtual void _normalizeMarginals (typename std::vector< ValueType >::iterator begin, typename std::vector< ValueType >::iterator end, SubSolver *subSolver)=0
 
void _EvaluateIntegerBounds ()
 
virtual void _SumUpForwardMarginals (std::vector< ValueType > *pout, const_marginals_iterators_pair itpair)=0
 
void _EstimateIntegerLabel (IndexType varId, const std::vector< ValueType > &sumMarginal)
 
void _InitSubSolvers ()
 >best label index More...
 
void _ForwardMove ()
 
void _FinalizeMove ()
 
ValueType _GetObjectiveValue ()
 
IndexType _order (IndexType i)
 
IndexType _core_order (IndexType i, IndexType totalSize)
 
virtual bool _CheckConvergence (ValueType relativeThreshold)
 
virtual bool _CheckStoppingCondition (InferenceTermination *pterminationCode)
 
virtual void _EstimateTRWSBound ()
 
virtual void _InitMove ()=0
 

Protected Attributes

Storage_storage
 
FactorProperties _factorProperties
 
PreviousFactorTable< GM_ftable
 
Parameters _parameters
 
ValueType _dualBound
 
ValueType _oldDualBound
 >current dual bound (it is improved monotonically) More...
 
ValueType _lastDualUpdate
 

previous dual bound (it is improved monotonically)

More...
 
SubModel::MoveDirection _moveDirection
 
std::vector< SubSolver * > _subSolvers
 
std::vector< std::vector< ValueType > > _marginals
 computation optimization More...
 
ValueType _integerBound
 
ValueType _bestIntegerBound
 
std::vector< LabelType_integerLabeling
 
std::vector< LabelType_bestIntegerLabeling
 
std::vector< ValueType_sumMarginal
 
FactorProperties::ParameterStorageType _factorParameters
 

Detailed Description

template<class SubSolver>
class opengm::trws_base::TRWSPrototype< SubSolver >

Definition at line 199 of file trws_base.hxx.

Member Typedef Documentation

template<class SubSolver>
typedef SubSolver::ACCType opengm::trws_base::TRWSPrototype< SubSolver >::ACC

Definition at line 204 of file trws_base.hxx.

template<class SubSolver>
typedef ACC opengm::trws_base::TRWSPrototype< SubSolver >::AccumulationType

Definition at line 205 of file trws_base.hxx.

template<class SubSolver>
typedef SubSolver::const_iterators_pair opengm::trws_base::TRWSPrototype< SubSolver >::const_marginals_iterators_pair

Definition at line 212 of file trws_base.hxx.

Definition at line 209 of file trws_base.hxx.

Definition at line 210 of file trws_base.hxx.

template<class SubSolver>
typedef FunctionParameters<GM> opengm::trws_base::TRWSPrototype< SubSolver >::FactorProperties

Definition at line 207 of file trws_base.hxx.

template<class SubSolver>
typedef SubSolver::GMType opengm::trws_base::TRWSPrototype< SubSolver >::GM

Definition at line 202 of file trws_base.hxx.

template<class SubSolver>
typedef GM opengm::trws_base::TRWSPrototype< SubSolver >::GraphicalModelType

Definition at line 203 of file trws_base.hxx.

template<class SubSolver>
typedef GM::IndexType opengm::trws_base::TRWSPrototype< SubSolver >::IndexType

Definition at line 214 of file trws_base.hxx.

Definition at line 216 of file trws_base.hxx.

template<class SubSolver>
typedef GM::LabelType opengm::trws_base::TRWSPrototype< SubSolver >::LabelType

Definition at line 215 of file trws_base.hxx.

template<class SubSolver>
typedef std::vector<ValueType> opengm::trws_base::TRWSPrototype< SubSolver >::OutputContainerType

Definition at line 217 of file trws_base.hxx.

template<class SubSolver>
typedef OutputContainerType::iterator opengm::trws_base::TRWSPrototype< SubSolver >::OutputIteratorType

Definition at line 218 of file trws_base.hxx.

template<class SubSolver>
typedef TRWSPrototype_Parameters<ValueType> opengm::trws_base::TRWSPrototype< SubSolver >::Parameters

Definition at line 220 of file trws_base.hxx.

template<class SubSolver>
typedef DecompositionStorage<GM> opengm::trws_base::TRWSPrototype< SubSolver >::Storage

Definition at line 223 of file trws_base.hxx.

template<class SubSolver>
typedef SequenceStorage<GM> opengm::trws_base::TRWSPrototype< SubSolver >::SubModel

Definition at line 222 of file trws_base.hxx.

template<class SubSolver>
typedef SubSolver opengm::trws_base::TRWSPrototype< SubSolver >::SubSolverType

Definition at line 206 of file trws_base.hxx.

template<class SubSolver>
typedef Storage::UnaryFactor opengm::trws_base::TRWSPrototype< SubSolver >::UnaryFactor

Definition at line 224 of file trws_base.hxx.

template<class SubSolver>
typedef GM::ValueType opengm::trws_base::TRWSPrototype< SubSolver >::ValueType

Definition at line 213 of file trws_base.hxx.

Constructor & Destructor Documentation

template<class SubSolver >
opengm::trws_base::TRWSPrototype< SubSolver >::TRWSPrototype ( Storage storage,
const Parameters params 
)

Definition at line 534 of file trws_base.hxx.

+ Here is the call graph for this function:

template<class SubSolver >
opengm::trws_base::TRWSPrototype< SubSolver >::~TRWSPrototype ( )
virtual

Definition at line 569 of file trws_base.hxx.

Member Function Documentation

template<class SubSolver >
bool opengm::trws_base::TRWSPrototype< SubSolver >::_CheckConvergence ( ValueType  relativeThreshold)
protectedvirtual

Reimplemented in opengm::trws_base::SumProdTRWS< GM, ACC >.

Definition at line 635 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver >
bool opengm::trws_base::TRWSPrototype< SubSolver >::_CheckStoppingCondition ( InferenceTermination pterminationCode)
protectedvirtual

Reimplemented in opengm::trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 647 of file trws_base.hxx.

template<class SubSolver >
template<class VISITOR >
TRWSPrototype< SubSolver >::InferenceTermination opengm::trws_base::TRWSPrototype< SubSolver >::_core_infer ( VISITOR &  visitor,
size_t piterCounter = 0 
)
protected

Definition at line 676 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver >
TRWSPrototype< SubSolver >::IndexType opengm::trws_base::TRWSPrototype< SubSolver >::_core_order ( IndexType  i,
IndexType  totalSize 
)
protected

Definition at line 735 of file trws_base.hxx.

template<class SubSolver>
void opengm::trws_base::TRWSPrototype< SubSolver >::_EstimateIntegerLabel ( IndexType  varId,
const std::vector< ValueType > &  sumMarginal 
)
inlineprotected

Definition at line 287 of file trws_base.hxx.

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::_EstimateIntegerLabeling ( )
protected

Definition at line 874 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver>
virtual void opengm::trws_base::TRWSPrototype< SubSolver >::_EstimateTRWSBound ( )
inlineprotectedvirtual

Reimplemented in opengm::trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 299 of file trws_base.hxx.

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::_EvaluateIntegerBounds ( )
protected

Definition at line 916 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::_FinalizeMove ( )
protected

Definition at line 747 of file trws_base.hxx.

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::_ForwardMove ( )
protected

Definition at line 720 of file trws_base.hxx.

template<class SubSolver >
TRWSPrototype< SubSolver >::ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_GetObjectiveValue ( )
protected

Definition at line 710 of file trws_base.hxx.

template<class SubSolver>
virtual ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_GetPrimalBound ( )
inlineprotectedvirtual

Definition at line 278 of file trws_base.hxx.

template<class SubSolver>
virtual void opengm::trws_base::TRWSPrototype< SubSolver >::_InitMove ( )
protectedpure virtual
template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::_InitSubSolvers ( )
protected

>best label index

Definition at line 575 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver>
virtual void opengm::trws_base::TRWSPrototype< SubSolver >::_normalizeMarginals ( typename std::vector< ValueType >::iterator  begin,
typename std::vector< ValueType >::iterator  end,
SubSolver *  subSolver 
)
protectedpure virtual
template<class SubSolver >
TRWSPrototype< SubSolver >::IndexType opengm::trws_base::TRWSPrototype< SubSolver >::_order ( IndexType  i)
protected

Definition at line 741 of file trws_base.hxx.

template<class SubSolver>
virtual void opengm::trws_base::TRWSPrototype< SubSolver >::_postprocessMarginals ( typename std::vector< ValueType >::iterator  begin,
typename std::vector< ValueType >::iterator  end 
)
protectedpure virtual
template<class SubSolver>
virtual void opengm::trws_base::TRWSPrototype< SubSolver >::_SumUpForwardMarginals ( std::vector< ValueType > *  pout,
const_marginals_iterators_pair  itpair 
)
protectedpure virtual
template<class SubSolver>
virtual const std::vector<LabelType>& opengm::trws_base::TRWSPrototype< SubSolver >::arg ( ) const
inlinevirtual

Definition at line 236 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::BackwardMove ( )

Definition at line 815 of file trws_base.hxx.

+ Here is the call graph for this function:

template<class SubSolver>
virtual ValueType opengm::trws_base::TRWSPrototype< SubSolver >::bound ( ) const
inlinevirtual

Definition at line 235 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver >
bool opengm::trws_base::TRWSPrototype< SubSolver >::CheckDualityGap ( ValueType  primalBound,
ValueType  dualBound 
)

Definition at line 583 of file trws_base.hxx.

template<class SubSolver>
InferenceTermination opengm::trws_base::TRWSPrototype< SubSolver >::core_infer ( size_t piterCounter = 0)
inline

Definition at line 264 of file trws_base.hxx.

template<class SubSolver>
void opengm::trws_base::TRWSPrototype< SubSolver >::EstimateIntegerLabelingAndBound ( )
inline

Definition at line 257 of file trws_base.hxx.

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::ForwardMove ( )

Definition at line 806 of file trws_base.hxx.

template<class SubSolver>
virtual ValueType opengm::trws_base::TRWSPrototype< SubSolver >::GetBestIntegerBound ( ) const
inlinevirtual

Definition at line 233 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::getBound ( size_t  i) const
inline

Definition at line 253 of file trws_base.hxx.

template<class SubSolver>
const FactorProperties& opengm::trws_base::TRWSPrototype< SubSolver >::getFactorProperties ( ) const
inline

Definition at line 265 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver>
virtual std::pair<ValueType,ValueType> opengm::trws_base::TRWSPrototype< SubSolver >::GetMarginals ( IndexType  variable,
OutputIteratorType  begin 
)
inlinevirtual

Reimplemented in opengm::trws_base::SumProdTRWS< GM, ACC >.

Definition at line 243 of file trws_base.hxx.

template<class SubSolver >
void opengm::trws_base::TRWSPrototype< SubSolver >::GetMarginalsMove ( )

>returns "averaged" over subsolvers marginals

Definition at line 728 of file trws_base.hxx.

template<class SubSolver>
virtual InferenceTermination opengm::trws_base::TRWSPrototype< SubSolver >::infer ( )
inlinevirtual

Definition at line 254 of file trws_base.hxx.

+ Here is the caller graph for this function:

template<class SubSolver >
template<class VISITOR >
TRWSPrototype< SubSolver >::InferenceTermination opengm::trws_base::TRWSPrototype< SubSolver >::infer ( VISITOR &  visitor)

Definition at line 771 of file trws_base.hxx.

template<class SubSolver >
template<class VISITOR >
TRWSPrototype< SubSolver >::InferenceTermination opengm::trws_base::TRWSPrototype< SubSolver >::infer_visitor_updates ( VISITOR &  visitor,
size_t pinterCounter = 0 
)

Definition at line 781 of file trws_base.hxx.

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::lastDualUpdate ( ) const
inline

Definition at line 261 of file trws_base.hxx.

template<class SubSolver>
virtual ValueType opengm::trws_base::TRWSPrototype< SubSolver >::value ( ) const
inlinevirtual

Definition at line 234 of file trws_base.hxx.

+ Here is the caller graph for this function:

Member Data Documentation

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_bestIntegerBound
protected

Definition at line 322 of file trws_base.hxx.

template<class SubSolver>
std::vector<LabelType> opengm::trws_base::TRWSPrototype< SubSolver >::_bestIntegerLabeling
protected

Definition at line 325 of file trws_base.hxx.

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_dualBound
protected

Definition at line 312 of file trws_base.hxx.

template<class SubSolver>
FactorProperties::ParameterStorageType opengm::trws_base::TRWSPrototype< SubSolver >::_factorParameters
mutableprotected

Definition at line 329 of file trws_base.hxx.

template<class SubSolver>
FactorProperties opengm::trws_base::TRWSPrototype< SubSolver >::_factorProperties
protected

Definition at line 304 of file trws_base.hxx.

template<class SubSolver>
PreviousFactorTable<GM> opengm::trws_base::TRWSPrototype< SubSolver >::_ftable
protected

Definition at line 305 of file trws_base.hxx.

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_integerBound
protected

Definition at line 321 of file trws_base.hxx.

template<class SubSolver>
std::vector<LabelType> opengm::trws_base::TRWSPrototype< SubSolver >::_integerLabeling
protected

Definition at line 324 of file trws_base.hxx.

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_lastDualUpdate
protected

previous dual bound (it is improved monotonically)

Definition at line 314 of file trws_base.hxx.

template<class SubSolver>
std::vector<std::vector<ValueType> > opengm::trws_base::TRWSPrototype< SubSolver >::_marginals
protected

computation optimization

Definition at line 319 of file trws_base.hxx.

template<class SubSolver>
SubModel::MoveDirection opengm::trws_base::TRWSPrototype< SubSolver >::_moveDirection
protected

Definition at line 316 of file trws_base.hxx.

template<class SubSolver>
ValueType opengm::trws_base::TRWSPrototype< SubSolver >::_oldDualBound
protected

>current dual bound (it is improved monotonically)

Definition at line 313 of file trws_base.hxx.

template<class SubSolver>
Parameters opengm::trws_base::TRWSPrototype< SubSolver >::_parameters
protected

Definition at line 306 of file trws_base.hxx.

template<class SubSolver>
Storage& opengm::trws_base::TRWSPrototype< SubSolver >::_storage
protected

Definition at line 303 of file trws_base.hxx.

template<class SubSolver>
std::vector<SubSolver*> opengm::trws_base::TRWSPrototype< SubSolver >::_subSolvers
protected

Definition at line 317 of file trws_base.hxx.

template<class SubSolver>
std::vector<ValueType> opengm::trws_base::TRWSPrototype< SubSolver >::_sumMarginal
protected

Definition at line 328 of file trws_base.hxx.