Skip to content

Implement one for R<:Rotation to respect the algebra of SO(n) #114

@c42f

Description

@c42f

As described at JuliaArrays/StaticArrays.jl#763, Rotations relies on a particular buggy definition in StaticArrays for zero and one where the constructor of the static matrix type is called.

We should implement one(::Type{R<:Rotation}) here so we don't rely on that bug and so we can return something which isa R.

For zero we currently we have the following oddity (should not return a RotMatrix!). This is a bug which should be fixed in StaticArrays:

julia> zero(RotMatrix{2})
2×2 RotMatrix{2,Float64,4} with indices SOneTo(2)×SOneTo(2):
 0.0  0.0
 0.0  0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions