Skip to content
Snippets Groups Projects
Commit 9dafdb46 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

implement derivativeOfDistanceSquaredWRTSecondArgument()

[[Imported from SVN: r5547]]
parent 0d2b8290
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,14 @@ public:
return -gradient/distance(a,b);
}
/** \brief Compute the gradient of the squared distance function keeping the first argument fixed
Unlike the distance itself the squared distance is differentiable at zero
*/
static EmbeddedTangentVector derivativeOfDistanceSquaredWRTSecondArgument(const RealTuple& a, const RealTuple& b) {
return -2*(a.data_ - b.data_);
}
/** \brief Write LocalKey object to output stream */
friend std::ostream& operator<< (std::ostream& s, const RealTuple& realTuple)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment