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

barf if derivative of distance is requested for two conjugate points. The...

barf if derivative of distance is requested for two conjugate points.  The derivative doesn't exist in that case

[[Imported from SVN: r5589]]
parent b06c7716
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,8 @@ public: ...@@ -64,6 +64,8 @@ public:
if (x > 1-eps) { // regular expression is unstable, use the series expansion instead if (x > 1-eps) { // regular expression is unstable, use the series expansion instead
result *= -2 + 2*(x-1)/3 - 4/15*(x-1)*(x-1) + 4/35*(x-1)*(x-1)*(x-1); result *= -2 + 2*(x-1)/3 - 4/15*(x-1)*(x-1) + 4/35*(x-1)*(x-1)*(x-1);
} else if (x < -1+eps) { // a and b are conjugate. The function is not differentiable
DUNE_THROW(Dune::Exception, "Distance is not differentiable for conjugate points!");
} else { } else {
result *= -2*std::acos(x) / std::sqrt(1-x*x); result *= -2*std::acos(x) / std::sqrt(1-x*x);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment