Skip to content

Commit

Permalink
[docs] change docstring to match code (JuliaLang#55013)
Browse files Browse the repository at this point in the history
The docstring of `LinearAlgebra.reflectorApply!` is incorrect. It says
the function is applying `(I - τ*[1; x] * [1; x]')*A`, but in reality it
is applying `(I - conj(τ)*[1; x[2:end]]*[1; x[2:end]]')*A`. You can
check that by looking at the code, or running for example
```julia
using LinearAlgebra
T=ComplexF64;d=5;
τ=randn(T);x=randn(T,d);A=randn(T,d,d);
(I - conj(τ)*[1; x[2:end]]*[1; x[2:end]]')*A
LinearAlgebra.reflectorApply!(x,τ,A)
```
  • Loading branch information
araujoms authored and lazarusA committed Aug 17, 2024
1 parent f61b9d9 commit 3c2f151
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ end
"""
reflectorApply!(x, τ, A)
Multiplies `A` in-place by a Householder reflection on the left. It is equivalent to `A .= (I - τ*[1; x] * [1; x]')*A`.
Multiplies `A` in-place by a Householder reflection on the left. It is equivalent to `A .= (I - conj(τ)*[1; x[2:end]]*[1; x[2:end]]')*A`.
"""
@inline function reflectorApply!(x::AbstractVector, τ::Number, A::AbstractVecOrMat)
require_one_based_indexing(x)
Expand Down

0 comments on commit 3c2f151

Please sign in to comment.