Commit d0a1f20
authored
Fix Heaviside functions for <, >, >= and <= (#2701)
* Fix Heaviside functions for <, >, >= and <=
The value at 0 for the Heaviside function was incorrectly set to 1/2, leading to incorrect simulation results. Fixes #2700.
* handle second Heaviside arg in replacement
* Fix crash for models without state variables
Previously, `nx_solver=0` would have in a crash when calling `amici::SUNMatrixWrapper::capacity` on `SUNMatrixWrapper` of 0-sized sparse matrix.
Unrelated: Replace some unnecessary `std::vector::at` calls.
* add test1 parent ce1b673 commit d0a1f20
3 files changed
Lines changed: 51 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2267 | 2267 | | |
2268 | 2268 | | |
2269 | 2269 | | |
2270 | | - | |
| 2270 | + | |
2271 | 2271 | | |
2272 | | - | |
2273 | | - | |
| 2272 | + | |
| 2273 | + | |
2274 | 2274 | | |
2275 | 2275 | | |
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
2279 | | - | |
2280 | | - | |
| 2279 | + | |
| 2280 | + | |
2281 | 2281 | | |
2282 | 2282 | | |
2283 | 2283 | | |
2284 | 2284 | | |
2285 | | - | |
| 2285 | + | |
2286 | 2286 | | |
2287 | 2287 | | |
2288 | 2288 | | |
| |||
2301 | 2301 | | |
2302 | 2302 | | |
2303 | 2303 | | |
2304 | | - | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
2305 | 2307 | | |
2306 | 2308 | | |
2307 | 2309 | | |
| |||
2329 | 2331 | | |
2330 | 2332 | | |
2331 | 2333 | | |
2332 | | - | |
| 2334 | + | |
2333 | 2335 | | |
2334 | | - | |
| 2336 | + | |
2335 | 2337 | | |
2336 | | - | |
| 2338 | + | |
2337 | 2339 | | |
2338 | 2340 | | |
2339 | | - | |
2340 | | - | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
2341 | 2345 | | |
2342 | 2346 | | |
2343 | 2347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
523 | | - | |
| 523 | + | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
| 529 | + | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
| 532 | + | |
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
764 | 765 | | |
765 | 766 | | |
766 | 767 | | |
767 | | - | |
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
0 commit comments