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

returns exp(-(sum_i[abs(x1_i - x2_i)*phi_i])) More...

#include <ScaledLaplacianKernel.h>

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

List of all members.

Public Member Functions

 ScaledLaplacianKernel ()
 ScaledLaplacianKernel (Vec the_phi)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual ScaledLaplacianKerneldeepCopy (CopiesMap &copies) const
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.
virtual real evaluate (const Vec &x1, const Vec &x2) const
 ** Subclasses must override this method **

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 ()

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Attributes

Vec phi

Private Types

typedef Kernel inherited

Detailed Description

returns exp(-(sum_i[abs(x1_i - x2_i)*phi_i]))

Definition at line 54 of file ScaledLaplacianKernel.h.


Member Typedef Documentation

Reimplemented from PLearn::Kernel.

Definition at line 56 of file ScaledLaplacianKernel.h.


Constructor & Destructor Documentation

PLearn::ScaledLaplacianKernel::ScaledLaplacianKernel ( ) [inline]

Definition at line 61 of file ScaledLaplacianKernel.h.

        : phi() {}
PLearn::ScaledLaplacianKernel::ScaledLaplacianKernel ( Vec  the_phi) [inline]

Definition at line 63 of file ScaledLaplacianKernel.h.

        : phi(the_phi)
    {}

Member Function Documentation

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

Reimplemented from PLearn::Kernel.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 67 of file ScaledLaplacianKernel.h.

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

Reimplemented from PLearn::Kernel.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

** Subclasses must override this method **

returns K(x1,x2)

Implements PLearn::Kernel.

Definition at line 57 of file ScaledLaplacianKernel.cc.

References PLearn::TVec< T >::data(), PLearn::exp(), i, PLearn::TVec< T >::length(), n, and PLERROR.

{ 
#ifdef BOUNDCHECK
    if(x1.length()!=x2.length() || x1.length()!=phi.length())
        PLERROR("IN ScaledLaplacianKernel::evaluate x1 and x2 and phi must have the same length");
#endif

    real summ = 0.0;
    real* v1=x1.data();
    real* v2=x2.data();
    real* ph=phi.data();
    int n=x1.length();
    for(int i=0; i<n; i++)
        summ += fabs(v1[i]-v2[i])*ph[i];
    return exp(-summ);
}

Here is the call graph for this function:

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

Reimplemented from PLearn::Object.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 49 of file ScaledLaplacianKernel.cc.

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

Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.

This needs to be overridden by every class that adds "complex" data members to the class, such as Vec, Mat, PP<Something>, etc. Typical implementation:

  void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies)
  {
      inherited::makeDeepCopyFromShallowCopy(copies);
      deepCopyField(complex_data_member1, copies);
      deepCopyField(complex_data_member2, copies);
      ...
  }
Parameters:
copiesA map used by the deep-copy mechanism to keep track of already-copied objects.

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ScaledLaplacianKernel.cc.

References PLearn::deepCopyField().

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::Kernel.

Definition at line 67 of file ScaledLaplacianKernel.h.

Definition at line 59 of file ScaledLaplacianKernel.h.


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