Functions | |
| Eigen::VectorXd | Lagrange_1D_coefficients (const Eigen::VectorXd &interpolation_points_x) |
| Compute the barycentric weights of the 1D Lagrange basis. | |
| Eigen::MatrixXd | Lagrange_1D_values (const Eigen::VectorXd &interpolation_points_x, const Eigen::VectorXd &lagrange_1D_coefficients, const Eigen::VectorXd &evaluation_points_x) |
| Evaluate the 1D Lagrange basis functions at given points. | |
| Eigen::MatrixXd | Lagrange_1D_derivative_values (const Eigen::VectorXd &interpolation_points_x, const Eigen::VectorXd &lagrange_1D_coefficients, const Eigen::VectorXd &evaluation_points_x) |
| Evaluate the derivatives of the 1D Lagrange basis functions at given points. | |
| Eigen::VectorXd Polydim::Interpolation::Lagrange::Lagrange_1D_coefficients | ( | const Eigen::VectorXd & | interpolation_points_x | ) |
Compute the barycentric weights of the 1D Lagrange basis.
Returns the weights \(w_i = \dfrac{1}{\prod_{j \neq i} (x_i - x_j)}\) associated with the interpolation nodes \(\{x_i\}\). These are computed once and reused by Lagrange_1D_values() and Lagrange_1D_derivative_values() to evaluate the basis and its derivatives efficiently.
| interpolation_points_x | Interpolation nodes \(\{x_i\}\). |
| Eigen::MatrixXd Polydim::Interpolation::Lagrange::Lagrange_1D_derivative_values | ( | const Eigen::VectorXd & | interpolation_points_x, |
| const Eigen::VectorXd & | lagrange_1D_coefficients, | ||
| const Eigen::VectorXd & | evaluation_points_x | ||
| ) |
Evaluate the derivatives of the 1D Lagrange basis functions at given points.
Computes \(\ell_i'(x) = w_i \sum_{j \neq i} \prod_{k \neq i,\,j} (x - x_k)\) (product rule applied to Lagrange_1D_values()) for every evaluation point and every basis function. With a single interpolation node the derivative is identically zero.
| interpolation_points_x | Interpolation nodes \(\{x_i\}\). |
| lagrange_1D_coefficients | Barycentric weights from Lagrange_1D_coefficients(). |
| evaluation_points_x | Points at which to evaluate the derivatives. |
| Eigen::MatrixXd Polydim::Interpolation::Lagrange::Lagrange_1D_values | ( | const Eigen::VectorXd & | interpolation_points_x, |
| const Eigen::VectorXd & | lagrange_1D_coefficients, | ||
| const Eigen::VectorXd & | evaluation_points_x | ||
| ) |
Evaluate the 1D Lagrange basis functions at given points.
Computes \(\ell_i(x) = w_i \prod_{j \neq i} (x - x_j)\) for every evaluation point \(x\) and every basis function \(\ell_i\), where \(w_i\) are the precomputed barycentric weights. With a single interpolation node the basis reduces to the constant \(1\).
| interpolation_points_x | Interpolation nodes \(\{x_i\}\). |
| lagrange_1D_coefficients | Barycentric weights from Lagrange_1D_coefficients(). |
| evaluation_points_x | Points at which to evaluate the basis. |