Alternaria
fit cylinders and ellipsoids to fungus
Sampler_jump_move Class Reference

#include <sampler.h>

Inheritance diagram for Sampler_jump_move:
Collaboration diagram for Sampler_jump_move:

List of all members.

Public Member Functions

 Sampler_jump_move (const char *name_1, const char *name_2, double prob_1, double prob_2) throw (jwscxx::base::Arg_error)
 Constructs a Sampler_jump_move.
virtual ~Sampler_jump_move ()
 Deletes a Sampler_jump_move.
bool run (Sampler_move_parameters *params) throw (jwscxx::base::Exception)
 Stochastically runs the 1st or 2nd balanced move and either accepts or rejects.
virtual bool run_1 (Sampler_move_parameters *params)=0 throw (jwscxx::base::Exception)
 Runs the 1st balanced jump move and either accepts or rejects.
virtual bool run_2 (Sampler_move_parameters *params)=0 throw (jwscxx::base::Exception)
 Runs the 2nd balanced jump move and either accepts or rejects.
virtual const std::ostringstream & get_info (Sampler_move_parameters *params)
 Returns information about the current state of the most recent run of this move.
virtual const std::ostringstream & get_proposal_info (Sampler_move_parameters *params)
 Returns information about the proposed state of the most recent run of this move.
double get_prob () const
 Returns the summed probability of both balanced moves.
void set_prob (double prob) throw (jwscxx::base::Arg_error)
 Sets the probability of both balanced moves.
double get_prob_1 () const
 Returns the probability of the 1st balanced jump move.
const char * get_name_1 () const
 Returns the name of the 1st balanced jump move.
void set_prob_1 (double prob_1) throw (jwscxx::base::Arg_error)
 Sets the probability of the 1st balanced jump move.
double get_prob_2 () const
 Returns the probability of the 2nd balanced jump move.
const char * get_name_2 () const
 Returns the name of the 2nd balanced jump move.
void set_prob_2 (double prob_2) throw (jwscxx::base::Arg_error)
 Sets the probability of the 2nd balanced jump move.

Protected Attributes

uint32_t num_accepted_1
 Number of times the 1st jump ran and accepted.
uint32_t num_attempts_1
 Number of times the 1st jump ran and accepted or rejected.
double prob_1
 Probability of the 1st balanced jump move in a Sampler.
const char * name_1
 Single word name of the 1st balanced jump move.
uint32_t num_accepted_2
 Number of times the 2nd jump ran and accepted.
uint32_t num_attempts_2
 Number of times the 2nd jump ran and accepted or rejected.
double prob_2
 Probability of the 2nd balanced jump move in a Sampler.
const char * name_2
 Single word name of the 2nd balanced jump move.

Detailed Description

MCMC Sampler move that modifies the number model parameter. Must be

Definition at line 239 of file sampler.h.


Constructor & Destructor Documentation

Sampler_jump_move::Sampler_jump_move ( const char *  name_1,
const char *  name_2,
double  prob_1,
double  prob_2 
) throw (jwscxx::base::Arg_error)

Constructs a Sampler_jump_move.

Parameters:
name_1Name of the 1st balanced move.
name_2Name of the 2nd balanced move.
prob_1Probability of the 1st balanced move.
prob_2Probability of the 2nd balanced move.
Exceptions:
jwscxx::base::Arg_errorProbability must be in [0,1].
Note:
Use Sampler::normalize_move_probs to normalize all the move probabilities so they sum to 1.

Definition at line 190 of file sampler.cpp.

virtual Sampler_jump_move::~Sampler_jump_move ( ) [inline, virtual]

Deletes a Sampler_jump_move.

Definition at line 255 of file sampler.h.


Member Function Documentation

bool Sampler_jump_move::run ( Sampler_move_parameters params) throw (jwscxx::base::Exception) [virtual]

Stochastically runs the 1st or 2nd balanced move and either accepts or rejects.

Parameters:
paramsParameters for the move.
Returns:
If the proposal is accepted, 1; otherwise 0.

Implements Sampler_move.

Definition at line 217 of file sampler.cpp.

const std::ostringstream & Sampler_jump_move::get_info ( Sampler_move_parameters params) [virtual]

Returns information about the current state of the most recent run of this move.

Parameters:
paramsParameters for the move.
Returns:
Information about the number of structures.

Implements Sampler_move.

Definition at line 235 of file sampler.cpp.

const std::ostringstream & Sampler_jump_move::get_proposal_info ( Sampler_move_parameters params) [virtual]

Returns information about the proposed state of the most recent run of this move.

Parameters:
paramsParameters for the move.
Returns:
Information about the proposed number of structures.

Implements Sampler_move.

Definition at line 259 of file sampler.cpp.

double Sampler_jump_move::get_prob ( ) const [inline, virtual]

Returns the summed probability of both balanced moves.

Implements Sampler_move.

Definition at line 303 of file sampler.h.

void Sampler_jump_move::set_prob ( double  prob) throw (jwscxx::base::Arg_error) [virtual]

Sets the probability of both balanced moves.

Parameters:
probNew probability of the balanced moves (evenly divided).
Exceptions:
jwscxx::base::Arg_errorValue must be in [0,1].

Implements Sampler_move.

Definition at line 282 of file sampler.cpp.

double Sampler_jump_move::get_prob_1 ( ) const [inline]

Returns the probability of the 1st balanced jump move.

Definition at line 311 of file sampler.h.

const char* Sampler_jump_move::get_name_1 ( ) const [inline]

Returns the name of the 1st balanced jump move.

Definition at line 315 of file sampler.h.

void Sampler_jump_move::set_prob_1 ( double  prob_1) throw (jwscxx::base::Arg_error)

Sets the probability of the 1st balanced jump move.

Parameters:
prob_1New probability of the 1st balanced move.
Exceptions:
jwscxx::base::Arg_errorValue must be in [0,1].

Definition at line 307 of file sampler.cpp.

double Sampler_jump_move::get_prob_2 ( ) const [inline]

Returns the probability of the 2nd balanced jump move.

Definition at line 323 of file sampler.h.

const char* Sampler_jump_move::get_name_2 ( ) const [inline]

Returns the name of the 2nd balanced jump move.

Definition at line 327 of file sampler.h.

void Sampler_jump_move::set_prob_2 ( double  prob_2) throw (jwscxx::base::Arg_error)

Sets the probability of the 2nd balanced jump move.

Parameters:
prob_2New probability of the 2nd balanced move.
Exceptions:
jwscxx::base::Arg_errorValue must be in [0,1].

Definition at line 323 of file sampler.cpp.


Member Data Documentation

uint32_t Sampler_jump_move::num_accepted_1 [protected]

Number of times the 1st jump ran and accepted.

Definition at line 337 of file sampler.h.

uint32_t Sampler_jump_move::num_attempts_1 [protected]

Number of times the 1st jump ran and accepted or rejected.

Definition at line 340 of file sampler.h.

double Sampler_jump_move::prob_1 [protected]

Probability of the 1st balanced jump move in a Sampler.

Definition at line 343 of file sampler.h.

const char* Sampler_jump_move::name_1 [protected]

Single word name of the 1st balanced jump move.

Definition at line 346 of file sampler.h.

uint32_t Sampler_jump_move::num_accepted_2 [protected]

Number of times the 2nd jump ran and accepted.

Definition at line 349 of file sampler.h.

uint32_t Sampler_jump_move::num_attempts_2 [protected]

Number of times the 2nd jump ran and accepted or rejected.

Definition at line 352 of file sampler.h.

double Sampler_jump_move::prob_2 [protected]

Probability of the 2nd balanced jump move in a Sampler.

Definition at line 355 of file sampler.h.

const char* Sampler_jump_move::name_2 [protected]

Single word name of the 2nd balanced jump move.

Definition at line 358 of file sampler.h.


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