#include <vpdfl_mixture.h>
Inheritance diagram for vpdfl_mixture:

Definition at line 25 of file vpdfl_mixture.h.
Public Member Functions | |
| vpdfl_mixture () | |
| Dflt ctor. | |
| vpdfl_mixture (const vpdfl_mixture &) | |
| Copy ctor. | |
| vpdfl_mixture & | operator= (const vpdfl_mixture &) |
| Copy operator. | |
| virtual | ~vpdfl_mixture () |
| Destructor. | |
| virtual double | operator() (const vnl_vector< double > &x) const |
| Probability density at x. | |
| virtual double | log_p (const vnl_vector< double > &x) const |
| Log of probability density at x. | |
| virtual void | gradient (vnl_vector< double > &g, const vnl_vector< double > &x, double &p) const |
| Gradient of PDF at x. | |
| virtual void | nearest_plausible (vnl_vector< double > &x, double log_p_min) const |
| Not Yet Implemented. | |
| void | init (const vpdfl_pdf_base &comp_type, unsigned n) |
| Initialise to use n components of type comp_type. | |
| virtual vpdfl_sampler_base * | new_sampler () const |
| Return instance object for this PDF. | |
| unsigned | n_components () const |
| Number of components in mixture. | |
| double | weight (unsigned i) |
| Get ith weight. | |
| const vcl_vector< double > & | weights () const |
| Array of weights. | |
| vcl_vector< double > & | weights () |
| Array of weights. | |
| unsigned | nearest_comp (const vnl_vector< double > &x) const |
| Return index of component nearest to x. | |
| void | set (const vcl_vector< vpdfl_pdf_base * > components, const vcl_vector< double > &weights) |
| Set the contents of the mixture model. | |
| void | add_component (const vpdfl_pdf_base &comp) |
| Add a component to current model. | |
| void | clear () |
| Remove all components cleanly. | |
| const vpdfl_pdf_base & | component (unsigned i) const |
| Get ith component. | |
| vcl_vector< vpdfl_pdf_base * > & | components () |
| Access to components - for use by builders. | |
| const vcl_vector< vpdfl_pdf_base * > & | components () const |
| Access to components - for use by builders. | |
| void | set_mean_and_variance (vnl_vector< double > &m, vnl_vector< double > &v) |
| Set the whole pdf mean and variance values. | |
| virtual bool | is_valid_pdf () const |
| Return true if the object represents a valid PDF. | |
| short | version_no () const |
| Version number for I/O. | |
| virtual vcl_string | is_a () const |
| Name of the class. | |
| virtual bool | is_class (vcl_string const &s) const |
| Does the name of the class match the argument?. | |
| virtual vpdfl_pdf_base * | 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. | |
| const vnl_vector< double > & | mean () const |
| Mean of distribution. | |
| const vnl_vector< double > & | variance () const |
| Variance of each dimension. | |
| int | n_dims () const |
| Number of dimensions. | |
| virtual int | n_peaks () const |
| Number of peaks of distribution. | |
| virtual const vnl_vector< double > & | peak (int) const |
| Position of the i'th peak. | |
| virtual void | gradient_logp (vnl_vector< double > &g, const vnl_vector< double > &x) const |
| Gradient and value of log(p(x)) at x. | |
| virtual double | log_prob_thresh (double pass_proportion) const |
| Compute threshold for PDF to pass a given proportion. | |
Protected Member Functions | |
| void | set_mean (const vnl_vector< double > &m) |
| void | set_variance (const vnl_vector< double > &v) |
Private Member Functions | |
| void | delete_stuff () |
Private Attributes | |
| vcl_vector< vpdfl_pdf_base * > | component_ |
| vcl_vector< double > | weight_ |
| vnl_vector< double > | ws_ |
| Workspace so we don't have to keep creating vectors. | |
|
|
Dflt ctor.
Definition at line 31 of file vpdfl_mixture.cxx. |
|
|
Copy ctor.
Definition at line 35 of file vpdfl_mixture.cxx. |
|
|
Destructor.
Definition at line 70 of file vpdfl_mixture.cxx. |
|
|
Add a component to current model. Clone taken of comp Definition at line 164 of file vpdfl_mixture.cxx. |
|
|
Load class from binary file stream.
Implements vpdfl_pdf_base. Definition at line 278 of file vpdfl_mixture.cxx. |
|
|
Save class to binary file stream.
Implements vpdfl_pdf_base. Definition at line 267 of file vpdfl_mixture.cxx. |
|
|
Remove all components cleanly.
Definition at line 186 of file vpdfl_mixture.cxx. |
|
|
Create a copy on the heap and return base class pointer.
Implements vpdfl_pdf_base. Definition at line 246 of file vpdfl_mixture.cxx. |
|
|
Get ith component.
Definition at line 104 of file vpdfl_mixture.h. |
|
|
Access to components - for use by builders. Use component(i) where possible Definition at line 113 of file vpdfl_mixture.h. |
|
|
Access to components - for use by builders. Care must be taken to ensure consistency when modifying Use component(i) where possible Definition at line 109 of file vpdfl_mixture.h. |
|
|
Definition at line 61 of file vpdfl_mixture.cxx. |
|
||||||||||||||||
|
Gradient of PDF at x.
Implements vpdfl_pdf_base. Definition at line 351 of file vpdfl_mixture.cxx. |
|
||||||||||||
|
Gradient and value of log(p(x)) at x. Computes gradient df/dx of f(x)=log(p(x)) at x. Result is vector of same dimensionality as x. Default baseclass implementation uses gradient() to compute grad/p Reimplemented in vpdfl_axis_gaussian. Definition at line 127 of file vpdfl_pdf_base.cxx. |
|
||||||||||||
|
Initialise to use n components of type comp_type. Clones taken by comp_type Definition at line 87 of file vpdfl_mixture.cxx. |
|
|
Name of the class.
Reimplemented from vpdfl_pdf_base. Definition at line 225 of file vpdfl_mixture.cxx. |
|
|
Does the name of the class match the argument?.
Reimplemented from vpdfl_pdf_base. Definition at line 232 of file vpdfl_mixture.cxx. |
|
|
Return true if the object represents a valid PDF. This will return false, if n_dims() is 0, for example just ofter default construction. Reimplemented from vpdfl_pdf_base. Definition at line 196 of file vpdfl_mixture.cxx. |
|
|
Log of probability density at x.
Implements vpdfl_pdf_base. Definition at line 321 of file vpdfl_mixture.cxx. |
|
|
Compute threshold for PDF to pass a given proportion.
Reimplemented in vpdfl_axis_gaussian, and vpdfl_gaussian. Definition at line 40 of file vpdfl_pdf_base.cxx. |
|
|
Mean of distribution.
Definition at line 45 of file vpdfl_pdf_base.h. |
|
|
Number of components in mixture.
Definition at line 75 of file vpdfl_mixture.h. |
|
|
Number of dimensions.
Definition at line 51 of file vpdfl_pdf_base.h. |
|
|
Number of peaks of distribution.
Definition at line 54 of file vpdfl_pdf_base.h. |
|
|
Return index of component nearest to x.
Definition at line 373 of file vpdfl_mixture.cxx. |
|
||||||||||||
|
Not Yet Implemented. Compute nearest point to x which has a density above a threshold If log_p(x)>log_p_min then x unchanged. Otherwise x is moved (typically up the gradient) until log_p(x)>=log_p_min.
Implements vpdfl_pdf_base. Definition at line 402 of file vpdfl_mixture.cxx. |
|
|
Return instance object for this PDF. Object is created on heap. Caller responsible for deletion. Implements vpdfl_pdf_base. Definition at line 77 of file vpdfl_mixture.cxx. |
|
|
Probability density at x.
Reimplemented from vpdfl_pdf_base. Definition at line 314 of file vpdfl_mixture.cxx. |
|
|
Copy operator.
Definition at line 41 of file vpdfl_mixture.cxx. |
|
|
Position of the i'th peak.
Definition at line 57 of file vpdfl_pdf_base.h. |
|
|
Print class to os.
Implements vpdfl_pdf_base. Definition at line 253 of file vpdfl_mixture.cxx. |
|
||||||||||||
|
Set the contents of the mixture model. Clones are taken of all the data, and the class will be responsible for their deletion. Definition at line 131 of file vpdfl_mixture.cxx. |
|
|
Reimplemented in vpdfl_gaussian. Definition at line 34 of file vpdfl_pdf_base.h. |
|
||||||||||||
|
Set the whole pdf mean and variance values. Components and Weights should already be correct so that the error checking can work. define NDEBUG to turn off error checking. Definition at line 216 of file vpdfl_mixture.cxx. |
|
|
Definition at line 35 of file vpdfl_pdf_base.h. |
|
|
Variance of each dimension.
Definition at line 48 of file vpdfl_pdf_base.h. |
|
|
Version number for I/O.
Reimplemented from vpdfl_pdf_base. Definition at line 239 of file vpdfl_mixture.cxx. |
|
|
Get ith weight.
Definition at line 78 of file vpdfl_mixture.h. |
|
|
Array of weights. Warning care must be taken to ensure consistency when modifying weights Warning. Use weight(i) where possible Definition at line 87 of file vpdfl_mixture.h. |
|
|
Array of weights. Use weight(i) where possible Definition at line 82 of file vpdfl_mixture.h. |
|
|
Definition at line 27 of file vpdfl_mixture.h. |
|
|
Definition at line 28 of file vpdfl_mixture.h. |
|
|
Workspace so we don't have to keep creating vectors.
Definition at line 31 of file vpdfl_mixture.h. |
1.4.4