Skip to content

Add canonical#3008

Draft
blegat wants to merge 1 commit into
masterfrom
bl/canonical
Draft

Add canonical#3008
blegat wants to merge 1 commit into
masterfrom
bl/canonical

Conversation

@blegat
Copy link
Copy Markdown
Member

@blegat blegat commented Jun 5, 2026

Extracted from #2803

I'm not too convinced by the current approach.

For canonical, I think we need to implement canonical with a cache that checks that it creates aliases when it sees a second time an alias to the same sub-expression.

end

# Workaround: both `is_canonical` and `canonicalize!` would be slow otherwise
canonical(f::MOI.ScalarNonlinearFunction) = f
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ask Claude why they would add this method when there is the one below 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did it pre-Claude actually 😅 this line is just a temporary hack to isolate things in profiling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants