Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Make SplineGrid evaluation 'less in-place' #97

@SouthEndMusic

Description

@SouthEndMusic

The in-place nature of the SplineGrid evaluation makes defining custom AD rules quite a hassle if not impossible in certain cases. Therefore I propose:

  • Make a method evaluate!(eval::AbstractArray{Tv}, control_points::AbstractControlPointArray{Tv}, weights::AbstractWeightArray{Tv}, spline_grid::SplineGrid{Tv}; kwargs...) where {Tv} which contains the actual computation (and analogous for evaluate_adjoint!);
  • Make convenience methods of the methods above where the weights do not have to be specified;
  • Make a convenience evaluate! method for SplineGrid with the signature that already exists, calling the above
  • Specify in the docs that for use with AD these more explicit methods should be used

where const AbstractWeightArray{Tv} = Union{Nothing, AbstractArray{Tv}} where {Tv}

Something similar is also convenient for evaluation of locally refined control points. This should probably be a follow-up issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RefactorRewrite existing functionality in a better way

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions