https://github.com/JuliaLang/julia
Revision cc74d241be9f023ceb6d2ded7314bfbd02f8b17c authored by Jishnu Bhattacharya on 31 January 2024, 12:09:57 UTC, committed by GitHub on 31 January 2024, 12:09:57 UTC
Since the diagonal elements of a `UnitUpperTriangular` are given by
`onelement`, these should be unchanged under `transpose/adjoint`, and we
don't need to access these elements in the parent array when performing
in-place operations.

Fixes
```julia
julia> using LinearAlgebra

julia> M = Matrix{BigFloat}(undef, 2, 2);

julia> M[1,2] = 3;

julia> U = UnitUpperTriangular(M)
2×2 UnitUpperTriangular{BigFloat, Matrix{BigFloat}}:
 1.0  3.0
  ⋅   1.0

julia> transpose!(U)
ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getindex
   @ ./essentials.jl:882 [inlined]
 [2] getindex
   @ ./array.jl:915 [inlined]
 [3] copytri!
   @ ~/packages/julias/julia-latest/share/julia/stdlib/v1.11/LinearAlgebra/src/matmul.jl:414 [inlined]
 [4] transpose!(A::UnitUpperTriangular{BigFloat, Matrix{BigFloat}})
   @ LinearAlgebra ~/packages/julias/julia-latest/share/julia/stdlib/v1.11/LinearAlgebra/src/triangular.jl:470
 [5] top-level scope
   @ REPL[5]:1
```
After this PR:
```julia
julia> transpose!(U)
2×2 UnitLowerTriangular{BigFloat, Matrix{BigFloat}}:
 1.0   ⋅ 
 3.0  1.0
```
1 parent cb9b00d
History
Tip revision: cc74d241be9f023ceb6d2ded7314bfbd02f8b17c authored by Jishnu Bhattacharya on 31 January 2024, 12:09:57 UTC
Inplace transpose for unit Triangular may skip diagonal (#53101)
Tip revision: cc74d24
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 523 bytes
.mailmap -rw-r--r-- 12.7 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 23.4 KB
HISTORY.md -rw-r--r-- 372.8 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 55.9 KB
Makefile -rw-r--r-- 30.2 KB
NEWS.md -rw-r--r-- 10.6 KB
README.md -rw-r--r-- 7.4 KB
THIRDPARTY.md -rw-r--r-- 3.9 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 37.8 KB
pkgimage.mk -rw-r--r-- 5.8 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top