Skip to content

Support normalize #521

Closed
Closed
@oschulz

Description

@oschulz

We should support LinearAlgebra.normalize and LinearAlgebra.normalize!. Unfortunately, the default implementation isn't compatible with duals, because LinearAlgebra.__normalize! requires an AbstractFloat:

julia> normalize!(ForwardDiff.Dual.(rand(5), rand(5)))
ERROR: MethodError: no method matching __normalize!(::Vector{ForwardDiff.Dual{Nothing, Float64, 1}}, ::ForwardDiff.Dual{Nothing, Float64, 1})
Closest candidates are:
  __normalize!(::AbstractArray, ::AbstractFloat) at [...]/LinearAlgebra/src/generic.jl:1678

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