20#include <ql/math/bspline.hpp>
21#include <ql/errors.hpp>
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");
32 QL_REQUIRE(p <= n,
"must have p <= n");
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) {
37 QL_REQUIRE(knots[i] <= knots[i+1],
38 "knots points must be nondecreasing");
44 QL_REQUIRE(i <=
n_,
"i must not be greater than n");
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)
unsigned QL_INTEGER Natural
positive integer
std::size_t Size
size of a container