Skip to content

Default k adapt to data length #90

@RibeiroAndre

Description

@RibeiroAndre

Hello,
Currently this:

a=Spline1D([1,2,3],[2,4,8])

fails because k is 3 by default.
I propose that if the data length is 2, k=1, if it's 3, k=2, otherwise, k=3.
So the code change would likely be:

function Spline1D(x::AbstractVector, y::AbstractVector,
                  ...,
                  k::Int=min(length(x)-1,3), ...

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