Public Member Functions | Static Public Member Functions
mcal_var_basis_cost Class Reference

Cost function returning variance along given vector. More...

#include <mcal_var_basis_cost.h>

Inheritance diagram for mcal_var_basis_cost:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mcal_var_basis_cost ()
 Dflt ctor.
virtual ~mcal_var_basis_cost ()
 Destructor.
virtual bool can_use_variance () const
 Returns true since cost can be computed from the variance.
virtual double cost (const vnl_vector< double > &unit_basis, const vnl_vector< double > &projections)
 Compute component of the cost function from given basis vector.
virtual double cost_from_variance (const vnl_vector< double > &unit_basis, double variance)
 Compute component of the cost function from given basis vector.
short version_no () const
 Version number for I/O.
virtual vcl_string is_a () const
 Name of the class.
virtual mcal_single_basis_costclone () 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.
virtual void config_from_stream (vcl_istream &is)
 Read initialisation settings from a stream.

Static Public Member Functions

static vcl_auto_ptr
< mcal_single_basis_cost
create_from_stream (vcl_istream &is)
 Create a concrete mcal_single_basis_cost object, from a text specification.

Detailed Description

Cost function returning variance along given vector.

Definition at line 14 of file mcal_var_basis_cost.h.


Constructor & Destructor Documentation

mcal_var_basis_cost::mcal_var_basis_cost ( )

Dflt ctor.

Definition at line 21 of file mcal_var_basis_cost.cxx.

mcal_var_basis_cost::~mcal_var_basis_cost ( ) [virtual]

Destructor.

Definition at line 29 of file mcal_var_basis_cost.cxx.


Member Function Documentation

void mcal_var_basis_cost::b_read ( vsl_b_istream bfs) [virtual]

Load class from binary file stream.

Implements mcal_single_basis_cost.

Definition at line 106 of file mcal_var_basis_cost.cxx.

void mcal_var_basis_cost::b_write ( vsl_b_ostream bfs) const [virtual]

Save class to binary file stream.

Implements mcal_single_basis_cost.

Definition at line 97 of file mcal_var_basis_cost.cxx.

bool mcal_var_basis_cost::can_use_variance ( ) const [virtual]

Returns true since cost can be computed from the variance.

Implements mcal_single_basis_cost.

Definition at line 34 of file mcal_var_basis_cost.cxx.

mcal_single_basis_cost * mcal_var_basis_cost::clone ( ) const [virtual]

Create a copy on the heap and return base class pointer.

Implements mcal_single_basis_cost.

Definition at line 80 of file mcal_var_basis_cost.cxx.

void mcal_var_basis_cost::config_from_stream ( vcl_istream &  is) [virtual]

Read initialisation settings from a stream.

Parameters:

   {
     alpha: 1.0
   }
   
Exceptions:
mbl_exception_parse_errorif the parse fails.

Parameters:

   {
   }
   
Exceptions:
mbl_exception_parse_errorif the parse fails.

Reimplemented from mcal_single_basis_cost.

Definition at line 129 of file mcal_var_basis_cost.cxx.

double mcal_var_basis_cost::cost ( const vnl_vector< double > &  unit_basis,
const vnl_vector< double > &  projections 
) [virtual]

Compute component of the cost function from given basis vector.

Parameters:
[in]unit_basisUnit vector defining basis direction
[in]projectionsProjections of the dataset onto this basis vector

Implements mcal_single_basis_cost.

Definition at line 42 of file mcal_var_basis_cost.cxx.

double mcal_var_basis_cost::cost_from_variance ( const vnl_vector< double > &  unit_basis,
double  variance 
) [virtual]

Compute component of the cost function from given basis vector.

Parameters:
[in]unit_basisUnit vector defining basis direction
[in]varianceVariance of projections of the dataset onto this basis vector

Cost is log(variance)

Implements mcal_single_basis_cost.

Definition at line 51 of file mcal_var_basis_cost.cxx.

vcl_auto_ptr< mcal_single_basis_cost > mcal_single_basis_cost::create_from_stream ( vcl_istream &  is) [static, inherited]

Create a concrete mcal_single_basis_cost object, from a text specification.

Definition at line 48 of file mcal_single_basis_cost.cxx.

vcl_string mcal_var_basis_cost::is_a ( ) const [virtual]

Name of the class.

Implements mcal_single_basis_cost.

Definition at line 62 of file mcal_var_basis_cost.cxx.

void mcal_var_basis_cost::print_summary ( vcl_ostream &  os) const [virtual]

Print class to os.

Implements mcal_single_basis_cost.

Definition at line 89 of file mcal_var_basis_cost.cxx.

short mcal_var_basis_cost::version_no ( ) const

Version number for I/O.

Reimplemented from mcal_single_basis_cost.

Definition at line 71 of file mcal_var_basis_cost.cxx.


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