Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
GCoptimization Class Reference

#include <GCoptimization.h>

Inheritance diagram for GCoptimization:
Inheritance graph
[legend]

List of all members.

Classes

struct  DataCostFnFromArray
struct  DataCostFnFromFunction
struct  DataCostFnFromFunctionExtra
class  DataCostFnSparse
struct  DataCostFunctor
class  GreedyIter
class  GreedyIter< GCoptimization::DataCostFnSparse >
struct  LabelCost
struct  LabelCostIter
struct  SmoothCostFnFromArray
struct  SmoothCostFnFromFunction
struct  SmoothCostFnFromFunctionExtra
struct  SmoothCostFnPotts
struct  SmoothCostFunctor
struct  SparseDataCost

Public Types

typedef EnergyTermType(* DataCostFn )(SiteID s, LabelID l)
typedef EnergyTermType(* DataCostFnExtra )(SiteID s, LabelID l, void *)
typedef Energy< EnergyTermType,
EnergyTermType, EnergyType
EnergyT
typedef int EnergyTermType
typedef long long EnergyType
typedef int LabelID
typedef VarID SiteID
typedef EnergyTermType(* SmoothCostFn )(SiteID s1, SiteID s2, LabelID l1, LabelID l2)
typedef EnergyTermType(* SmoothCostFnExtra )(SiteID s1, SiteID s2, LabelID l1, LabelID l2, void *)
typedef EnergyT::Var VarID

Public Member Functions

void alpha_beta_swap (LabelID alpha_label, LabelID beta_label)
void alpha_beta_swap (LabelID alpha_label, LabelID beta_label, SiteID *alphaSites, SiteID alpha_size, SiteID *betaSites, SiteID beta_size)
bool alpha_expansion (LabelID alpha_label)
EnergyType compute_energy ()
EnergyType expansion (int max_num_iterations=-1)
 GCoptimization (SiteID num_sites, LabelID num_labels)
EnergyType giveDataEnergy ()
EnergyType giveLabelEnergy ()
EnergyType giveSmoothEnergy ()
LabelID numLabels () const
SiteID numSites () const
void setDataCost (DataCostFn fn)
void setDataCost (DataCostFnExtra fn, void *extraData)
void setDataCost (EnergyTermType *dataArray)
void setDataCost (SiteID s, LabelID l, EnergyTermType e)
void setDataCost (LabelID l, SparseDataCost *costs, SiteID count)
void setDataCostFunctor (DataCostFunctor *f)
void setLabel (SiteID site, LabelID label)
void setLabelCost (EnergyTermType cost)
void setLabelCost (EnergyTermType *costArray)
void setLabelOrder (bool isRandom)
void setLabelOrder (const LabelID *order, LabelID size)
void setLabelSubsetCost (LabelID *labels, LabelID numLabels, EnergyTermType cost)
void setSmoothCost (SmoothCostFn fn)
void setSmoothCost (SmoothCostFnExtra fn, void *extraData)
void setSmoothCost (LabelID l1, LabelID l2, EnergyTermType e)
void setSmoothCost (EnergyTermType *smoothArray)
void setSmoothCostFunctor (SmoothCostFunctor *f)
void setVerbosity (int level)
EnergyType swap (int max_num_iterations=-1)
LabelID whatLabel (SiteID site)
void whatLabel (SiteID start, SiteID count, LabelID *labeling)
virtual ~GCoptimization ()

Protected Member Functions

