Commit fa5c228e authored by Thibault Lejemble's avatar Thibault Lejemble

second order scale derivative of weighting function

parent aaba1bc3
......@@ -105,6 +105,23 @@ public:
MULTIARCH inline Scalar scaledw(const VectorType& _q,
const DataPoint& /*attributes*/) const;
/*!
\brief Second order derivative in scale \f$t\f$
\f$ \frac{\delta^2 \frac{\left|\mathbf{q}\right|}{t}}{\delta t^2}
\nabla w(\frac{\left|\mathbf{q}\right|}{t}) +
\left(\frac{\delta \frac{\left|\mathbf{q}\right|}{t}}{\delta t}\right)^2
\nabla^2 w(\frac{\left|\mathbf{q}\right|}{t}) =
\frac{2\left|\mathbf{q}\right|}{t^3} \nabla{w(\frac{\left|\mathbf{q}\right|}{t})} -
\frac{\left|\mathbf{q}\right|^2}{t^4} \nabla^2{w(\frac{\left|\mathbf{q}\right|}{t})}
\f$
where \f$ \left|\mathbf{q}\right| \f$ represents the norm of the
query coordinates expressed in centered basis.
*/
MULTIARCH inline Scalar scaled2w(const VectorType& _q,
const DataPoint& /*attributes*/) const;
/*! \brief Access to the evaluation scale set during the initialization */
MULTIARCH inline Scalar evalScale() const { return m_t; }
......
......@@ -51,3 +51,14 @@ DistWeightFunc<DataPoint, WeightKernel>::scaledw( const VectorType& _q,
Scalar d = _q.norm();
return (d <= m_t) ? Scalar( - d*m_wk.df(d/m_t)/(m_t*m_t) ) : Scalar(0.);
}
template <class DataPoint, class WeightKernel>
typename DistWeightFunc<DataPoint, WeightKernel>::Scalar
DistWeightFunc<DataPoint, WeightKernel>::scaled2w( const VectorType& _q,
const DataPoint&) const
{
Scalar d = _q.norm();
return (d <= m_t) ? Scalar(Scalar(2.)*d/(m_t*m_t*m_t)*m_wk.df(d/m_t) -
d*d/(m_t*m_t*m_t*m_t)*m_wk.ddf(d/m_t)) :
Scalar(0.);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment