-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix sharps, matrix flats, subdivision, and link #59
Conversation
Due to scheduling, this PR consists of a few disparate features:
All these features have tests. When considering which features to merge, we should note:
|
Todo:
|
I think you are probably better off with GMRES or PCG because the QR decomp will be dense. |
Oh, the QR decomp is just for the tiny (3×3 in R3, 3×2 in R2) matrices. For
each triangle T, I compute and split this tiny matrix into its rows, and place each row
in the corresponding position in the (num-triangles × num-edges) sparse
matrix.
Maybe QR decomposition is not what I want here, since the application of
the entire operation is still just sparse matrix multiplication.
…On Sat, Feb 17, 2024, 12:28 PM James ***@***.***> wrote:
I think you are probably better off with GMRES or PCG because the QR
decomp will be dense.
—
Reply to this email directly, view it on GitHub
<#59 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQYHBYINJO6PUT3DOUZAC53YUDSCJAVCNFSM6AAAAAAZ2N2GFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJQGI3DEOJTGY>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left some comments. The comments with 🟢 should be addressed in a future PR, the comments with 🔴 should be addressed in this PR.
This PR implements subdivision as a data migration, matrix versions of the sharp and flat operators, an alternative weighting scheme for the sharp operator, and the star, closed star, and link operators from S68 of Munkres' Elementary Algebraic Topology.
Some of these changes may need to get shifted to a different branch. In particular, subdivision cannot yet automatically compute barycenters of simplices until the
attrMigr
branch of Catlab is merged. Relatedly, refactoring the DualComplex schemas as a data migration that "remembers" e.g. which triangle a supporting dual triangle came from also depends on this functionality.The star, closed star, and link operators were implemented as higher-level helper functions which will become more useful as 3D operators are becoming supported. This (not-Hodge) star essentially recursively computes cofaces, which is a common pattern in this codebase. e.g. grabbing all tetrahedra around a vertex v is simply star(v).
While developing the matrix version of the sharp operator, it was noted that the sharp of an EForm generated by a constant form would generate a primal vector field with the correct direction, but of incorrect magnitude. In particular, vectors with few neighbors would be too small, and those with many neighbors would be too large. By replacing the weighting denominator in Eq. 5.8.1 from Hirani with | star v | instead of | sigma n |, we successfully recover the original field (up to floating point error). This alternate discrete sharp operator can be selected via dispatching with
AltPPSharp
. Further, a sharp operator from Desbrun can be selected viaDesbrunSharp
.As implemented at time of writing, the matrix-flat multiplied by a vector X of
SVector
s will return a vector of length 1SArray
s. When X is wrapped inDualVectorField()
, this result is automaticallyreinterpret
ed to a vector of floats. This fix is a little unusual, but I am not sure how to structure the flat matrix to avoid this.