void addterm1_checked (EnergyT *e, VarID i, EnergyTermType e0, EnergyTermType e1)
void addterm1_checked (EnergyT *e, VarID i, EnergyTermType e0, EnergyTermType e1, EnergyTermType w)
void addterm2_checked (EnergyT *e, VarID i, VarID j, EnergyTermType e00, EnergyTermType e01, EnergyTermType e10, EnergyTermType e11, EnergyTermType w)
template<typename DataCostT >
void applyNewLabeling (EnergyT *e, SiteID *activeSites, SiteID size, LabelID alpha_label)
virtual void finalizeNeighbors ()=0
virtual void giveNeighborInfo (SiteID site, SiteID *numSites, SiteID **neighbors, EnergyTermType **weights)=0
template<typename SmoothCostT >
EnergyType giveSmoothEnergyInternal ()
template<typename DataCostT >
SiteID queryActiveSitesExpansion (LabelID alpha_label, SiteID *activeSites)
template<typename DataCostT >
void setupDataCostsExpansion (SiteID size, LabelID alpha_label, EnergyT *e, SiteID *activeSites)
template<typename DataCostT >
void setupDataCostsSwap (SiteID size, LabelID alpha_label, LabelID beta_label, EnergyT *e, SiteID *activeSites)
EnergyType setupLabelCostsExpansion (SiteID size, LabelID alpha_label, EnergyT *e, SiteID *activeSites)
template<typename SmoothCostT >
void setupSmoothCostsExpansion (SiteID size, LabelID alpha_label, EnergyT *e, SiteID *activeSites)
template<typename SmoothCostT >
void setupSmoothCostsSwap (SiteID size, LabelID alpha_label, LabelID beta_label, EnergyT *e, SiteID *activeSites)
template<typename UserFunctor >
void specializeDataCostFunctor (const UserFunctor f)
template<typename UserFunctor >
void specializeSmoothCostFunctor (const UserFunctor f)
template<typename DataCostT >
void updateLabelingDataCosts ()
void updateLabelingInfo (bool updateCounts=true, bool updateActive=true, bool updateCosts=true)

Static Protected Member Functions

static void checkInterrupt ()
template<typename Functor >
static void deleteFunctor (void *f)
static void handleError (const char *message)

Protected Attributes

SiteIDm_activeLabelCounts
void(GCoptimization::* m_applyNewLabeling )(EnergyT *, SiteID *, SiteID, LabelID)
EnergyType m_beforeExpansionEnergy
void * m_datacostFn
void(* m_datacostFnDelete )(void *f)
EnergyTermTypem_datacostIndividual
EnergyType(GCoptimization::* m_giveSmoothEnergyInternal )()
int m_labelcostCount
LabelCostm_labelcostsAll
LabelCostIter ** m_labelcostsByLabel
SiteIDm_labelCounts
LabelIDm_labeling
EnergyTermTypem_labelingDataCosts
bool m_labelingInfoDirty
LabelIDm_labelTable
SiteIDm_lookupSiteVar
LabelID m_num_labels
SiteID m_num_sites
SiteIDm_numNeighbors
SiteID m_numNeighborsTotal
SiteID(GCoptimization::* m_queryActiveSitesExpansion )(LabelID, SiteID *)
int m_random_label_order
void(GCoptimization::* m_setupDataCostsExpansion )(SiteID, LabelID, EnergyT *, SiteID *)
void(GCoptimization::* m_setupDataCostsSwap )(SiteID, LabelID, LabelID, EnergyT *, SiteID *)
void(GCoptimization::* m_setupSmoothCostsExpansion )(SiteID, LabelID, EnergyT *, SiteID *)
void(GCoptimization::* m_setupSmoothCostsSwap )(SiteID, LabelID, LabelID, EnergyT *, SiteID *)
void * m_smoothcostFn
void(* m_smoothcostFnDelete )(void *f)
EnergyTermTypem_smoothcostIndividual
bool(GCoptimization::* m_solveSpecialCases )(EnergyType &)
int m_stepsThisCycle
int m_stepsThisCycleTotal
void(GCoptimization::* m_updateLabelingDataCosts )()
int m_verbosity

Private Member Functions

EnergyType oneExpansionIteration ()
EnergyType oneSwapIteration ()
void permuteLabelTable ()
void printStatus1 (const char *extraMsg=0)
void printStatus1 (int cycle, bool isSwap, gcoclock_t ticks0)
void printStatus2 (int alpha, int beta, int numVars, gcoclock_t ticks0)
template<typename DataCostT >
EnergyType solveGreedy ()
template<typename DataCostT >
bool solveSpecialCases (EnergyType &energy)

