27 const std::vector<Real>& knots)
28 :
p_(p), n_(
n), knots_(knots) {
30 QL_REQUIRE(p >= 1,
"lowest degree B-spline has p = 1");
31 QL_REQUIRE(
n >= 1,
"number of control points n+1 >= 2");
34 QL_REQUIRE(knots.size() == p+
n+2,
"number of knots must equal p+n+2");
36 for (
Size i=0; i<knots.size()-1; ++i) {
38 "knots points must be nondecreasing");
B-spline basis functions.
Real N(Natural i, Natural p, Real x) const
std::vector< Real > knots_
Real operator()(Natural i, Real x) const
BSpline(Natural p, Natural n, const std::vector< Real > &knots)
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
unsigned QL_INTEGER Natural
positive integer
std::size_t Size
size of a container