bgrimstad / splinter

Library for multivariate function approximation with splines (B-spline, P-spline, and more) with interfaces to C++, C, Python and MATLAB
Mozilla Public License 2.0
417 stars 116 forks source link

Interface to get spline coefficients #89

Closed XWarin closed 7 years ago

XWarin commented 7 years ago

Dear Splinter developper

I need to get the polynomial coefficients and the mesh grid caracteristics associated to these coefficients. Is there a C++ function to get theses informations. Thank you for this very good library ! Sincerely yours

Xavier Warin

bgrimstad commented 7 years ago

Hello Xavier,

Currently, you have access to the control points (coefficients), knot vectors and basis degrees via BSpline::getControlPoints, BSpline::getKnotVectors and BSpline::getBasisDegrees, respectively. The grid and the control points of the basis functions that have support on a given grid cell can be derived from these values.

Unfortunately, there are no helper functions for this, but you may cleverly use BSpline::evalBasis to see which basis functions that have support at the midpoint of a grid cell. You may then extract the corresponding control points, which have the same indices as the non-zero basis functions.

Hope this may help you.

Kind regards, Bjarne

XWarin commented 7 years ago

Hi Bjarne

Thank you. I will try this soon. Best regards.

Xavier

2017-08-02 10:10 GMT+02:00 Bjarne Grimstad notifications@github.com:

Hello Xavier,

Currently, you have access to the control points (coefficients), knot vectors and basis degrees via BSpline::getControlPoints, BSpline::getKnotVectors and BSpline::getBasisDegrees, respectively. The grid and the control points of the basis functions that have support on a given grid cell can be derived from these values.

Unfortunately, there are no helper functions for this, but you may cleverly use BSpline::evalBasis to see which basis functions that have support at the midpoint of a grid cell. You may then extract the corresponding control points, which have the same indices as the non-zero basis functions.

Hope this may help you.

Kind regards, Bjarne

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bgrimstad/splinter/issues/89#issuecomment-319600671, or mute the thread https://github.com/notifications/unsubscribe-auth/ALThAZx_4u7vLgq5KeKqJot2M4mB9KRWks5sUC7kgaJpZM4OnTP3 .