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

implement gradient of distance function

[[Imported from SVN: r5543]]
parent 05c90f5c
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,12 @@ public:
return (a.data_ - b.data_).two_norm();
}
/** \brief Compute the gradient of the distance function keeping the first argument fixed
*/
static EmbeddedTangentVector derivativeOfDistanceWRTSecondArgument(const RealTuple& a, const RealTuple& b) {
EmbeddedTangentVector gradient = a.data_ - b.data_;
return -gradient/distance(a,b);
}
/** \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