Apply limits to each parameter independently. More...
#include <msm_box_limiter.h>
Public Member Functions | |
msm_box_limiter () | |
virtual | ~msm_box_limiter () |
virtual void | set_param_var (const vnl_vector< double > &v) |
Define variance on each parameter. | |
virtual void | set_acceptance (double prop, unsigned n_modes=0) |
Set the limits so that a given proportion pass. | |
virtual void | apply_limit (vnl_vector< double > &b) const |
Apply limit to parameter vector b. | |
void | set_n_sds (double n_sds) |
Define number of SDs to limit at. | |
virtual vcl_string | is_a () const |
Name of the class. | |
virtual msm_param_limiter * | clone () const |
Create a copy on the heap and return base class pointer. | |
virtual void | print_summary (vcl_ostream &os) const |
Print class to os. | |
virtual void | b_write (vsl_b_ostream &bfs) const |
Save class to binary file stream. | |
virtual void | b_read (vsl_b_istream &bfs) |
Load class from binary file stream. | |
virtual void | config_from_stream (vcl_istream &is) |
Initialise from a text stream. | |
Static Public Member Functions | |
static vcl_auto_ptr < msm_param_limiter > | create_from_stream (vcl_istream &is) |
Create a concrete msm_param_limiter-derived object, from a text specification. | |
Private Attributes | |
vnl_vector< double > | mode_sd_ |
SD on each mode. | |
double | n_sds_ |
Number of SDs to limit at. | |
double | accept_prop_ |
Proportion of Gaussian to be accepted. |
Apply limits to each parameter independently.
Each parameter is forced to lie in range [-k*s_i,+k*s_i], where s_i is the standard deviation for the i-th parameter.
Definition at line 15 of file msm_box_limiter.h.
msm_box_limiter::msm_box_limiter | ( | ) |
Definition at line 16 of file msm_box_limiter.cxx.
virtual msm_box_limiter::~msm_box_limiter | ( | ) | [inline, virtual] |
Definition at line 32 of file msm_box_limiter.h.
void msm_box_limiter::apply_limit | ( | vnl_vector< double > & | b | ) | const [virtual] |
Apply limit to parameter vector b.
Implements msm_param_limiter.
Definition at line 56 of file msm_box_limiter.cxx.
void msm_box_limiter::b_read | ( | vsl_b_istream & | bfs | ) | [virtual] |
Load class from binary file stream.
Implements msm_param_limiter.
Definition at line 88 of file msm_box_limiter.cxx.
void msm_box_limiter::b_write | ( | vsl_b_ostream & | bfs | ) | const [virtual] |
Save class to binary file stream.
Implements msm_param_limiter.
Definition at line 78 of file msm_box_limiter.cxx.
msm_param_limiter * msm_box_limiter::clone | ( | ) | const [virtual] |
Create a copy on the heap and return base class pointer.
Implements msm_param_limiter.
Definition at line 113 of file msm_box_limiter.cxx.
void msm_box_limiter::config_from_stream | ( | vcl_istream & | is | ) | [virtual] |
Initialise from a text stream.
The default implementation is for attribute-less normalisers, and throws if it finds any data in the stream.
Reimplemented from msm_param_limiter.
Definition at line 122 of file msm_box_limiter.cxx.
vcl_auto_ptr< msm_param_limiter > msm_param_limiter::create_from_stream | ( | vcl_istream & | is | ) | [static, inherited] |
Create a concrete msm_param_limiter-derived object, from a text specification.
Definition at line 47 of file msm_param_limiter.cxx.
vcl_string msm_box_limiter::is_a | ( | ) | const [virtual] |
Name of the class.
Implements msm_param_limiter.
Definition at line 107 of file msm_box_limiter.cxx.
void msm_box_limiter::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
void msm_box_limiter::set_acceptance | ( | double | prop, |
unsigned | n_modes = 0 |
||
) | [virtual] |
Set the limits so that a given proportion pass.
Where the parameters are described by a pdf, choose limits so that on average a proportion prop (in [0,1]) are acceptable when using n_modes modes. If n_modes==0, then assume all available modes to be used.
Implements msm_param_limiter.
Definition at line 36 of file msm_box_limiter.cxx.
void msm_box_limiter::set_n_sds | ( | double | n_sds | ) |
Define number of SDs to limit at.
Definition at line 22 of file msm_box_limiter.cxx.
void msm_box_limiter::set_param_var | ( | const vnl_vector< double > & | v | ) | [virtual] |
Define variance on each parameter.
Implements msm_param_limiter.
Definition at line 28 of file msm_box_limiter.cxx.
double msm_box_limiter::accept_prop_ [private] |
Proportion of Gaussian to be accepted.
Used to set M_max when mode_var defined.
Definition at line 26 of file msm_box_limiter.h.
vnl_vector<double> msm_box_limiter::mode_sd_ [private] |
SD on each mode.
Definition at line 19 of file msm_box_limiter.h.
double msm_box_limiter::n_sds_ [private] |
Number of SDs to limit at.
Definition at line 22 of file msm_box_limiter.h.