trws_base::TRWSPrototype< SubSolver > Class Template Reference

#include <trws_base.hxx>

Inheritance diagram for trws_base::TRWSPrototype< SubSolver >:
Inheritance graph
[legend]
Collaboration diagram for trws_base::TRWSPrototype< SubSolver >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef SubSolver::GMType GM
typedef GM GraphicalModelType
typedef SubSolver::ACCType ACC
typedef ACC AccumulationType
typedef SubSolver SubSolverType
typedef FunctionParameters< GMFactorProperties
typedef opengm::EmptyVisitor
< TRWSPrototype< SubSolverType > > 
EmptyVisitorParent
typedef 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
< ValueType
Parameters
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,
ValueType
GetMarginals (IndexType variable, OutputIteratorType begin)
void GetMarginalsMove ()
 >returns "averaged" over subsolvers marginals
void BackwardMove ()
ValueType getBound (size_t i) const
virtual InferenceTermination infer ()
template<class VISITOR >
InferenceTermination infer (VISITOR &)
void ForwardMove ()
ValueType lastDualUpdate () const
template<class VISITOR >
InferenceTermination infer_visitor_updates (VISITOR &)
InferenceTermination core_infer ()
const FactorPropertiesgetFactorProperties () const

Protected Member Functions

void _EstimateIntegerLabeling ()
template<class VISITOR >
InferenceTermination _core_infer (VISITOR &)
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
void _ForwardMove ()
void _FinalizeMove ()
ValueType _GetObjectiveValue ()
IndexType _order (IndexType i)
IndexType _core_order (IndexType i, IndexType totalSize)
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)
ValueType _lastDualUpdate
 > previous dual bound (it is improved monotonically)
SubModel::MoveDirection _moveDirection
std::vector< SubSolver * > _subSolvers
std::vector< std::vector
< ValueType > > 
_marginals
 computation optimization
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 trws_base::TRWSPrototype< SubSolver >

Definition at line 186 of file trws_base.hxx.


Member Typedef Documentation

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

Definition at line 191 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 192 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 198 of file trws_base.hxx.

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

Definition at line 195 of file trws_base.hxx.

template<class SubSolver>
typedef VisitorWrapper<EmptyVisitorParent,TRWSPrototype<SubSolver> > trws_base::TRWSPrototype< SubSolver >::EmptyVisitorType

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

Definition at line 196 of file trws_base.hxx.

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

Definition at line 194 of file trws_base.hxx.

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

Definition at line 189 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 190 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 200 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 202 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 201 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 203 of file trws_base.hxx.

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

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

Definition at line 204 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 206 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 209 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 208 of file trws_base.hxx.

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

Definition at line 193 of file trws_base.hxx.

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

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

Definition at line 210 of file trws_base.hxx.

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

Reimplemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Definition at line 199 of file trws_base.hxx.


Constructor & Destructor Documentation

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

Definition at line 453 of file trws_base.hxx.

Here is the call graph for this function:

template<class SubSolver >
trws_base::TRWSPrototype< SubSolver >::~TRWSPrototype (  )  [inline, virtual]

Definition at line 488 of file trws_base.hxx.


Member Function Documentation

template<class SubSolver >
bool trws_base::TRWSPrototype< SubSolver >::_CheckConvergence ( ValueType  relativeThreshold  )  [inline, protected]

Definition at line 522 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
bool trws_base::TRWSPrototype< SubSolver >::_CheckStoppingCondition ( InferenceTermination pterminationCode  )  [inline, protected, virtual]

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

Definition at line 534 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver >
template<class VISITOR >
TRWSPrototype< SubSolver >::InferenceTermination trws_base::TRWSPrototype< SubSolver >::_core_infer ( VISITOR &  visitor  )  [inline, protected]

Definition at line 563 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 611 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver>
void trws_base::TRWSPrototype< SubSolver >::_EstimateIntegerLabel ( IndexType  varId,
const std::vector< ValueType > &  sumMarginal 
) [inline, protected]

Definition at line 254 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::_EstimateIntegerLabeling (  )  [inline, protected]

Definition at line 773 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver>
virtual void trws_base::TRWSPrototype< SubSolver >::_EstimateTRWSBound (  )  [inline, protected, virtual]

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

Definition at line 265 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::_EvaluateIntegerBounds (  )  [inline, protected]

Definition at line 814 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::_FinalizeMove (  )  [inline, protected]

Definition at line 623 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::_ForwardMove (  )  [inline, protected]

Definition at line 596 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver >
TRWSPrototype< SubSolver >::ValueType trws_base::TRWSPrototype< SubSolver >::_GetObjectiveValue (  )  [inline, protected]

Definition at line 586 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver>
virtual ValueType trws_base::TRWSPrototype< SubSolver >::_GetPrimalBound (  )  [inline, protected, virtual]

Definition at line 245 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver>
virtual void trws_base::TRWSPrototype< SubSolver >::_InitMove (  )  [protected, pure virtual]

Implemented in trws_base::SumProdTRWS< GM, ACC >, and trws_base::MaxSumTRWS< GM, ACC >.

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::_InitSubSolvers (  )  [inline, protected]

>best label index

