Skip to content

Add gramcover: covers of A'*W*A from a cover of A#34

Merged
timholy merged 2 commits into
mainfrom
teh/gramcover
Jul 19, 2026
Merged

Add gramcover: covers of A'*W*A from a cover of A#34
timholy merged 2 commits into
mainfrom
teh/gramcover

Conversation

@timholy

@timholy timholy commented Jul 19, 2026

Copy link
Copy Markdown
Member

gramcover(a, b, A[, w or W]) and its mutating form return a symmetric cover s of the (weighted) Gram matrix A'WA directly from an asymmetric cover of A, without forming the product: s[j] = sqrt(Σ_{i,i'} a[i]*|W[i,i']|*a[i']) * b[j], accumulated over the rows of j's connected component of A's support (components coupled by off-diagonal entries of W are merged, since the product couples them). Only abs.(W) enters the bound, so W need not be positive definite or symmetric. Per-component accumulation makes s invariant under the cover's per-component gauge — safe as an absolute scale where b alone is not, e.g. Levenberg-Marquardt damping — and strictly tighter than the global bound norm(a)*b on multi-component supports. Each sqrt is inflated by a summation-roundoff bound so the returned cover holds without verifying it against a formed Gram matrix.

The manual gains a section on the gauge sensitivity of bare cover factors and the Gram cover's covariance under one-sided rescaling.

Assisted-by: Claude Fable 5 (claude-fable-5) noreply@anthropic.com

gramcover(a, b, A[, w or W]) and its mutating form return a symmetric
cover s of the (weighted) Gram matrix A'*W*A directly from an
asymmetric cover of A, without forming the product:
s[j] = sqrt(Σ_{i,i'} a[i]*|W[i,i']|*a[i']) * b[j], accumulated over the
rows of j's connected component of A's support (components coupled by
off-diagonal entries of W are merged, since the product couples them).
Only abs.(W) enters the bound, so W need not be positive definite or
symmetric. Per-component accumulation makes s invariant under the
cover's per-component gauge — safe as an absolute scale where b alone
is not, e.g. Levenberg-Marquardt damping — and strictly tighter than
the global bound norm(a)*b on multi-component supports. Each sqrt is
inflated by a summation-roundoff bound so the returned cover holds
without verifying it against a formed Gram matrix.

The manual gains a section on the gauge sensitivity of bare cover
factors and the Gram cover's covariance under one-sided rescaling.

Assisted-by: Claude Fable 5 (claude-fable-5) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.09091% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.78%. Comparing base (f354454) to head (8e68752).

Files with missing lines Patch % Lines
src/gram_covers.jl 99.09% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   98.77%   98.78%   +0.01%     
==========================================
  Files          13       14       +1     
  Lines        2196     2306     +110     
==========================================
+ Hits         2169     2278     +109     
- Misses         27       28       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

On Julia 1.10, J' * Diagonal(w) * J with unit-carrying eltypes routes
through LinearAlgebra's _tri_matmul, which materializes the
Adjoint-Diagonal factor by writing unscaled values into an intermediate
allocated with the product's units, throwing a DimensionError.
Parenthesizing as J' * (Diagonal(w) * J) keeps every partial product
unit-homogeneous.

Assisted-by: Claude Fable 5 (claude-fable-5) <noreply@anthropic.com>
@timholy
timholy merged commit 5e0fc5c into main Jul 19, 2026
5 checks passed
@timholy
timholy deleted the teh/gramcover branch July 19, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant