# opentl::tracker::SIRParticle Class Reference

Inherits opentl::tracker::Tracker.

List of all members.

## Public Member Functions
virtual void | correct (TargetPtrVector &targets)
| correct: for each target internal state, compute the likelihood (implicit model) and update weights of particles
virtual void | init (TargetPtrVector &targets, std::vector< boost::shared_ptr< opentl::core::State > > *initStates=NULL, std::vector< boost::shared_ptr< math::SquareMatrix > > *initCovs=NULL, std::vector< int > *nHypotheses=NULL)
| Initialize: allocate internal data, and update warp for all targets.
virtual void | predict (TargetPtrVector &targets)
| predict: resample (if required) and drift particles for all targets
void | resample (TargetPtrVector &targets)
| Function to resample the particles.
void | setForceResample (bool val)
| SIRParticle (opentl::modalities::Likelihood &likelihood, opentl::modelprojection::Warp &warp)
| Constructor.
virtual | ~SIRParticle ()
| Destructor.
## Protected Member Functions
virtual void | output (TargetPtrVector &targets)
| Compute the output state for all targets.

## Constructor & Destructor Documentation

opentl::tracker::SIRParticle::SIRParticle | ( | opentl::modalities::Likelihood & | likelihood,
|  | opentl::modelprojection::Warp & | warp |
| ) |  |  |

Constructor.

Parameters:

  | likelihood | Pointer to Likelihood instance (template)
  | warp | The warp class

virtual opentl::tracker::SIRParticle::~SIRParticle | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual void opentl::tracker::SIRParticle::correct | ( | TargetPtrVector & | targets | ) | `[virtual]`

correct: for each target internal state, compute the likelihood (implicit model) and update weights of particles

Parameters:

  | targets | Vector of targets

Implements opentl::tracker::Tracker.

virtual void opentl::tracker::SIRParticle::init | ( | TargetPtrVector & | targets,
|  | std::vector< boost::shared_ptr< opentl::core::State > > * | initStates = `NULL`,
|  | std::vector< boost::shared_ptr< math::SquareMatrix > > * | initCovs = `NULL`,
|  | std::vector< int > * | nHypotheses = `NULL` |
| ) |  |  | `[virtual]`

Initialize: allocate internal data, and update warp for all targets.

Parameters:

  | targets | Vector of targets
  | initStates | Vector of initial states (optional); it must have same size of targets
  | initCovs | Vector of initial covariances: it must be NULL, otherwise raises an exception
  | nHypotheses | Number of particles for each target; it must have same size of targets

Implements opentl::tracker::Tracker.

virtual void opentl::tracker::SIRParticle::output | ( | TargetPtrVector & | targets | ) | `[inline, protected, virtual]`

Compute the output state for all targets.

Parameters:

  | targets | Vector of targets

Reimplemented from opentl::tracker::Tracker.

virtual void opentl::tracker::SIRParticle::predict | ( | TargetPtrVector & | targets | ) | `[virtual]`

predict: resample (if required) and drift particles for all targets

Parameters:

  | targets | Vector of targets

Implements opentl::tracker::Tracker.

void opentl::tracker::SIRParticle::resample | ( | TargetPtrVector & | targets | ) |

Function to resample the particles.

Parameters:

  | targets | Vector of targets

void opentl::tracker::SIRParticle::setForceResample | ( | bool | val | ) | `[inline]`