Commit 7e5d4ea
Add bare symbol expansion after all subs2 calls in onepass.jl
Implements the pattern from p_constraint_exa! boundary case across all functions
that use subs2, enabling bare symbol handling (e.g., x(t) → [x[k, j] for k ∈ 1:dim_x]).
Changes to src/onepass.jl:
1. p_mayer_exa! (lines 1030-1044): +3 lines
- Added k = __symgen(:k)
- Added subs for x0 and xf bare symbols
2. p_constraint_exa! path constraints (lines 797-815): +3 lines
- Added k = __symgen(:k)
- Added subs for xt and ut bare symbols
3. p_lagrange_exa! (lines 968-985): +4 lines
- Added k = __symgen(:k)
- Added subs for xt and ut bare symbols in ej1 and ej12
4. p_dynamics_coord_exa! (lines 900-920): +6 lines
- Added k = __symgen(:k)
- Added subs for xt and ut bare symbols in ej1, ej2, and ej12
Total: 16 lines added across 4 functions
Pattern applied:
- subs2 handles indexed cases: x[i] → y[i, j] and x[1:3] → [y[k, j] for k ∈ 1:3]
- subs handles bare symbols: x → [y[k, j] for k ∈ 1:dim]
- Same symbol k used for both state and control (sequential application)
This completes the implementation of tensor support for bare symbols in the
ExaModels backend.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 429619d commit 7e5d4ea
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
| 698 | + | |
698 | 699 | | |
699 | 700 | | |
700 | 701 | | |
| 702 | + | |
701 | 703 | | |
| 704 | + | |
702 | 705 | | |
703 | 706 | | |
704 | 707 | | |
| |||
797 | 800 | | |
798 | 801 | | |
799 | 802 | | |
| 803 | + | |
800 | 804 | | |
| 805 | + | |
801 | 806 | | |
| 807 | + | |
802 | 808 | | |
803 | 809 | | |
804 | 810 | | |
| |||
897 | 903 | | |
898 | 904 | | |
899 | 905 | | |
| 906 | + | |
900 | 907 | | |
| 908 | + | |
901 | 909 | | |
| 910 | + | |
902 | 911 | | |
903 | 912 | | |
| 913 | + | |
904 | 914 | | |
| 915 | + | |
905 | 916 | | |
906 | 917 | | |
907 | 918 | | |
| 919 | + | |
908 | 920 | | |
909 | 921 | | |
910 | 922 | | |
| |||
967 | 979 | | |
968 | 980 | | |
969 | 981 | | |
| 982 | + | |
970 | 983 | | |
| 984 | + | |
971 | 985 | | |
| 986 | + | |
972 | 987 | | |
973 | 988 | | |
974 | 989 | | |
| 990 | + | |
975 | 991 | | |
976 | 992 | | |
977 | 993 | | |
| |||
1028 | 1044 | | |
1029 | 1045 | | |
1030 | 1046 | | |
| 1047 | + | |
1031 | 1048 | | |
1032 | 1049 | | |
1033 | 1050 | | |
| 1051 | + | |
1034 | 1052 | | |
| 1053 | + | |
1035 | 1054 | | |
1036 | 1055 | | |
1037 | 1056 | | |
| |||
0 commit comments