Detailed Description

Definition at line 150 of file GCoptimization.h.


Member Typedef Documentation

Definition at line 164 of file GCoptimization.h.

Definition at line 166 of file GCoptimization.h.

Definition at line 159 of file GCoptimization.h.

Definition at line 158 of file GCoptimization.h.

typedef long long GCoptimization::EnergyType

Definition at line 156 of file GCoptimization.h.

Definition at line 161 of file GCoptimization.h.

Definition at line 162 of file GCoptimization.h.

Definition at line 163 of file GCoptimization.h.

Definition at line 165 of file GCoptimization.h.

Definition at line 160 of file GCoptimization.h.


Constructor & Destructor Documentation

GCoptimization::GCoptimization ( SiteID  num_sites,
LabelID  num_labels 
)

Definition at line 85 of file GCoptimization.cpp.

Definition at line 139 of file GCoptimization.cpp.


Member Function Documentation

Definition at line 275 of file GCoptimization.cpp.

Definition at line 283 of file GCoptimization.cpp.

Definition at line 293 of file GCoptimization.cpp.

void GCoptimization::alpha_beta_swap ( LabelID  alpha_label,
LabelID  beta_label 
)

Definition at line 1332 of file GCoptimization.cpp.

void GCoptimization::alpha_beta_swap ( LabelID  alpha_label,
LabelID  beta_label,
SiteID alphaSites,
SiteID  alpha_size,
SiteID betaSites,
SiteID  beta_size 
)

Definition at line 1193 of file GCoptimization.cpp.

template<typename DataCostT >
void GCoptimization::applyNewLabeling ( EnergyT e,
SiteID activeSites,
SiteID  size,
LabelID  alpha_label 
) [protected]

Definition at line 409 of file GCoptimization.cpp.

void GCoptimization::checkInterrupt ( ) [static, protected]

Definition at line 1074 of file GCoptimization.cpp.

Definition at line 938 of file GCoptimization.cpp.

template<typename Functor >
static void GCoptimization::deleteFunctor ( void *  f) [inline, static, protected]

Definition at line 452 of file GCoptimization.h.

GCoptimization::EnergyType GCoptimization::expansion ( int  max_num_iterations = -1)

Definition at line 960 of file GCoptimization.cpp.

virtual void GCoptimization::finalizeNeighbors ( ) [protected, pure virtual]

Definition at line 917 of file GCoptimization.cpp.

Definition at line 926 of file GCoptimization.cpp.

virtual void GCoptimization::giveNeighborInfo ( SiteID  site,
SiteID numSites,
SiteID **  neighbors,
EnergyTermType **  weights 
) [protected, pure virtual]

Definition at line 907 of file GCoptimization.cpp.

template<typename SmoothCostT >
GCoptimization::EnergyType GCoptimization::giveSmoothEnergyInternal ( ) [protected]

Definition at line 253 of file GCoptimization.cpp.

void GCoptimization::handleError ( const char *  message) [static, protected]

Definition at line 1067 of file GCoptimization.cpp.

Definition at line 597 of file GCoptimization.h.

Definition at line 592 of file GCoptimization.h.

Definition at line 1259 of file GCoptimization.cpp.

Definition at line 1313 of file GCoptimization.cpp.

Definition at line 945 of file GCoptimization.cpp.

void GCoptimization::printStatus1 ( const char *  extraMsg = 0) [private]

Definition at line 1684 of file GCoptimization.cpp.

void GCoptimization::printStatus1 ( int  cycle,
bool  isSwap,
gcoclock_t  ticks0 
) [private]

Definition at line 1695 of file GCoptimization.cpp.

void GCoptimization::printStatus2 ( int  alpha,
int  beta,
int  numVars,
gcoclock_t  ticks0 
) [private]

Definition at line 1715 of file GCoptimization.cpp.

