From 9d37b8b92faabfa4b2cd29041d586b2176f6016d Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Mon, 1 Jun 2020 10:42:54 +0200 Subject: [PATCH] Revert "Use norm instead of abs in generic lu factorization (#34575)" This reverts commit ecc0c434fae2438c05093b0fb1443b21c5463825. --- stdlib/LinearAlgebra/src/lu.jl | 4 ++-- stdlib/LinearAlgebra/test/generic.jl | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/LinearAlgebra/src/lu.jl b/stdlib/LinearAlgebra/src/lu.jl index 18ba0bbe11e6a..c770f478d4f4a 100644 --- a/stdlib/LinearAlgebra/src/lu.jl +++ b/stdlib/LinearAlgebra/src/lu.jl @@ -140,9 +140,9 @@ function generic_lufact!(A::StridedMatrix{T}, ::Val{Pivot} = Val(true); # find index max kp = k if Pivot - amax = norm(zero(T)) + amax = abs(zero(T)) for i = k:m - absi = norm(A[i,k]) + absi = abs(A[i,k]) if absi > amax kp = i amax = absi diff --git a/stdlib/LinearAlgebra/test/generic.jl b/stdlib/LinearAlgebra/test/generic.jl index de7eade6030b3..9ca508d9a9908 100644 --- a/stdlib/LinearAlgebra/test/generic.jl +++ b/stdlib/LinearAlgebra/test/generic.jl @@ -365,8 +365,6 @@ LinearAlgebra.Transpose(a::ModInt{n}) where {n} = transpose(a) # Needed for pivoting: Base.abs(a::ModInt{n}) where {n} = a - LinearAlgebra.norm(a::ModInt{n}) where {n} = a - Base.:<(a::ModInt{n}, b::ModInt{n}) where {n} = a.k < b.k @test A*(lu(A, Val(true))\b) == b