Merged
Conversation
Since #49094, the docstring of `nthreads` has been incorrect. It currently states that > The threads in default have id numbers `1:nthreads(:default)`. whereas that is no longer true: ```julia julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid()) 3-element Vector{Int64}: 1 2 3 julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid()) 6-element Vector{Int64}: 4 5 6 7 8 9 ``` (cherry picked from commit 95ae27f)
(cherry picked from commit a0d55cd)
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
```
(cherry picked from commit cc74d24)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few stragglers.
Backported PRs:
require_one_based_indexingwith high-dim array views #53091nthreads#53117AbstractTriangularwith zero alpha #52855using Module.Inner|#52952Need manual backport:
Non-merged PRs with backport label: