Skip to content
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

sign of simplices blocking type inference #83

Open
lukem12345 opened this issue May 15, 2024 · 2 comments
Open

sign of simplices blocking type inference #83

lukem12345 opened this issue May 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@lukem12345
Copy link
Member

          > Tracing back through the function calls, the `sign` function, which returns a vector of positive and negative ones corresponding to the sign of a simplex, is returning `::Any`.

This is because the type of the orientation is encoded as a type parameter to EmbeddedDeltaDualComplex2D.

One way to work around this is to hard-code Bool a la

lazy_edge_orient .= one(Bool)

Originally posted by @lukem12345 in #78 (comment)

@lukem12345 lukem12345 added the enhancement New feature or request label May 15, 2024
@lukem12345
Copy link
Member Author

We could also standardize on storing +1 or -1 directly, as small floats or ints. There are many instances in this codebase where we check orientation simply to decide whether to return +1 or -1.
E.g. explicitly here:

e_orient[i] = (e_orient[i] == 1 ? 1 : -1)

Further, since only the orientation of top-level simplices matters for DEC purposes, we could go ahead and refactor the ACSet schemas to only store such. This would eliminate many calls to sign outright.

@GeorgeR227
Copy link
Contributor

I think we should just store Bool since all of the meshes use Bool and changing that is breaking. I get what you're saying about the +1 and -1 but we can just write a helper function to convert between those.

I think changing the schema here is doable and all current mesh generation functions seem to have a check to see if the orientation column exists. Although some DEC operators may check for lower-level orientations, I think exterior derivative is one, so those may break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants