You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2025. It is now read-only.
There currently are 2 types of control point objects:
DefaultControlPoints, which is a thin wrapper around an Nin+1 dimensional array. This object can be indexed in the same way as the underlying array;
LocallyRefinedControlPoints, which is much less structured, and can only be indexed as a matrix of size (n_control_points, Nout).
This difference in indexing can lead to confusion and messy code (as is for instance already the case in SplineGrids.plot_basis!.
Apart from indexing there is also the function obtain, which yields an Nin+1 dimensional array for any control point object (which is not allocated but exists within the control points object).
To do
Should what is now called obtain actually be made methods of Base.collect? That seems sort of intuitive, although Base.collect I think often allocates a new array for the output. This requires some investigation into the precise intention of Base.collect. On the other hand, it would make intuitive sense to add a call to evaluate! for the control points when calling Base.collect, but that should not be part of obtain for more control and avoiding unnecessary calculations.
Should all control points objects have the same indexing behavior, i.e. as if it were an array of size (n_control_points, Nout)?
I think it makes most sense to have:
Indexing for accessing all degrees of freedom, i.e. the active control points of each level, for all control point types as an (n_control_points, Nout) shaped array
obtain used internally for obtaining the control point grid for spline grid evaluation
Base.collect for obtaining a copy of the control point grid for spline grid evaluation with an internall call to evaluate! on the control points beforehand.
A dedicated section in the docs for control point indexing
The current status
There currently are 2 types of control point objects:
DefaultControlPoints, which is a thin wrapper around anNin+1dimensional array. This object can be indexed in the same way as the underlying array;LocallyRefinedControlPoints, which is much less structured, and can only be indexed as a matrix of size(n_control_points, Nout).This difference in indexing can lead to confusion and messy code (as is for instance already the case in
SplineGrids.plot_basis!.Apart from indexing there is also the function
obtain, which yields anNin+1dimensional array for any control point object (which is not allocated but exists within the control points object).To do
obtainactually be made methods ofBase.collect? That seems sort of intuitive, althoughBase.collectI think often allocates a new array for the output. This requires some investigation into the precise intention ofBase.collect. On the other hand, it would make intuitive sense to add a call toevaluate!for the control points when callingBase.collect, but that should not be part ofobtainfor more control and avoiding unnecessary calculations.(n_control_points, Nout)?I think it makes most sense to have:
(n_control_points, Nout)shaped arrayobtainused internally for obtaining the control point grid for spline grid evaluationBase.collectfor obtaining a copy of the control point grid for spline grid evaluation with an internall call toevaluate!on the control points beforehand.