nuklei::kernel::base Class Referenceabstract

Polymorphic kernel class. More...

#include <Kernel.h>

Inheritance diagram for nuklei::kernel::base:
nuklei::kernel::implementation_prototype< r3 > nuklei::kernel::implementation_prototype< r3xs2_base< OriGrp > > nuklei::kernel::implementation_prototype< se3 > nuklei::kernel::implementation_prototype< T > nuklei::kernel::r3 nuklei::kernel::r3xs2_base< OriGrp > nuklei::kernel::se3

Classes

struct  WeightAccessor
 Weight accessor for kernel::base. The accessor is used internally. Normal Nuklei users will generally not need it. More...
 

Public Types

enum  Type {
  R3 = 0, R3XS2, R3XS2P, SE3,
  UNKNOWN
}
 Explicit query of a kernel's type. See Type Queries for more info.
 
typedef NUKLEI_UNIQUE_PTR< kernel::baseptr
 NUKLEI_UNIQUE_PTR for kernel::base.
 

Public Member Functions

virtual void assertConsistency () const =0
 
virtual std::ostream & polyPrint (std::ostream &out) const =0
 Prints the kernel parameters to the provided stream. More...
 
bool operator< (const kernel::base &k) const
 Weight-based kernel comparator.
 
bool operator> (const kernel::base &k) const
 Weight-based kernel comparator.
 
virtual base::ptr clone () const =0
 Clone the kernel.
 
virtual base::ptr create () const =0
 Create a new kernel of the same type.
 
virtual Vector3 getLoc () const =0
 Get the location component of the kernel.
 
virtual void setLoc (const Vector3 &v)=0
 Set the location component of the kernel.
 
virtual coord_t getLocH () const =0
 Get the location bandwidth.
 
virtual void setLocH (const coord_t h)=0
 Set the location bandwidth.
 
virtual coord_t getOriH () const =0
 Get the orientation bandwidth. More...
 
virtual void setOriH (const coord_t h)=0
 Set the orientation bandwidth. More...
 
virtual Type polyType () const =0
 Get the "kernel type", i.e., its domain of definition.
 
virtual coord_t polyEval (const base &k) const =0
 Evaluate the kernel at the location/orientation of k.
 
virtual coord_t polyCutPoint () const =0
 Distance (from the origin) at which the value of the kernel becomes zero.
 
virtual base::ptr polySample () const =0
 Get a sample from the kernel.
 
virtual NUKLEI_UNIQUE_PTR< kernel::se3polySe3Sample () const =0
 Get an \( SE(3) \) sample from the kernel. More...
 
virtual NUKLEI_UNIQUE_PTR< kernel::se3polySe3Proj () const =0
 Get an \( SE(3) \) version of the kernel. More...
 
virtual base::ptr polyTransformedWith (const kernel::se3 &k) const =0
 Transforms *this with k and returns the result. (See Operations on Poses.)
 
virtual void polyMakeTransformWith (const kernel::se3 &k)=0
 Transforms *this with k and sets *this to the result. (See Operations on Poses.)
 
virtual base::ptr polyProjectedOn (const kernel::se3 &k) const =0
 Projects *this onto k and returns the result. (See Operations on Poses.)
 
virtual base::ptr polyLinearInterpolation (const kernel::base &k, const coord_t x=.5) const =0
 Interpolates between *this and k. More...
 
virtual void polyUpdateWidth (const kernel::base &k, const coord_t x=.5)=0
 Used internally.
 
virtual coord_pair polyDistanceTo (const kernel::base &k) const =0
 Returns a std::pair containing the distance in position and orientation between *this and k.
 
weight_t getWeight () const
 Returns this kernel's weight.
 
void setWeight (const weight_t w)
 Sets this kernel's weight.
 
bool hasDescriptor () const
 
DescriptorgetDescriptor ()
 
const DescriptorgetDescriptor () const
 
void setDescriptor (const Descriptor &desc)
 
void clearDescriptor ()
 
void setFlag (bitfield_t flag)
 
void resetFlag (bitfield_t flag)
 
bool getFlag (bitfield_t flag) const
 

Static Public Attributes

static const Type defaultType = SE3
 Explicit query of a kernel's type. See Type Queries for more info.
 
static const std::string TypeNames [] = { "r3", "r3xs2", "r3xs2p", "se3" }
 Explicit query of a kernel's type. See Type Queries for more info.
 

Protected Member Functions

 base (const base &k)
 
baseoperator= (const base &k)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

weight_t w_
 
int flag1_
 
bitfield_t bitfield_
 
NUKLEI_UNIQUE_PTR< Descriptordesc_
 

Friends

class NUKLEI_SERIALIZATION_FRIEND_CLASSNAME
 
std::ostream & operator<< (std::ostream &out, const kernel::base &k)
 Calls polyPrint.
 

Detailed Description

Polymorphic kernel class.

This class serves as an abstract base for kernels defined on various subspaces of \( SE(3) \). See Kernels, kernel density estimation, kernel regression for a discussion of what a kernel is. See Programming Paradigms and Semantics for an overview and motivation of the kernel class hierarchy.

See Programming Paradigms and Semantics for an explanation of why some of the methods begin with poly.

In Nuklei, the kernel classes (kernel::base and its descendants) play the double role of representing kernels and points. For instance, there is no class specifically designed for holding an \( SE(3) \) point, the class kernel::se3 is used for that purpose.

Definition at line 45 of file Kernel.h.

Member Function Documentation

◆ getOriH()

virtual coord_t nuklei::kernel::base::getOriH ( ) const
pure virtual

Get the orientation bandwidth.

This method is implemented in child classes. In classes that do not have an orientation (or a direction), this method returns 0.

Implemented in nuklei::kernel::r3, nuklei::kernel::r3xs2_base< OriGrp >, and nuklei::kernel::se3.

◆ polyLinearInterpolation()

virtual base::ptr nuklei::kernel::base::polyLinearInterpolation ( const kernel::base k,
const coord_t  x = .5 
) const
pure virtual

Interpolates between *this and k.

For x = 0, this function returns *this. If x = 1, it returns k. For orientation, interpolation is done in Euclidean space. Slerp should be used instead. To be fixed soon.

Implemented in nuklei::kernel::implementation_prototype< T >, nuklei::kernel::implementation_prototype< r3xs2_base< OriGrp > >, nuklei::kernel::implementation_prototype< r3 >, and nuklei::kernel::implementation_prototype< se3 >.

◆ polyPrint()

virtual std::ostream& nuklei::kernel::base::polyPrint ( std::ostream &  out) const
pure virtual

Prints the kernel parameters to the provided stream.

The purpose of this method is debugging. It shouldn't be used for serialization.

Implemented in nuklei::kernel::implementation_prototype< T >, nuklei::kernel::implementation_prototype< r3xs2_base< OriGrp > >, nuklei::kernel::implementation_prototype< r3 >, and nuklei::kernel::implementation_prototype< se3 >.

◆ polySe3Proj()

virtual NUKLEI_UNIQUE_PTR<kernel::se3> nuklei::kernel::base::polySe3Proj ( ) const
pure virtual

Get an \( SE(3) \) version of the kernel.

Take a sample from the kernel. If the kernel is defined on a subspace of \( SE(3) \), make it \( SE(3) \) by selecting random values from a uniform distribution for the extra DOFs.

Implemented in nuklei::kernel::implementation_prototype< T >.

◆ polySe3Sample()

virtual NUKLEI_UNIQUE_PTR<kernel::se3> nuklei::kernel::base::polySe3Sample ( ) const
pure virtual

Get an \( SE(3) \) sample from the kernel.

Take a sample from the kernel. If the kernel is defined on a subspace of \( SE(3) \), make the sample \( SE(3) \) by selecting random values from a uniform distribution for the extra DOFs.

Implemented in nuklei::kernel::implementation_prototype< T >.

◆ setOriH()

virtual void nuklei::kernel::base::setOriH ( const coord_t  h)
pure virtual

Set the orientation bandwidth.

This method is implemented in child classes. In classes that do not have an orientation (or a direction), this method does nothing.

Implemented in nuklei::kernel::r3, nuklei::kernel::r3xs2_base< OriGrp >, and nuklei::kernel::se3.


The documentation for this class was generated from the following files:
© Copyright 2007-2013 Renaud Detry.
Distributed under the terms of the GNU General Public License (GPL).
(See accompanying file LICENSE.txt or copy at http://www.gnu.org/copyleft/gpl.html.)
Revised Sun Sep 13 2020 19:10:14.