Base for classes to build pdf1d_pdf objects. More...
#include <pdf1d_builder.h>
Public Member Functions | |
pdf1d_builder () | |
Dflt ctor. | |
virtual | ~pdf1d_builder () |
Destructor. | |
virtual pdf1d_pdf * | new_model () const =0 |
Create empty model. | |
virtual vcl_string | new_model_type () const =0 |
Name of the model class returned by new_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 (pdf1d_pdf &model, double mean) const =0 |
Build default model with given mean. | |
virtual void | build (pdf1d_pdf &model, mbl_data_wrapper< double > &data) const =0 |
Build model from data. | |
virtual void | build_from_array (pdf1d_pdf &model, const double *data, int n) const |
Build model from data. | |
virtual void | weighted_build (pdf1d_pdf &model, mbl_data_wrapper< 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 pdf1d_builder * | 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. |
Base for classes to build pdf1d_pdf 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 29 of file pdf1d_builder.h.
pdf1d_builder::pdf1d_builder | ( | ) |
Dflt ctor.
Definition at line 15 of file pdf1d_builder.cxx.
pdf1d_builder::~pdf1d_builder | ( | ) | [virtual] |
Destructor.
Definition at line 21 of file pdf1d_builder.cxx.
virtual void pdf1d_builder::b_read | ( | vsl_b_istream & | bfs | ) | [pure virtual] |
Load class from binary file stream.
Implemented in pdf1d_kernel_pdf_builder, pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
virtual void pdf1d_builder::b_write | ( | vsl_b_ostream & | bfs | ) | const [pure virtual] |
Save class to binary file stream.
Implemented in pdf1d_kernel_pdf_builder, pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
virtual void pdf1d_builder::build | ( | pdf1d_pdf & | model, |
double | mean | ||
) | const [pure virtual] |
Build default model with given mean.
Implemented in pdf1d_mixture_builder, pdf1d_kernel_pdf_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
virtual void pdf1d_builder::build | ( | pdf1d_pdf & | model, |
mbl_data_wrapper< double > & | data | ||
) | const [pure virtual] |
Build model from data.
Implemented in pdf1d_mixture_builder, pdf1d_kernel_pdf_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
void pdf1d_builder::build_from_array | ( | pdf1d_pdf & | model, |
const double * | data, | ||
int | n | ||
) | const [virtual] |
Build model from data.
Default wraps up data and calls build(model,wrapper);
Reimplemented in pdf1d_kernel_pdf_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
Definition at line 26 of file pdf1d_builder.cxx.
virtual pdf1d_builder* pdf1d_builder::clone | ( | ) | const [pure virtual] |
Create a copy on the heap and return base class pointer.
Implemented in pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
vcl_string pdf1d_builder::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented in pdf1d_kernel_pdf_builder, pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
Definition at line 49 of file pdf1d_builder.cxx.
bool pdf1d_builder::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Does the name of the class match the argument?.
Reimplemented in pdf1d_kernel_pdf_builder, pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
Definition at line 56 of file pdf1d_builder.cxx.
virtual double pdf1d_builder::min_var | ( | ) | const [pure virtual] |
Get lower threshold on variance for built models.
Implemented in pdf1d_mixture_builder, pdf1d_kernel_pdf_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
virtual pdf1d_pdf* pdf1d_builder::new_model | ( | ) | const [pure virtual] |
Create empty model.
Implemented in pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
virtual vcl_string pdf1d_builder::new_model_type | ( | ) | const [pure virtual] |
Name of the model class returned by new_model().
Implemented in pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
virtual void pdf1d_builder::print_summary | ( | vcl_ostream & | os | ) | const [pure virtual] |
Print class to os.
Implemented in pdf1d_kernel_pdf_builder, pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
virtual void pdf1d_builder::set_min_var | ( | double | min_var | ) | [pure virtual] |
Define lower threshold on variance for built models.
Implemented in pdf1d_mixture_builder, pdf1d_kernel_pdf_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.
short pdf1d_builder::version_no | ( | ) | const |
Version number for I/O.
Reimplemented in pdf1d_kernel_pdf_builder, pdf1d_mixture_builder, pdf1d_exponential_builder, pdf1d_flat_builder, pdf1d_gaussian_builder, pdf1d_epanech_kernel_pdf_builder, and pdf1d_gaussian_kernel_pdf_builder.
Definition at line 35 of file pdf1d_builder.cxx.
virtual void pdf1d_builder::weighted_build | ( | pdf1d_pdf & | model, |
mbl_data_wrapper< double > & | data, | ||
const vcl_vector< double > & | wts | ||
) | const [pure virtual] |
Build model from weighted data.
Implemented in pdf1d_mixture_builder, pdf1d_kernel_pdf_builder, pdf1d_exponential_builder, pdf1d_flat_builder, and pdf1d_gaussian_builder.