From 0429e1edd5e085fa2eb997f6e08504efd9aa7db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Ara=C3=BAjo?= Date: Thu, 25 Jul 2024 10:02:50 +0200 Subject: [PATCH] [docs] change docstring to match code (#55013) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) ``` (cherry picked from commit 1ece299e4a1ebf9410099d2442c8dd2a19f9f615) --- stdlib/LinearAlgebra/src/generic.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index c2144bf85d024..295f91878ee74 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -1607,7 +1607,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)