2 #ifndef vpdl_kernel_base_h_ 3 #define vpdl_kernel_base_h_ 20 # include <vcl_msvc_warnings.h> 28 template<
class T,
unsigned int n=0>
76 const std::vector<vector>&
samples()
const 90 typedef typename std::vector<vector>::const_iterator samp_itr;
105 template<
class T,
unsigned int n=0>
147 template<
class T,
unsigned int n=0>
162 const std::vector<T>& bandwidthz)
196 const std::vector<T>& bandwidthz)
198 assert(samplez.size() == bandwidthz.size());
212 #endif // vpdl_kernel_base_h_ virtual unsigned int dimension() const
Return the run time dimension, which does not equal n when n==0.
T bandwidth() const
Access the bandwidth.
virtual void clear_samples()
Remove all sample points.
virtual void add_sample(const vector &s)
Add a new sample point.
virtual void compute_mean(vector &mean) const
Compute the mean of the distribution.
base class for multiple component distributions
vpdl_kernel_base(const std::vector< vector > &samplez)
virtual void clear_samples()
Remove all sample points.
vpdt_field_default< T, n >::type vector
the data type used for vectors.
virtual T kernel_norm_const() const =0
The normalization constant for the kernel.
vpdt_field_traits< vector >::matrix matrix
the data type used for matrices.
virtual void set_samples(const std::vector< vector > &samplez)
Set the collection of sample points.
vpdt_field_traits< vector >::matrix_type matrix
the data type used for matrices.
virtual void add_sample(const vector &s)
Add a new sample point.
unsigned int num_components() const
Return the number of components in the mixture.
vpdt_field_default< T, n >::type vector
the data type used for vectors.
std::vector< T > bandwidths_
the bandwidths for each kernel.
vpdl_kernel_vbw_base(unsigned int var_dim=n)
virtual void set_samples(const std::vector< vector > &samplez)
Set the collection of sample points.
A base class for kernel (aka Parzen window) distributions.
virtual void add_sample(const vector &s, T bw)
Add a new sample point with bandwidth.
void set_bandwidth(T b)
Set the kernel bandwidth.
T bandwidth_
the fixed bandwidth for all kernels.
vpdt_field_default< T, n >::type vector
the data type used for vectors.
void vpdt_set_size(vnl_vector< T > &v, unsigned int s)
Set the size of a vnl_vector.
The field traits class (scalar).
virtual void set_samples(const std::vector< vector > &samplez, const std::vector< T > &bandwidthz)
Set the collection of sample points and bandwidths.
vpdl_kernel_fbw_base(const std::vector< vector > &samplez, T bandwid=T(1))
The base class for all multiple component probability distributions.
Overloaded functions to allow uniform API access to various field types.
const std::vector< vector > & samples() const
Access the sample points.
vpdl_kernel_vbw_base(const std::vector< vector > &samplez, const std::vector< T > &bandwidthz)
virtual T norm_const() const
The normalization constant for the density.
vpdt_field_traits< vector >::matrix_type matrix
the data type used for matrices.
unsigned int vpdt_size(const vnl_vector< T > &v)
Access the size of a vnl_vector.
void vpdt_fill(vnl_vector< T > &v, const T &val)
Fill a vnl_vector.
A base class for variable bandwidth kernel distributions.
const std::vector< T > & bandwidths() const
Access the bandwidths.
std::vector< vector > samples_
The sample points around which the kernels are centered.
A base class for fixed bandwidth kernel distributions.