Surface derivative #16
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added the possibility to create a derivative of a fitpack_grid_surface. In order to do that I decided to split the original fitpack_grid_surface in two different user defined type, one the original but having eliminated from it the information about the knots. The other one contains the results of the fit or of the interpolation.
This was necessary because it would be senseless to fit again with the method fit or the method interpolate the derivative of a spline.
I think the code is better this way with two separate class, one that is basically a fitter and the other one the is the resulting spline.
We may think of other method that can be applied to a resulting spline. But let's see.
In the way I corrected a bug. The original sizes of the work arrays were calculated in advance and depended on the size of the arrays used in the fitting. But when evaluating a 2D spline the sizes of the work arrays should depend on the size of the x and y arrays where one want the spline calculated. For example if one use to fit a spline with array long NX and NY but want the resulting spline on array long 10NX and 10NY, well, the size of the pre-calculated work array is not enough.
So while I keep the work arrays in the fitpack_grid_surface I added other work arrays in fitpack_grid_result.
I also added some procedure to increase the size of the work arrays when needed.
The could be other things that may be done, like returning the variable ier in the fitpack_grid_result, or change its name or apply the same concept to the other surface splines.
So it is still a work in progress. But I would like your comments.
Cheers