Base for classes to build vpdfl_pdf_base objects. More...
#include <vpdfl_builder_base.h>
Public Member Functions | |
vpdfl_builder_base () | |
Dflt ctor. | |
virtual | ~vpdfl_builder_base () |
Destructor. | |
virtual vpdfl_pdf_base * | new_model () const =0 |
Create empty model. | |
virtual void | set_min_var (double min_var)=0 |
Define lower threshold on variance for built models. | |
virtual double | min_var () const =0 |
Get lower threshold on variance for built models. | |
virtual void | build (vpdfl_pdf_base &model, const vnl_vector< double > &mean) const =0 |
Build default model with given mean. | |
virtual void | build (vpdfl_pdf_base &model, mbl_data_wrapper< vnl_vector< double > > &data) const =0 |
Build model from data. | |
virtual void | weighted_build (vpdfl_pdf_base &model, mbl_data_wrapper< vnl_vector< double > > &data, const vcl_vector< double > &wts) const =0 |
Build model from weighted data. | |
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_builder_base * | clone () const =0 |
Create a copy on the heap and return base class pointer. | |
virtual void | print_summary (vcl_ostream &os) const =0 |
Print class to os. | |
virtual void | b_write (vsl_b_ostream &bfs) const =0 |
Save class to binary file stream. | |
virtual void | b_read (vsl_b_istream &bfs)=0 |
Load class from binary file stream. | |
virtual void | config_from_stream (vcl_istream &is) |
Read initialisation settings from a stream. | |
Static Public Member Functions | |
static vcl_auto_ptr < vpdfl_builder_base > | new_builder_from_stream (vcl_istream &is) |
Create a vpdfl_builder_base object given a config stream. | |
static vcl_auto_ptr < vpdfl_builder_base > | new_pdf_builder_from_stream (vcl_istream &) |
Create a vpdfl_builder_base object given a config stream (recursive style). |
Base for classes to build vpdfl_pdf_base objects.
Design Notes:
Models are passed to builder, rather than being created by builder, for efficiency when used in mixture models. (During building they'd have to be recreated at every iteration, which is expensive).
Definition at line 35 of file vpdfl_builder_base.h.
vpdfl_builder_base::vpdfl_builder_base | ( | ) | [inline] |
Dflt ctor.
Definition at line 39 of file vpdfl_builder_base.h.
virtual vpdfl_builder_base::~vpdfl_builder_base | ( | ) | [inline, virtual] |
Destructor.
Definition at line 42 of file vpdfl_builder_base.h.
virtual void vpdfl_builder_base::b_read | ( | vsl_b_istream & | bfs | ) | [pure virtual] |
Load class from binary file stream.
Implemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
virtual void vpdfl_builder_base::b_write | ( | vsl_b_ostream & | bfs | ) | const [pure virtual] |
Save class to binary file stream.
Implemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
virtual void vpdfl_builder_base::build | ( | vpdfl_pdf_base & | model, |
const vnl_vector< double > & | mean | ||
) | const [pure virtual] |
Build default model with given mean.
Implemented in vpdfl_mixture_builder, vpdfl_kernel_pdf_builder, vpdfl_pc_gaussian_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
virtual void vpdfl_builder_base::build | ( | vpdfl_pdf_base & | model, |
mbl_data_wrapper< vnl_vector< double > > & | data | ||
) | const [pure virtual] |
Build model from data.
Implemented in vpdfl_mixture_builder, vpdfl_kernel_pdf_builder, vpdfl_pc_gaussian_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
virtual vpdfl_builder_base* vpdfl_builder_base::clone | ( | ) | const [pure virtual] |
Create a copy on the heap and return base class pointer.
Implemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_gaussian_builder, vpdfl_axis_gaussian_builder, and vpdfl_gaussian_kernel_pdf_builder.
void vpdfl_builder_base::config_from_stream | ( | vcl_istream & | is | ) | [virtual] |
Read initialisation settings from a stream.
mbl_exception_parse_error | if the parse fails. |
The default implementation merely checks that no properties have been specified.
Reimplemented in vpdfl_mixture_builder, vpdfl_kernel_pdf_builder, vpdfl_pc_gaussian_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
Definition at line 166 of file vpdfl_builder_base.cxx.
vcl_string vpdfl_builder_base::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, vpdfl_axis_gaussian_builder, and vpdfl_gaussian_kernel_pdf_builder.
Definition at line 41 of file vpdfl_builder_base.cxx.
bool vpdfl_builder_base::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Does the name of the class match the argument?.
Reimplemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, vpdfl_axis_gaussian_builder, and vpdfl_gaussian_kernel_pdf_builder.
Definition at line 48 of file vpdfl_builder_base.cxx.
virtual double vpdfl_builder_base::min_var | ( | ) | const [pure virtual] |
Get lower threshold on variance for built models.
Implemented in vpdfl_mixture_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
vcl_auto_ptr< vpdfl_builder_base > vpdfl_builder_base::new_builder_from_stream | ( | vcl_istream & | is | ) | [static] |
Create a vpdfl_builder_base object given a config stream.
mbl_exception | if parse error. |
vcl_runtime_exception | if parse error. |
This will store the constructed builder.
Incoming properties.
Definition at line 55 of file vpdfl_builder_base.cxx.
virtual vpdfl_pdf_base* vpdfl_builder_base::new_model | ( | ) | const [pure virtual] |
Create empty model.
Implemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_gaussian_builder, vpdfl_axis_gaussian_builder, and vpdfl_gaussian_kernel_pdf_builder.
vcl_auto_ptr< vpdfl_builder_base > vpdfl_builder_base::new_pdf_builder_from_stream | ( | vcl_istream & | is | ) | [static] |
Create a vpdfl_builder_base object given a config stream (recursive style).
Creates object, then uses config_from_stream(is) to set up internals
vcl_runtime_exception | if parse error. |
Creates object, then uses config_from_stream(is) to set up internals
Definition at line 145 of file vpdfl_builder_base.cxx.
virtual void vpdfl_builder_base::print_summary | ( | vcl_ostream & | os | ) | const [pure virtual] |
Print class to os.
Implemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
virtual void vpdfl_builder_base::set_min_var | ( | double | min_var | ) | [pure virtual] |
Define lower threshold on variance for built models.
Implemented in vpdfl_mixture_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
short vpdfl_builder_base::version_no | ( | ) | const |
Version number for I/O.
Reimplemented in vpdfl_mixture_builder, vpdfl_pc_gaussian_builder, vpdfl_kernel_pdf_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.
Definition at line 27 of file vpdfl_builder_base.cxx.
virtual void vpdfl_builder_base::weighted_build | ( | vpdfl_pdf_base & | model, |
mbl_data_wrapper< vnl_vector< double > > & | data, | ||
const vcl_vector< double > & | wts | ||
) | const [pure virtual] |
Build model from weighted data.
Implemented in vpdfl_mixture_builder, vpdfl_kernel_pdf_builder, vpdfl_pc_gaussian_builder, vpdfl_gaussian_builder, and vpdfl_axis_gaussian_builder.