From 3c2f1510c2e29c8112e0b39234e2f2c0a43dda50 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) ``` --- 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 bdd11dc822ef3..f60016125d2e9 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -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)