11#ifndef BEMBEL_SRC_SPLINE_LOCALIZE_HPP_
12#define BEMBEL_SRC_SPLINE_LOCALIZE_HPP_
25constexpr inline double Rescale(
double x,
double a,
double b)
noexcept {
26 return (
a == 0 &&
b == 1) ?
x : (
x -
a) / (
b -
a);
31inline std::vector<double> MakeInterpolationMask(
32 int polynomial_degree)
noexcept {
33 std::vector<double>
out(polynomial_degree);
34 const double h = 1. / (polynomial_degree + 1);
35 for (
int i = 0;
i < polynomial_degree;
i++) {
48 const std::vector<T> &
uniq,
const std::vector<T> &
mask)
noexcept {
54 for (
int i = 0;
i <
size - 1;
i++) {
68 int polynomial_degree,
const std::vector<double> &
mask) {
70 polynomial_degree + 1);
72 double val[Constants::MaxP + 1];
73 for (
int j = 0;
j < polynomial_degree + 1;
j++) {
74 Bembel::Basis::ShapeFunctionHandler::evalBasis(polynomial_degree,
val,
76 for (
int i = 0;
i < polynomial_degree + 1;
i++)
90 int polynomial_degree =
mask.size() - 1;
95 Eigen::Matrix<
T, -1, 1>
rhs(polynomial_degree + 1);
97 for (
int i = 0;
i <
incr;
i++) {
98 for (
int j = 0;
j < polynomial_degree + 1;
j++) {
101 Eigen::Matrix<
T, -1, 1>
tmp(polynomial_degree + 1);
104 for (
int j = 0;
j < polynomial_degree + 1;
j++) {
118 const std::vector<double> &
mask,
119 const std::vector<T> &
values) {
Eigen::Matrix< double, -1, -1 > GetInterpolationMatrix(int polynomial_degree, const std::vector< double > &mask)
returns the coefficients to represent a function in the Bernstein basis on [0,1].
std::vector< T > MakeInterpolationPoints(const std::vector< T > &uniq, const std::vector< T > &mask) noexcept
Creates a T-vector of equidistant itnerpolation points for a given knot vector without any repetition...
void GetCoefficients(const int incr, const std::vector< double > &mask, const std::vector< T > &values, T *coefs)
this solves a generic interpolation problem.
Routines for the evalutation of pointwise errors.
constexpr int getFunctionSpaceOutputDimension()