Skip to content

Commit 1ece299

Browse files
authored
[docs] change docstring to match code (#55013)
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) ```
1 parent 4864a1b commit 1ece299

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/LinearAlgebra/src/generic.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ end
16761676
"""
16771677
reflectorApply!(x, τ, A)
16781678
1679-
Multiplies `A` in-place by a Householder reflection on the left. It is equivalent to `A .= (I - τ*[1; x] * [1; x]')*A`.
1679+
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`.
16801680
"""
16811681
@inline function reflectorApply!(x::AbstractVector, τ::Number, A::AbstractVecOrMat)
16821682
require_one_based_indexing(x)

0 commit comments

Comments
 (0)