Add gramcover: covers of A'*W*A from a cover of A#34
Merged
Conversation
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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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