Public Member Functions | Static Public Member Functions
mcal_trivial_ca Class Reference

Generates set of axis aligned modes for non-zero element. More...

#include <mcal_trivial_ca.h>

Inheritance diagram for mcal_trivial_ca:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mcal_trivial_ca ()
 Dflt ctor.
virtual ~mcal_trivial_ca ()
 Destructor.
virtual void build_about_mean (mbl_data_wrapper< vnl_vector< double > > &data, const vnl_vector< double > &mean, vnl_matrix< double > &modes, vnl_vector< double > &mode_var)
 Compute modes of the supplied data relative to the supplied mean.
short version_no () const
 Version number for I/O.
virtual vcl_string is_a () const
 Name of the class.
virtual mcal_component_analyzerclone () 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.
void compute_mean (mbl_data_wrapper< vnl_vector< double > > &data, vnl_vector< double > &mean)
 Compute the mean of the supplied data.
virtual void build (mbl_data_wrapper< vnl_vector< double > > &data, vnl_vector< double > &mean, vnl_matrix< double > &modes, vnl_vector< double > &mode_var)
 Compute mean and modes from the supplied data.
virtual void build_from_array (const vnl_vector< double > *data, int n, vnl_vector< double > &mean, vnl_matrix< double > &modes, vnl_vector< double > &mode_var)
 Build mean and modes from data in array data[0..n-1].

Static Public Member Functions

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

Detailed Description

Generates set of axis aligned modes for non-zero element.

Given n-D input data, for each element which contains non-zero variance, generate a unit mode vector along relevant axis.

This is primarily used for testing, and trivial initialisations.

Definition at line 20 of file mcal_trivial_ca.h.


Constructor & Destructor Documentation

mcal_trivial_ca::mcal_trivial_ca ( )

Dflt ctor.

Definition at line 22 of file mcal_trivial_ca.cxx.

mcal_trivial_ca::~mcal_trivial_ca ( ) [virtual]

Destructor.

Definition at line 31 of file mcal_trivial_ca.cxx.


Member Function Documentation

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

Load class from binary file stream.

Implements mcal_component_analyzer.

Definition at line 140 of file mcal_trivial_ca.cxx.

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

Save class to binary file stream.

Implements mcal_component_analyzer.

Definition at line 131 of file mcal_trivial_ca.cxx.

void mcal_component_analyzer::build ( mbl_data_wrapper< vnl_vector< double > > &  data,
vnl_vector< double > &  mean,
vnl_matrix< double > &  modes,
vnl_vector< double > &  mode_var 
) [virtual, inherited]

Compute mean and modes from the supplied data.

Model is x = mean + modes*b, where b is a vector of weights on each mode. mode_var[i] gives the variance of the data projected onto that mode. Default computes the mean, then calls build_about_mean

Computes the mean, then calls build_about_mean

Definition at line 41 of file mcal_component_analyzer.cxx.

void mcal_trivial_ca::build_about_mean ( mbl_data_wrapper< vnl_vector< double > > &  data,
const vnl_vector< double > &  mean,
vnl_matrix< double > &  modes,
vnl_vector< double > &  mode_var 
) [virtual]

Compute modes of the supplied data relative to the supplied mean.

Model is x = mean + modes*b, where b is a vector of weights on each mode. mode_var[i] gives the variance of the data projected onto that mode.

Implements mcal_component_analyzer.

Definition at line 39 of file mcal_trivial_ca.cxx.

void mcal_component_analyzer::build_from_array ( const vnl_vector< double > *  data,
int  n,
vnl_vector< double > &  mean,
vnl_matrix< double > &  modes,
vnl_vector< double > &  mode_var 
) [virtual, inherited]

Build mean and modes from data in array data[0..n-1].

Utility function - wraps data and uses build(data,mean,modes)

Definition at line 51 of file mcal_component_analyzer.cxx.

mcal_component_analyzer * mcal_trivial_ca::clone ( ) const [virtual]

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

Implements mcal_component_analyzer.

Definition at line 114 of file mcal_trivial_ca.cxx.

void mcal_component_analyzer::compute_mean ( mbl_data_wrapper< vnl_vector< double > > &  data,
vnl_vector< double > &  mean 
) [inherited]

Compute the mean of the supplied data.

Definition at line 25 of file mcal_component_analyzer.cxx.

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

Read initialisation settings from a stream.

Parameters:

   {
   }
   
Exceptions:
mbl_exception_parse_errorif the parse fails.

Reimplemented from mcal_component_analyzer.

Definition at line 163 of file mcal_trivial_ca.cxx.

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

Create a concrete mcal_component_analyzer object, from a text specification.

Definition at line 84 of file mcal_component_analyzer.cxx.

vcl_string mcal_trivial_ca::is_a ( ) const [virtual]

Name of the class.

Implements mcal_component_analyzer.

Definition at line 96 of file mcal_trivial_ca.cxx.

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

Print class to os.

Implements mcal_component_analyzer.

Definition at line 123 of file mcal_trivial_ca.cxx.

short mcal_trivial_ca::version_no ( ) const

Version number for I/O.

Reimplemented from mcal_component_analyzer.

Definition at line 105 of file mcal_trivial_ca.cxx.


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