9template <
class DataPo
int,
class WeightKernel>
10typename DistWeightFilter<DataPoint, WeightKernel>::WeightReturnType DistWeightFilter<
11 DataPoint, WeightKernel>::operator()(
const DataPoint& _q)
const
13 const auto lq = NeighborhoodFrame::convertToLocalBasis(_q.pos());
16 return {(d <= m_t) ? m_wk.f(d / m_t) : Scalar(0.), lq};
18 return {m_wk.f(d / m_t), lq};
21template <
class DataPo
int,
class WeightKernel>
22typename DistWeightFilter<DataPoint, WeightKernel>::VectorType DistWeightFilter<DataPoint, WeightKernel>::spacedw(
23 const VectorType& _q,
const DataPoint&)
const
26 VectorType result = VectorType::Zero();
27 const auto q = NeighborhoodFrame::convertToLocalBasis(_q);
30 if ((!isCompact) || (d <= m_t && d != Scalar(0.)))
31 result = (q / (d * m_t)) * m_wk.df(d / m_t);
35template <
class DataPo
int,
class WeightKernel>
36typename DistWeightFilter<DataPoint, WeightKernel>::MatrixType DistWeightFilter<DataPoint, WeightKernel>::spaced2w(
37 const VectorType& _q,
const DataPoint&)
const
40 MatrixType result = MatrixType::Zero();
41 const auto q = NeighborhoodFrame::convertToLocalBasis(_q);
43 if ((!isCompact) || (d <= m_t && d != Scalar(0.)))
45 Scalar der = m_wk.df(d / m_t);
46 result = q * q.transpose() / d * (m_wk.ddf(d / m_t) / m_t - der / d);
47 result.diagonal().array() += der;
48 result *= Scalar(1.) / (m_t * d);
53template <
class DataPo
int,
class WeightKernel>
54typename DistWeightFilter<DataPoint, WeightKernel>::Scalar DistWeightFilter<DataPoint, WeightKernel>::scaledw(
55 const VectorType& _q,
const DataPoint&)
const
58 Scalar d = NeighborhoodFrame::convertToLocalBasis(_q).norm();
59 return ((!isCompact) || (d <= m_t)) ? Scalar(-d * m_wk.df(d / m_t) / (m_t * m_t)) : Scalar(0.);
62template <
class DataPo
int,
class WeightKernel>
63typename DistWeightFilter<DataPoint, WeightKernel>::Scalar DistWeightFilter<DataPoint, WeightKernel>::scaled2w(
64 const VectorType& _q,
const DataPoint&)
const
67 Scalar d = NeighborhoodFrame::convertToLocalBasis(_q).norm();
68 return ((!isCompact) || (d <= m_t)) ? Scalar(Scalar(2.) * d / (m_t * m_t * m_t) * m_wk.df(d / m_t) +
69 d * d / (m_t * m_t * m_t * m_t) * m_wk.ddf(d / m_t))
73template <
class DataPo
int,
class WeightKernel>
74typename DistWeightFilter<DataPoint, WeightKernel>::VectorType DistWeightFilter<DataPoint, WeightKernel>::scaleSpaced2w(
75 const VectorType& _q,
const DataPoint&)
const
78 VectorType result = VectorType::Zero();
79 const auto q = NeighborhoodFrame::convertToLocalBasis(_q);
81 if ((!isCompact) || (d <= m_t && d != Scalar(0.)))
82 result = -q / (m_t * m_t) * (m_wk.df(d / m_t) / d + m_wk.ddf(d / m_t) / m_t);