-
Notifications
You must be signed in to change notification settings - Fork 0
Description
There are a few ways in which the offline setup cost of the SmolyakBarycentricInterpolator
can be reduced further.
1. Leverage vectorization for evaluating the target function f
In the current form, the method set_f
of SmolyakBarycentricInterpolator
iterates over all interpolation nodes of all tensor product interpolants, evaluates the target function f
at that node (or retrieves the value from a cache), and stores the results in internal data structures.
For target functions that support vectorized evaluation even run on GPU, this approach is not yet optimal. To leverage vectorization, the unique input values (interpolation nodes) have to be assembled into an array first. The resulting output array from f
must then be distributed back into the internal data structures of the interpolation operator.
2. Increase vectorization for constructing the interpolation nodes and weights
The for
-loops currently in place in the method __build_nodes_weights
of SmolyakBarycentricInterpolator
can be replaced by a tensorized approach to generating the nodes and weights.