MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Differentiate

Method Differentiate

ngstd/bspline.cpp:27–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27 BSpline BSpline :: Differentiate () const
28 {
29 if (order <= 1) throw Exception ("cannot differentiate B-spline of order <= 1");
30 //we should create td and cd WITHOUT padding on the leftmost elements
31 Array<double> td(t.Size()-order);
32 Array<double> cd(c.Size()-order);
33 td = t.Range(order,t.Size());
34 for (int j = 0; j < cd.Size(); j++)
35 {
36 double denom = t[order+j + order-1] - t[order+j];
37 cd[j] = (denom != 0.0)
38 ? (order-1) * (c[order+j] - c[order + j - 1]) / denom
39 : 0.0;
40 }
41 return BSpline (order-1, std::move(td), std::move(cd));
42 }
43
44 BSpline BSpline :: Integrate () const
45 {

Callers

nothing calls this directly

Calls 3

BSplineClass · 0.85
SizeMethod · 0.45
RangeMethod · 0.45

Tested by

no test coverage detected