Skip to content

diag(::Diagonal) now returns a copy of the underlying diagonal vector #542

@gasagna

Description

@gasagna

JuliaLang/julia#24324 introduced a breaking change whereby diag(::Diagonal) returns a copy of the underlying vector, rather than the vector itself as it used to be in 0.6 (@fredrikekre ). For code that relies on diag(::Diagonal) as an accessor function, this now produces large memory allocations.

This was a somehow breaking change but no warnings are emitted. Perhaps, the NEWS.md should be updated to reflect the new behaviour and probably the docs of diag(::Diagonal) too. What is the recommended way of accessing the underlying field?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis change adds or pertains to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions