Skip to content

Conversation

Keno
Copy link
Contributor

@Keno Keno commented Dec 24, 2022

Fixes the corner case mentioned in the doc comment. In partiuclar, when we have an incomplete alias chain, the alias can change which variable needs to be considered the highest-differentiated. While we're at it, also take care of the todo in the same place.

Keno added 3 commits December 24, 2022 00:04
Fixes the corner case mentioned in the doc comment. In partiuclar,
when we have an incomplete alias chain, the alias can change which
variable needs to be considered the highest-differentiated. While
we're at it, also take care of the todo in the same place.
We're using augmenting path construction here to try to find a maximal
matching of the variables at the given differentiation level. However
the construct_augmenting_path! function assumes as a pre-condition that
eq-color is reset to zero in order for it to actually produce an
augmenting path. Failing to do this can cause it to falsely declare
a system singular.
# Invariant from alias elimination: Stem is chosen to have
# the highest differentiation order.
@assert stem′ !== nothing
if !haskey(ag, var′) || ag[var′][2] != stem′
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an ASCII diagram to show why this is true and why the clean up step is needed in comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASCII diagram explaining why which condition is true?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm asking which condition you want explained.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just explain the general process and why the clean up at the end is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup is just addressing the # TODO: remove lower diff vars from whitelist that was already there, but I can expand the comments a bit.

@YingboMa YingboMa merged commit 1b8b19a into SciML:master Jan 29, 2023
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.

2 participants