Skip to content

refactor: mark u argument in generated functions where appropriate#4536

Open
AayushSabharwal wants to merge 2 commits into
masterfrom
as/u-arg
Open

refactor: mark u argument in generated functions where appropriate#4536
AayushSabharwal wants to merge 2 commits into
masterfrom
as/u-arg

Conversation

@AayushSabharwal
Copy link
Copy Markdown
Member

@AayushSabharwal AayushSabharwal commented May 15, 2026

This allows specialized codegen to refer to the u vector.

AayushSabharwal and others added 2 commits May 15, 2026 11:35
This allows marking the `u` argument of a generated function so it is
specially named.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@DhairyaLGandhi
Copy link
Copy Markdown
Member

So codegen should be able to refer to this for the vector of unknowns

since it is used by `wrap_delays`.
- `u_arg`: The index in `args` of the argument corresponding to `unknowns(sys)` (the `u`
vector). If `-1` (the default), the u vector is not treated specially. Otherwise, the
argument must be a `Vector` and is wrapped in a `DestructuredArgs` with the common
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.

Suggested change
argument must be a `Vector` and is wrapped in a `DestructuredArgs` with the common
argument must be an `AbstractVector` and is wrapped in a `DestructuredArgs` with the common

Can we generalize? Otherwise GPUs and stuff may be sad.

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.

This is referring to a symbolic list of arguments, not the value passed to the generated function.

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.

3 participants