I am looking for an example on resizing an 1D array using the Spline Functions with the Apache Commons - Math.
What I need is a method to expand and/or shrink the input array (double[]).
I could not find a good example trying to search online.
I am looking for an example on resizing an 1D array using the Spline Functions with the Apache Commons - Math.
What I need is a method to expand and/or shrink the input array (double[]).
I could not find a good example trying to search online.
Copyright © 2021 Jogjafile Inc.
The trick here is that you need two
arraysto create asplinebut you only have one. Thus you need to fabricate anarray. You can assume that the inputarraycontains youryvalues and that the new fabricated array contains yourxvalues so for any givenxyou have a correspondingy.Disclaimer, I have not tested this code so make sure to adjust accordingly.
To
shrinkthe array you can eitherdecimatethe inputarrayi.e. just create a new smallerarrayand just take the values based on the new step size or use aninterpolatoras before: