Feature: Reusable switching functions#29
Merged
Schlevidon merged 76 commits intopublicfrom May 13, 2025
Merged
Conversation
Also working on implementing switching function generation for helper functions
For better interface and reusing information from previous switching function creation.
Collaborator
Author
|
Note for review: Tests for the new functionality are not added yet, but will be before merging this pull requests. |
Collaborator
|
Great work, the code is much more readable, well structured and I could confirm a significant reduction in runtime. |
Owner
|
Consider:
Caller -> idxMtreeCaller
Callee -> idxMtreeCallTarget
Am 2025-05-13 11:53, schrieb Lev Gromov:
@Schlevidon commented on this pull request.
-------------------------
On GenerateSwitchingFunctions/FunctionIterator.m [1]:
I had considered using those variable names originally, but later on
decided against it, because the names idxMtreeCaller and idxMtreeCallee
only differ in a single letter, which makes it very easy to mix up
these two.
I think idxMtreeCall is a decent compromise in being descriptive
enough, but also not hindering readability.
But alternative suggestions are very welcome as always!
--
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
You are receiving this because you are subscribed to this
thread.Message ID:
***@***.***>
|
…s_review Review: Feature: Reusable switching functions
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.
Motivation
Generating switching functions during integration is relatively expensive (complex mtree manipulation, exporting to file, etc.). In many cases, the same switching function will be generated several times (e.g. when integrating the same RHS multiple times with different parameters for optimization). To improve performance when encountering a switch, we could instead check if the corresponding switching function already exists before creating a new one from scratch.
Changes
switch_condition,ctrlif_indexandfunction_index.