Definition at line 494 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver>
virtual void trws_base::TRWSPrototype< SubSolver >::_normalizeMarginals ( typename std::vector< ValueType >::iterator  begin,
typename std::vector< ValueType >::iterator  end,
SubSolver *  subSolver 
) [protected, pure virtual]

Here is the caller graph for this function:

template<class SubSolver >
TRWSPrototype< SubSolver >::IndexType trws_base::TRWSPrototype< SubSolver >::_order ( IndexType  i  )  [inline, protected]

Definition at line 617 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver>
virtual void trws_base::TRWSPrototype< SubSolver >::_postprocessMarginals ( typename std::vector< ValueType >::iterator  begin,
typename std::vector< ValueType >::iterator  end 
) [protected, pure virtual]

Here is the caller graph for this function:

template<class SubSolver>
virtual void trws_base::TRWSPrototype< SubSolver >::_SumUpForwardMarginals ( std::vector< ValueType > *  pout,
const_marginals_iterators_pair  itpair 
) [protected, pure virtual]

Here is the caller graph for this function:

template<class SubSolver>
virtual const std::vector<LabelType>& trws_base::TRWSPrototype< SubSolver >::arg (  )  const [inline, virtual]

Definition at line 222 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::BackwardMove (  )  [inline]

Definition at line 715 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver>
virtual ValueType trws_base::TRWSPrototype< SubSolver >::bound (  )  const [inline, virtual]

Definition at line 221 of file trws_base.hxx.

Here is the caller graph for this function:

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

Definition at line 502 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver>
InferenceTermination trws_base::TRWSPrototype< SubSolver >::core_infer (  )  [inline]

Definition at line 240 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::ForwardMove (  )  [inline]

Definition at line 706 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SubSolver>
virtual ValueType trws_base::TRWSPrototype< SubSolver >::GetBestIntegerBound (  )  const [inline, virtual]

Definition at line 219 of file trws_base.hxx.

Here is the caller graph for this function:

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

Definition at line 233 of file trws_base.hxx.

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

Definition at line 241 of file trws_base.hxx.

Here is the caller graph for this function:

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

Definition at line 229 of file trws_base.hxx.

template<class SubSolver >
void trws_base::TRWSPrototype< SubSolver >::GetMarginalsMove (  )  [inline]

>returns "averaged" over subsolvers marginals

Definition at line 604 of file trws_base.hxx.

Here is the call graph for this function:

template<class SubSolver >
template<class VISITOR >
TRWSPrototype< SubSolver >::InferenceTermination trws_base::TRWSPrototype< SubSolver >::infer ( VISITOR &  visitor  )  [inline]

Definition at line 681 of file trws_base.hxx.

Here is the call graph for this function:

template<class SubSolver>
virtual InferenceTermination trws_base::TRWSPrototype< SubSolver >::infer (  )  [inline, virtual]

Definition at line 234 of file trws_base.hxx.

Here is the caller graph for this function:

template<class SubSolver >
template<class VISITOR >
TRWSPrototype< SubSolver >::InferenceTermination trws_base::TRWSPrototype< SubSolver >::infer_visitor_updates ( VISITOR &  visitor  )  [inline]

Definition at line 691 of file trws_base.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 237 of file trws_base.hxx.

template<class SubSolver>
virtual ValueType trws_base::TRWSPrototype< SubSolver >::value (  )  const [inline, virtual]

Definition at line 220 of file trws_base.hxx.

Here is the caller graph for this function:


Member Data Documentation

template<class SubSolver>
ValueType trws_base::TRWSPrototype< SubSolver >::_bestIntegerBound [protected]

Definition at line 288 of file trws_base.hxx.

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

Definition at line 291 of file trws_base.hxx.

template<class SubSolver>
ValueType trws_base::TRWSPrototype< SubSolver >::_dualBound [protected]

Definition at line 278 of file trws_base.hxx.

template<class SubSolver>
FactorProperties::ParameterStorageType trws_base::TRWSPrototype< SubSolver >::_factorParameters [mutable, protected]

Definition at line 295 of file trws_base.hxx.

template<class SubSolver>
FactorProperties trws_base::TRWSPrototype< SubSolver >::_factorProperties [protected]

Definition at line 270 of file trws_base.hxx.

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

Definition at line 271 of file trws_base.hxx.

template<class SubSolver>
ValueType trws_base::TRWSPrototype< SubSolver >::_integerBound [protected]

Definition at line 287 of file trws_base.hxx.

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

Definition at line 290 of file trws_base.hxx.

template<class SubSolver>
ValueType trws_base::TRWSPrototype< SubSolver >::_lastDualUpdate [protected]

> previous dual bound (it is improved monotonically)

Definition at line 280 of file trws_base.hxx.

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

computation optimization

Definition at line 285 of file trws_base.hxx.

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

Definition at line 282 of file trws_base.hxx.

template<class SubSolver>
ValueType trws_base::TRWSPrototype< SubSolver >::_oldDualBound [protected]

>current dual bound (it is improved monotonically)

Definition at line 279 of file trws_base.hxx.

template<class SubSolver>
Parameters trws_base::TRWSPrototype< SubSolver >::_parameters [protected]

Definition at line 272 of file trws_base.hxx.

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

Definition at line 269 of file trws_base.hxx.

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

Definition at line 283 of file trws_base.hxx.

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

Definition at line 294 of file trws_base.hxx.

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