Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::SourceKernel Class Reference

#include <SourceKernel.h>

Inheritance diagram for PLearn::SourceKernel:

Inheritance graph
[legend]
Collaboration diagram for PLearn::SourceKernel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SourceKernel ()
 Default constructor.

virtual void build ()
 Simply calls inherited::build() then build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (SourceKernel)
virtual real evaluate (const Vec &x1, const Vec &x2) const
 Compute K(x1,x2).

virtual void addDataForKernelMatrix (const Vec &newRow)
 Overridden to forward to source_kernel.

virtual void computeGramMatrix (Mat K) const
 Call evaluate_i_j to fill each of the entries (i,j) of symmetric matrix K.

virtual real evaluate_i_j (int i, int j) const
 returns evaluate(data(i),data(j))

virtual real evaluate_i_x (int i, const Vec &x, real squared_norm_of_x=-1) const
virtual real evaluate_x_i (const Vec &x, int i, real squared_norm_of_x=-1) const
 returns evaluate(x,data(i)) [default version calls evaluate_i_x if kernel is_symmetric]

virtual void setDataForKernelMatrix (VMat the_data)
 ** Subclasses may overload these methods to provide efficient kernel matrix access **

virtual void setParameters (Vec paramvec)
 default version produces an error

virtual Vec getParameters () const
 default version returns an empty Vec


Public Attributes

Ker source_kernel

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Private Types

typedef Kernel inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef Kernel PLearn::SourceKernel::inherited [private]
 

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 57 of file SourceKernel.h.


Constructor & Destructor Documentation

PLearn::SourceKernel::SourceKernel  ) 
 

Default constructor.

Definition at line 51 of file SourceKernel.cc.


Member Function Documentation

void PLearn::SourceKernel::addDataForKernelMatrix const Vec newRow  )  [virtual]
 

Overridden to forward to source_kernel.

Reimplemented from PLearn::Kernel.

Definition at line 103 of file SourceKernel.cc.

References source_kernel, and PLearn::Vec.

void PLearn::SourceKernel::build  )  [virtual]
 

Simply calls inherited::build() then build_().

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 77 of file SourceKernel.cc.

References build_().

void PLearn::SourceKernel::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 86 of file SourceKernel.cc.

References source_kernel.

Referenced by build().

void PLearn::SourceKernel::computeGramMatrix Mat  K  )  const [virtual]
 

Call evaluate_i_j to fill each of the entries (i,j) of symmetric matrix K.

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 113 of file SourceKernel.cc.

References PLearn::Mat, and source_kernel.

void PLearn::SourceKernel::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 65 of file SourceKernel.cc.

References PLearn::declareOption(), and PLearn::OptionList.

real PLearn::SourceKernel::evaluate const Vec x1,
const Vec x2
const [virtual]
 

Compute K(x1,x2).

Implements PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 120 of file SourceKernel.cc.

References source_kernel.

real PLearn::SourceKernel::evaluate_i_j int  i,
int  j
const [virtual]
 

returns evaluate(data(i),data(j))

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 127 of file SourceKernel.cc.

References source_kernel.

real PLearn::SourceKernel::evaluate_i_x int  i,
const Vec x,
real  squared_norm_of_x = -1
const [virtual]
 

returns evaluate(data(i),x) [squared_norm_of_x is just a hint that may allow to speed up computation if it is already known, but it's optional]

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 134 of file SourceKernel.cc.

References source_kernel, and x.

real PLearn::SourceKernel::evaluate_x_i const Vec x,
int  i,
real  squared_norm_of_x = -1
const [virtual]
 

returns evaluate(x,data(i)) [default version calls evaluate_i_x if kernel is_symmetric]

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 141 of file SourceKernel.cc.

References source_kernel, and x.

Vec PLearn::SourceKernel::getParameters  )  const [virtual]
 

default version returns an empty Vec

Reimplemented from PLearn::Kernel.

Definition at line 148 of file SourceKernel.cc.

References source_kernel.

void PLearn::SourceKernel::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 155 of file SourceKernel.cc.

References PLearn::deepCopyField(), and source_kernel.

PLearn::SourceKernel::PLEARN_DECLARE_OBJECT SourceKernel   ) 
 

void PLearn::SourceKernel::setDataForKernelMatrix VMat  the_data  )  [virtual]
 

** Subclasses may overload these methods to provide efficient kernel matrix access **

This method sets the data VMat that will be used to define the kernel matrix. It may precompute values from this that may later accelerate the evaluation of a kernel matrix element

Reimplemented from PLearn::Kernel.

Reimplemented in PLearn::AdditiveNormalizationKernel, and PLearn::DivisiveNormalizationKernel.

Definition at line 164 of file SourceKernel.cc.

References source_kernel.

void PLearn::SourceKernel::setParameters Vec  paramvec  )  [virtual]
 

default version produces an error

Reimplemented from PLearn::Kernel.

Definition at line 172 of file SourceKernel.cc.

References source_kernel.


Member Data Documentation

Ker PLearn::SourceKernel::source_kernel
 

Definition at line 71 of file SourceKernel.h.

Referenced by addDataForKernelMatrix(), build_(), computeGramMatrix(), evaluate(), evaluate_i_j(), evaluate_i_x(), evaluate_x_i(), getParameters(), makeDeepCopyFromShallowCopy(), setDataForKernelMatrix(), and setParameters().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:46 2004 for PLearn by doxygen 1.3.7