Skip to content

Inverse Triangular methods missing #1169

@btmit

Description

@btmit

The inverse of a Triangular SMatrix does not preserve type. The resulting triangular is based on Matrix not SMatrix because the fallback method is hard-coded to Matrix. It seems like this should be a new method in StaticArrays.jl rather than something in new Base since it'll probably need to use inv() instead of ldiv!().

using LinearAlgebra, StaticArrays

a = rand(SMatrix{3,3})
ua = UpperTriangular(a) 
la = LowerTriangular(a)

typeof(inv(ua)) == typeof(ua)  # false UpperTriangular{Float64, Matrix{Float64}}
typeof(inv(la)) == typeof(la)  # false LowerTriangular{Float64, Matrix{Float64}}

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