22 void casadi_nd_boor_eval(T1* ret, casadi_int n_dims,
const T1* all_knots,
const casadi_int* offset,
const casadi_int* all_degree,
const casadi_int* strides,
const T1* c, casadi_int m,
const T1* all_x,
const casadi_int* lookup_mode, casadi_int* iw, T1* w) {
24 casadi_int *boor_offset, *starts;
27 boor_offset = iw; iw+=n_dims+1;
28 starts = iw; iw+=n_dims;
34 for (k=0;k<n_dims;++k) {
38 casadi_int degree, n_knots, n_b, L, start;
39 boor = all_boor+boor_offset[k];
41 degree = all_degree[k];
42 knots = all_knots + offset[k];
43 n_knots = offset[k+1]-offset[k];
44 n_b = n_knots-degree-1;
47 L = casadi_low(x, knots+degree, n_knots-2*degree, lookup_mode[k]);
50 if (start>n_b-degree-1) start = n_b-degree-1;
54 casadi_clear(boor, 2*degree+1);
55 if (x>=knots[0] && x<=knots[n_knots-1]) {
57 casadi_fill(boor, degree+1, 1.0);
58 }
else if (x==knots[n_knots-1]) {
60 }
else if (knots[L+degree]==x) {
66 casadi_de_boor(x, knots+start, 2*degree+2, degree, boor);
68 boor_offset[k+1] = boor_offset[k] + degree+1;
71 casadi_tensor_ttv(ret, n_dims-1, n_dims, all_boor, boor_offset,
72 starts, strides, c, m, 1.0, 0);