Public Member Functions | Static Public Member Functions
vpdfl_builder_base Class Reference

Base for classes to build vpdfl_pdf_base objects. More...

#include <vpdfl_builder_base.h>

Inheritance diagram for vpdfl_builder_base:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vpdfl_builder_base ()
 Dflt ctor.
virtual ~vpdfl_builder_base ()
 Destructor.
virtual vpdfl_pdf_basenew_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_baseclone () 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).

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual void vpdfl_builder_base::b_read ( vsl_b_istream bfs) [pure virtual]
virtual void vpdfl_builder_base::b_write ( vsl_b_ostream bfs) const [pure virtual]
virtual void vpdfl_builder_base::build ( vpdfl_pdf_base model,
const vnl_vector< double > &  mean 
) const [pure virtual]
virtual void vpdfl_builder_base::build ( vpdfl_pdf_base model,
mbl_data_wrapper< vnl_vector< double > > &  data 
) const [pure virtual]
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.

Exceptions:
mbl_exception_parse_errorif 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]
bool vpdfl_builder_base::is_class ( vcl_string const &  s) const [virtual]
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.

Exceptions:
mbl_exceptionif parse error.
vcl_runtime_exceptionif 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]
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

Exceptions:
vcl_runtime_exceptionif 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]
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
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]

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