From 7bd510c45f50c7f622832fc80c42b04197821e24 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Sun, 8 Mar 2026 10:49:14 -0500 Subject: [PATCH 1/2] Simplify feasibility loop --- src/covers.jl | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/covers.jl b/src/covers.jl index cf050ee..bf8dffc 100644 --- a/src/covers.jl +++ b/src/covers.jl @@ -151,21 +151,11 @@ function cover(A::AbstractMatrix; kwargs...) for j in axes(A, 2) for i in axes(A, 1) Aij, ai, bj = abs(A[i, j]), a[i], b[j] - if iszero(bj) - if !iszero(ai) - b[j] = Aij / ai - else - a[i] = b[j] = sqrt(Aij) - end - elseif iszero(ai) - a[i] = Aij / bj - else - aprod = ai * bj - aprod >= Aij && continue - s = sqrt(Aij / aprod) - a[i] = s * ai - b[j] = s * bj - end + aprod = ai * bj + aprod >= Aij && continue + s = sqrt(Aij / aprod) + a[i] = s * ai + b[j] = s * bj end end return tighten_cover!(a, b, A; kwargs...) From f65cb7b6b23fe9572c5b03d1c4fa3fe007655919 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Sun, 8 Mar 2026 11:57:20 -0500 Subject: [PATCH 2/2] fix docs --- docs/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/index.md b/docs/src/index.md index bca7adc..1d8ca9b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -27,7 +27,7 @@ A concrete example: a 3×3 matrix whose rows and columns correspond to physical variables with different units (position in meters, velocity in m/s, force in N): -```jldoctest coverones +```jldoctest coverones; filter = r"(\d+\.\d{6})\d+" => s"\1" julia> using ScaleInvariantAnalysis julia> A = [1e6 1e3 1.0; 1e3 1.0 1e-3; 1.0 1e-3 1e-6];