template<typename DataCostT >
GCoptimization::SiteID GCoptimization::queryActiveSitesExpansion ( LabelID  alpha_label,
SiteID activeSites 
) [protected]

Definition at line 310 of file GCoptimization.cpp.

Definition at line 712 of file GCoptimization.cpp.

void GCoptimization::setDataCost ( DataCostFnExtra  fn,
void *  extraData 
)

Definition at line 720 of file GCoptimization.cpp.

Definition at line 727 of file GCoptimization.cpp.

Definition at line 734 of file GCoptimization.cpp.

void GCoptimization::setDataCost ( LabelID  l,
SparseDataCost costs,
SiteID  count 
)

Definition at line 771 of file GCoptimization.cpp.

Definition at line 750 of file GCoptimization.cpp.

OLGA_INLINE void GCoptimization::setLabel ( SiteID  site,
LabelID  label 
)

Definition at line 602 of file GCoptimization.h.

Definition at line 832 of file GCoptimization.cpp.

Definition at line 843 of file GCoptimization.cpp.

void GCoptimization::setLabelOrder ( bool  isRandom)

Definition at line 1044 of file GCoptimization.cpp.

void GCoptimization::setLabelOrder ( const LabelID order,
LabelID  size 
)

Definition at line 1053 of file GCoptimization.cpp.

void GCoptimization::setLabelSubsetCost ( LabelID labels,
LabelID  numLabels,
EnergyTermType  cost 
)

Definition at line 851 of file GCoptimization.cpp.

Definition at line 784 of file GCoptimization.cpp.

void GCoptimization::setSmoothCost ( SmoothCostFnExtra  fn,
void *  extraData 
)

Definition at line 790 of file GCoptimization.cpp.

Definition at line 802 of file GCoptimization.cpp.

Definition at line 796 of file GCoptimization.cpp.

Definition at line 815 of file GCoptimization.cpp.

template<typename DataCostT >
void GCoptimization::setupDataCostsExpansion ( SiteID  size,
LabelID  alpha_label,
EnergyT e,
SiteID activeSites 
) [protected]

Definition at line 322 of file GCoptimization.cpp.

template<typename DataCostT >
void GCoptimization::setupDataCostsSwap ( SiteID  size,
LabelID  alpha_label,
LabelID  beta_label,
EnergyT e,
SiteID activeSites 
) [protected]

Definition at line 363 of file GCoptimization.cpp.

GCoptimization::EnergyType GCoptimization::setupLabelCostsExpansion ( SiteID  size,
LabelID  alpha_label,
EnergyT e,
SiteID activeSites 
) [protected]

Definition at line 1085 of file GCoptimization.cpp.

template<typename SmoothCostT >
void GCoptimization::setupSmoothCostsExpansion ( SiteID  size,
LabelID  alpha_label,
EnergyT e,
SiteID activeSites 
) [protected]

Definition at line 332 of file GCoptimization.cpp.

template<typename SmoothCostT >
void GCoptimization::setupSmoothCostsSwap ( SiteID  size,
LabelID  alpha_label,
LabelID  beta_label,
EnergyT e,
SiteID activeSites 
) [protected]

Definition at line 377 of file GCoptimization.cpp.

void GCoptimization::setVerbosity ( int  level) [inline]

Definition at line 259 of file GCoptimization.h.

template<typename DataCostT >
GCoptimization::EnergyType GCoptimization::solveGreedy ( ) [private]

Definition at line 566 of file GCoptimization.cpp.

template<typename DataCostT >
bool GCoptimization::solveSpecialCases ( EnergyType energy) [private]

Definition at line 441 of file GCoptimization.cpp.

template<typename UserFunctor >
void GCoptimization::specializeDataCostFunctor ( const UserFunctor  f) [protected]

Definition at line 216 of file GCoptimization.cpp.

template<typename UserFunctor >
void GCoptimization::specializeSmoothCostFunctor ( const UserFunctor  f) [protected]

Definition at line 235 of file GCoptimization.cpp.

