Skip to main content

Use specialized Curves

Through the class Curve you will have access to the generic algorithm for Ultimately Pseudo Periodic curves and, when applicable, the optimizations for Ultimately Affine ones.

However, many properties are known in DNC that allow to optimize computations even further, for example for concave curves such that f(0)=g(0)=0f(0) = g(0) = 0 the convolution can be replaced with a minimum, fg=fgf \otimes g = f \wedge g.

While Curve allows you to check these properties (e.g. IsConcave), these are not checked implicitly for optimization. You will instead have to explicitly declare your known properties through specialized classes, which will then have optimized versions of their operators, such as ConcaveCurve.

var a = new Curve(...)
var b = new ConcaveCurve(...)
if(a.IsConcave && a.ValueAt(0) == 0)
{
a = new ConcaveCurve(a); // copy constructor
}

var c = Curve.Convolution(a, b); // if a is now a ConcaveCurve, this will actually be a minimum