本文整理汇总了C++中Piecewise::domainEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ Piecewise::domainEnd方法的具体用法?C++ Piecewise::domainEnd怎么用?C++ Piecewise::domainEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piecewise
的用法示例。
在下文中一共展示了Piecewise::domainEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testIntegralAndDerivative
void testIntegralAndDerivative(const Piecewise<F, BreakType>& piecewise, const Arg& value_at_start_time) {
// differentiate integral, get original back
auto piecewise_integral = integral(piecewise, value_at_start_time);
Piecewise<F, BreakType> piecewise_back = weakDerivative(piecewise_integral);
uniform_real_distribution<Arg> distribution(piecewise.domainStart(), piecewise.domainEnd());
Arg arg = distribution(engine);
valueCheck(piecewise(arg), piecewise_back(arg), 1e-8 * (Arg) 1);
valueCheck(value_at_start_time, piecewise_integral(piecewise.domainStart()), 1e-8 * (Arg) 1);
// check continuity at knot points
for (int i = 0; i < piecewise.numberOfSegments() - 1; ++i) {
const auto& f_this = (piecewise_integral.getSubfunction(i));
const auto& f_next = piecewise_integral.getSubfunction(i + 1);
valueCheck(f_this(piecewise_integral.segmentEnd(i) - piecewise_integral.segmentStart(i)), f_next(0.0), 1e-8 * (Arg) 1);
}
}