PLearn 0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Private Types | Private Member Functions
PLearn::EpanechnikovKernel Class Reference

#include <EpanechnikovKernel.h>

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

List of all members.

Public Member Functions

 EpanechnikovKernel ()
 Default constructor.
virtual void build ()
 Simply calls inherited::build() then build_().
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual EpanechnikovKerneldeepCopy (CopiesMap &copies) const
virtual real evaluate (const Vec &x1, const Vec &x2) const
 Compute K(x1,x2).

Static Public Member Functions

static string _classname_ ()
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Public Attributes

real gamma
 Smoothing parameter for the Epanechnikov kernel (default=1.0)

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Private Types

typedef Kernel inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 51 of file EpanechnikovKernel.h.


Member Typedef Documentation

Reimplemented from PLearn::Kernel.

Definition at line 53 of file EpanechnikovKernel.h.


Constructor & Destructor Documentation

PLearn::EpanechnikovKernel::EpanechnikovKernel ( )

Default constructor.

Definition at line 49 of file EpanechnikovKernel.cc.

    : gamma(1)
{
}

Member Function Documentation

string PLearn::EpanechnikovKernel::_classname_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 68 of file EpanechnikovKernel.cc.

OptionList & PLearn::EpanechnikovKernel::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 68 of file EpanechnikovKernel.cc.

RemoteMethodMap & PLearn::EpanechnikovKernel::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 68 of file EpanechnikovKernel.cc.

bool PLearn::EpanechnikovKernel::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Kernel.

Definition at line 68 of file EpanechnikovKernel.cc.

Object * PLearn::EpanechnikovKernel::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 68 of file EpanechnikovKernel.cc.

StaticInitializer EpanechnikovKernel::_static_initializer_ & PLearn::EpanechnikovKernel::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 68 of file EpanechnikovKernel.cc.

void PLearn::EpanechnikovKernel::build ( ) [virtual]

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

Reimplemented from PLearn::Kernel.

Definition at line 87 of file EpanechnikovKernel.cc.

References PLearn::Kernel::build(), and build_().

{
    // ### Nothing to add here, simply calls build_
    inherited::build();
    build_();
}

Here is the call graph for this function:

void PLearn::EpanechnikovKernel::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::Kernel.

Definition at line 97 of file EpanechnikovKernel.cc.

References gamma, and PLERROR.

Referenced by build().

{
    if (gamma <= 0.0)
        PLERROR("EpanechnikovKernel::build_: the 'gamma' option must be strictly positive");
}

Here is the caller graph for this function:

string PLearn::EpanechnikovKernel::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 68 of file EpanechnikovKernel.cc.

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

Declares this class' options.

Reimplemented from PLearn::Kernel.

Definition at line 74 of file EpanechnikovKernel.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Kernel::declareOptions(), and gamma.

{
    declareOption(ol, "gamma", &EpanechnikovKernel::gamma,
                  OptionBase::buildoption,
                  "Smoothing parameter for the Epanechnikov kernel (default=1.0)");

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

static const PPath& PLearn::EpanechnikovKernel::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Kernel.

Definition at line 102 of file EpanechnikovKernel.h.

EpanechnikovKernel * PLearn::EpanechnikovKernel::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Kernel.

Definition at line 68 of file EpanechnikovKernel.cc.

real PLearn::EpanechnikovKernel::evaluate ( const Vec x1,
const Vec x2 
) const [virtual]

Compute K(x1,x2).

Implements PLearn::Kernel.

Definition at line 106 of file EpanechnikovKernel.cc.

References gamma, and PLearn::L2distance().

{
    real t = L2distance(x1,x2) / gamma;
    if (t <= 1.0)
        return 3 * (1-t*t) / 4;
    return 0;
}

Here is the call graph for this function:

OptionList & PLearn::EpanechnikovKernel::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 68 of file EpanechnikovKernel.cc.

OptionMap & PLearn::EpanechnikovKernel::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 68 of file EpanechnikovKernel.cc.

RemoteMethodMap & PLearn::EpanechnikovKernel::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 68 of file EpanechnikovKernel.cc.

void PLearn::EpanechnikovKernel::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Kernel.

Definition at line 117 of file EpanechnikovKernel.cc.

References PLearn::Kernel::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::Kernel.

Definition at line 102 of file EpanechnikovKernel.h.

Smoothing parameter for the Epanechnikov kernel (default=1.0)

Definition at line 62 of file EpanechnikovKernel.h.

Referenced by build_(), declareOptions(), and evaluate().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines