Computes weighted sum of square differences to a mean. More...
#include <mfpf_ssd_vec_cost.h>
Public Member Functions | |
mfpf_ssd_vec_cost () | |
Dflt ctor. | |
virtual | ~mfpf_ssd_vec_cost () |
Destructor. | |
void | set (const vnl_vector< double > &mean, const vnl_vector< double > &wts) |
Define mean and weights. | |
const vnl_vector< double > & | mean () const |
Mean for vector. | |
const vnl_vector< double > & | wts () const |
Weights to apply to each element in sum. | |
virtual double | evaluate (const vnl_vector< double > &v) |
Evaluate weighted sum of absolute difference from mean. | |
virtual void | get_average (vnl_vector< double > &v) const |
Return the mean. | |
short | version_no () const |
Version number for I/O. | |
virtual vcl_string | is_a () const |
Name of the class. | |
virtual mfpf_vec_cost * | 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. | |
Private Attributes | |
vnl_vector< double > | mean_ |
Mean for vector. | |
vnl_vector< double > | wts_ |
Weights to apply to each element in sum. |
Computes weighted sum of square differences to a mean.
Definition at line 12 of file mfpf_ssd_vec_cost.h.
mfpf_ssd_vec_cost::mfpf_ssd_vec_cost | ( | ) |
Dflt ctor.
Definition at line 16 of file mfpf_ssd_vec_cost.cxx.
mfpf_ssd_vec_cost::~mfpf_ssd_vec_cost | ( | ) | [virtual] |
Destructor.
Definition at line 24 of file mfpf_ssd_vec_cost.cxx.
void mfpf_ssd_vec_cost::b_read | ( | vsl_b_istream & | bfs | ) | [virtual] |
Load class from binary file stream.
Implements mfpf_vec_cost.
Definition at line 103 of file mfpf_ssd_vec_cost.cxx.
void mfpf_ssd_vec_cost::b_write | ( | vsl_b_ostream & | bfs | ) | const [virtual] |
Save class to binary file stream.
Implements mfpf_vec_cost.
Definition at line 92 of file mfpf_ssd_vec_cost.cxx.
mfpf_vec_cost * mfpf_ssd_vec_cost::clone | ( | ) | const [virtual] |
Create a copy on the heap and return base class pointer.
Implements mfpf_vec_cost.
Definition at line 74 of file mfpf_ssd_vec_cost.cxx.
double mfpf_ssd_vec_cost::evaluate | ( | const vnl_vector< double > & | v | ) | [virtual] |
Evaluate weighted sum of absolute difference from mean.
Implements mfpf_vec_cost.
Definition at line 38 of file mfpf_ssd_vec_cost.cxx.
void mfpf_ssd_vec_cost::get_average | ( | vnl_vector< double > & | v | ) | const [virtual] |
vcl_string mfpf_ssd_vec_cost::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented from mfpf_vec_cost.
Definition at line 68 of file mfpf_ssd_vec_cost.cxx.
const vnl_vector<double>& mfpf_ssd_vec_cost::mean | ( | ) | const [inline] |
Mean for vector.
Definition at line 34 of file mfpf_ssd_vec_cost.h.
void mfpf_ssd_vec_cost::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
void mfpf_ssd_vec_cost::set | ( | const vnl_vector< double > & | mean, |
const vnl_vector< double > & | wts | ||
) |
Define mean and weights.
Definition at line 29 of file mfpf_ssd_vec_cost.cxx.
short mfpf_ssd_vec_cost::version_no | ( | ) | const |
Version number for I/O.
Reimplemented from mfpf_vec_cost.
Definition at line 59 of file mfpf_ssd_vec_cost.cxx.
const vnl_vector<double>& mfpf_ssd_vec_cost::wts | ( | ) | const [inline] |
Weights to apply to each element in sum.
Definition at line 37 of file mfpf_ssd_vec_cost.h.
vnl_vector<double> mfpf_ssd_vec_cost::mean_ [private] |
Mean for vector.
Definition at line 16 of file mfpf_ssd_vec_cost.h.
vnl_vector<double> mfpf_ssd_vec_cost::wts_ [private] |
Weights to apply to each element in sum.
Definition at line 19 of file mfpf_ssd_vec_cost.h.