GCoptimization::EnergyType GCoptimization::swap ( int  max_num_iterations = -1)

Definition at line 1276 of file GCoptimization.cpp.

template<typename DataCostT >
void GCoptimization::updateLabelingDataCosts ( ) [protected]

Definition at line 431 of file GCoptimization.cpp.

void GCoptimization::updateLabelingInfo ( bool  updateCounts = true,
bool  updateActive = true,
bool  updateCosts = true 
) [protected]

Definition at line 1152 of file GCoptimization.cpp.

Definition at line 609 of file GCoptimization.h.

void GCoptimization::whatLabel ( SiteID  start,
SiteID  count,
LabelID labeling 
)

Definition at line 899 of file GCoptimization.cpp.


Member Data Documentation

Definition at line 290 of file GCoptimization.h.

void(GCoptimization::* GCoptimization::m_applyNewLabeling)(EnergyT *, SiteID *, SiteID, LabelID) [protected]

Definition at line 310 of file GCoptimization.h.

Definition at line 299 of file GCoptimization.h.

void* GCoptimization::m_datacostFn [protected]

Definition at line 297 of file GCoptimization.h.

void(* GCoptimization::m_datacostFnDelete)(void *f) [protected]

Definition at line 313 of file GCoptimization.h.

Definition at line 286 of file GCoptimization.h.

EnergyType(GCoptimization::* GCoptimization::m_giveSmoothEnergyInternal)() [protected]

Definition at line 304 of file GCoptimization.h.

Definition at line 293 of file GCoptimization.h.

Definition at line 291 of file GCoptimization.h.

Definition at line 292 of file GCoptimization.h.

Definition at line 289 of file GCoptimization.h.

Definition at line 279 of file GCoptimization.h.

Definition at line 288 of file GCoptimization.h.

Definition at line 294 of file GCoptimization.h.

Definition at line 282 of file GCoptimization.h.

Definition at line 280 of file GCoptimization.h.

Definition at line 277 of file GCoptimization.h.

Definition at line 278 of file GCoptimization.h.

Definition at line 301 of file GCoptimization.h.

Definition at line 302 of file GCoptimization.h.

Definition at line 305 of file GCoptimization.h.

Definition at line 285 of file GCoptimization.h.

void(GCoptimization::* GCoptimization::m_setupDataCostsExpansion)(SiteID, LabelID, EnergyT *, SiteID *) [protected]

Definition at line 306 of file GCoptimization.h.

void(GCoptimization::* GCoptimization::m_setupDataCostsSwap)(SiteID, LabelID, LabelID, EnergyT *, SiteID *) [protected]

Definition at line 308 of file GCoptimization.h.

void(GCoptimization::* GCoptimization::m_setupSmoothCostsExpansion)(SiteID, LabelID, EnergyT *, SiteID *) [protected]

Definition at line 307 of file GCoptimization.h.

void(GCoptimization::* GCoptimization::m_setupSmoothCostsSwap)(SiteID, LabelID, LabelID, EnergyT *, SiteID *) [protected]

Definition at line 309 of file GCoptimization.h.

void* GCoptimization::m_smoothcostFn [protected]

Definition at line 298 of file GCoptimization.h.

void(* GCoptimization::m_smoothcostFnDelete)(void *f) [protected]

Definition at line 314 of file GCoptimization.h.

Definition at line 287 of file GCoptimization.h.

bool(GCoptimization::* GCoptimization::m_solveSpecialCases)(EnergyType &) [protected]

Definition at line 315 of file GCoptimization.h.

Definition at line 283 of file GCoptimization.h.

Definition at line 284 of file GCoptimization.h.

void(GCoptimization::* GCoptimization::m_updateLabelingDataCosts)() [protected]

Definition at line 311 of file GCoptimization.h.

int GCoptimization::m_verbosity [protected]

Definition at line 295 of file GCoptimization.h.


The documentation for this class was generated from the following files:


tabletop_pushing
Author(s): Tucker Hermans
autogenerated on Wed Nov 27 2013 11:59:45