Skip to content

Add mutating versions of functions that reuse external storage for sigma points and weights #110

@bvdmitri

Description

@bvdmitri

Hey! Thanks for this amazing package. Would it be possible to add mutating version of all functions that would support and reuse external storage for sigma points and weights instead of allocating a new one each time, e.g:

n = 100

sigmap  = Vector{Float64}(undef, n)
weights = Vector{Float64}(undef, n)

alpha = 1.0

gausslaguerre!(sigmap, weights, n, alpha)

Usually it is a good practice in Julia to have such functions, e.g. we have map!, filter! etc.

The benefit of this would be improved performance in cases where you need continuously recompute sigma points and weights for different alpha parameter for example (for gausslaguerre). Non-mutating versions would be simply:

# Float64 here is just an example, maybe support type for storage as well?
gausslaguerre(n, alpha) = gausslaguerre!(Vector{Float64}(undef, n), Vector{Float64}(undef, n), n, alpha)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions