Skip to content

-1 .* Eye(2) isn't Diagonal{T,FillVector{T}} #415

@mtfishman

Description

@mtfishman

For example:

julia> -1 * Eye(2)
2×2 LinearAlgebra.Diagonal{Float64, Fill{Float64, 1, Tuple{Base.OneTo{Int64}}}}:
 -1.0     
      -1.0

julia> -1 .* Eye(2)
2×2 LinearAlgebra.Diagonal{Float64, Vector{Float64}}:
 -1.0     
      -1.0

julia> -Eye(2)
2×2 LinearAlgebra.Diagonal{Float64, Fill{Float64, 1, Tuple{Base.OneTo{Int64}}}}:
 -1.0     
      -1.0

julia> (.-)(Eye(2))
2×2 LinearAlgebra.Diagonal{Float64, Vector{Float64}}:
 -1.0     
      -1.0

(dev) pkg> st FillArrays
Status `~/.julia/dev/KroneckerArrays/dev/Project.toml`
  [1a297f60] FillArrays v1.13.0

julia> versioninfo()
Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 10 × Apple M1 Max
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

Maybe related to #385 and issues linked to in that PR.

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