npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::LocalPolyFilterND< MaxDeg > Class Template Reference

#include <LocalPolyFilterND.hh>

Inheritance diagram for npstat::LocalPolyFilterND< MaxDeg >:
npstat::AbsPolyFilterND

Public Types

enum  { deg_size = MaxDeg }
 

Public Member Functions

template<class Array >
 LocalPolyFilterND (const double *taper, unsigned maxDegree, const Array &weight, bool mirrorWeight, const ArrayShape &dataShape)
 
 LocalPolyFilterND (const LocalPolyFilterND &)
 
LocalPolyFilterNDoperator= (const LocalPolyFilterND &)
 
unsigned dim () const
 
unsigned maxDegree () const
 
ArrayShape dataShape () const
 
double taper (unsigned degree) const
 
const PolyFilterNDgetFilter (const unsigned *index, unsigned lenIndex) const
 
const PolyFilterNDlinearGetFilter (unsigned long index) const
 
Matrix< double > getFilterMatrix () const
 
template<class Triplet >
CPP11_auto_ptr< std::vector< Triplet > > sparseFilterTriplets () const
 
double selfContribution (const unsigned *index, unsigned lenIndex) const
 
double linearSelfContribution (unsigned long index) const
 
template<class Array >
bool isCompatible (const Array &in) const
 
template<class ArrIn , class ArrOut >
void filter (const ArrIn &in, ArrOut *out) const
 
template<class ArrIn , class ArrOut >
void convolve (const ArrIn &in, ArrOut *out) const
 
template<unsigned MaxDeg2>
bool operator== (const LocalPolyFilterND< MaxDeg2 > &r) const
 
template<unsigned MaxDeg2>
bool operator!= (const LocalPolyFilterND< MaxDeg2 > &r) const
 
virtual gs::ClassId classId () const
 
virtual bool write (std::ostream &os) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static LocalPolyFilterNDread (const gs::ClassId &id, std::istream &in)
 
static unsigned classMaxDegree ()
 

Detailed Description

template<unsigned MaxDeg>
class npstat::LocalPolyFilterND< MaxDeg >

This class performs local polynomial filtering in multiple dimensions

Constructor & Destructor Documentation

◆ LocalPolyFilterND()

template<unsigned MaxDeg>
template<class Array >
npstat::LocalPolyFilterND< MaxDeg >::LocalPolyFilterND ( const double *  taper,
unsigned  maxDegree,
const Array &  weight,
bool  mirrorWeight,
const ArrayShape dataShape 
)

Main constructor. The arguments are as follows:

taper – Damping factors for each polynomial degree (starting with the 0th order term). This can be NULL in which case it is assumed that all factors are 1.

maxDegree – Maximum degree of the polynomials. The value must not exceed the "MaxDeg" template parameter. The length of the "taper" array (if not NULL) must be equal to maxDegree + 1. Note that, far away from the boundaries (where the situation is symmetric) the same filter will be produced using the same taper with an even degree N and with an odd degree N+1. Near the boundaries the filter coefficients will, of course, differ in these two cases.

weight – The array of weights.

mirrorWeight – If true, the "weight" argument represents just one hyperoctant corresponding to positive directions in all dimensions. The remaining part of the weight should be generated by reflections. If false, the "weight" argument will not be mirrored. In the latter case, the maximum of the weight should be in the array center.

dataShape – The shape of the data arrays which will be processed by this filter

Member Function Documentation

◆ convolve()

template<unsigned MaxDeg>
template<class ArrIn , class ArrOut >
void npstat::LocalPolyFilterND< MaxDeg >::convolve ( const ArrIn &  in,
ArrOut *  out 
) const

A diffent filtering method in which the shapes of the kernels are determined by the positions of the "sources" (i.e., sample points) instead of the positions at which the density (or response) is estimated. Note that elements of "out" array themselves are used as result accumulators.

◆ dataShape()

template<unsigned MaxDeg>
ArrayShape npstat::LocalPolyFilterND< MaxDeg >::dataShape ( ) const
inlinevirtual

Required shape of the data array

Implements npstat::AbsPolyFilterND.

◆ dim()

template<unsigned MaxDeg>
unsigned npstat::LocalPolyFilterND< MaxDeg >::dim ( ) const
inlinevirtual

Inspect object properties

Implements npstat::AbsPolyFilterND.

◆ filter()

template<unsigned MaxDeg>
template<class ArrIn , class ArrOut >
void npstat::LocalPolyFilterND< MaxDeg >::filter ( const ArrIn &  in,
ArrOut *  out 
) const

This method performs the filtering

◆ getFilter()

template<unsigned MaxDeg>
const PolyFilterND& npstat::LocalPolyFilterND< MaxDeg >::getFilter ( const unsigned *  index,
unsigned  lenIndex 
) const

Get the filter coefficients for the given grid point

◆ getFilterMatrix()

template<unsigned MaxDeg>
Matrix<double> npstat::LocalPolyFilterND< MaxDeg >::getFilterMatrix ( ) const

Get the complete effective filter matrix

◆ isCompatible()

template<unsigned MaxDeg>
template<class Array >
bool npstat::LocalPolyFilterND< MaxDeg >::isCompatible ( const Array &  in) const
inline

Check compatibility of an array with the filter

◆ linearGetFilter()

template<unsigned MaxDeg>
const PolyFilterND& npstat::LocalPolyFilterND< MaxDeg >::linearGetFilter ( unsigned long  index) const

Extract filter coefficients using linear grid index

◆ linearSelfContribution()

template<unsigned MaxDeg>
double npstat::LocalPolyFilterND< MaxDeg >::linearSelfContribution ( unsigned long  index) const
virtual

Contribution of a single point into the density estimate using the linear index of the point

Implements npstat::AbsPolyFilterND.

◆ selfContribution()

template<unsigned MaxDeg>
double npstat::LocalPolyFilterND< MaxDeg >::selfContribution ( const unsigned *  index,
unsigned  lenIndex 
) const
virtual

Contribution of a single point into the density estimate at that point (not normalized). This is needed for various leaving-one-out cross-validation procedures.

Implements npstat::AbsPolyFilterND.

◆ sparseFilterTriplets()

template<unsigned MaxDeg>
template<class Triplet >
CPP11_auto_ptr<std::vector<Triplet> > npstat::LocalPolyFilterND< MaxDeg >::sparseFilterTriplets ( ) const

Get the info needed to construct the sparse filter matrix


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