all and any are short-circuiting, such that if subcriteria are stateful, they can be gated by earlier predicates returning true or false.
For example, sc = StopAfterIteration(100) & StopWhenChangeLess(M, 1e-9) would have the first condition fire for iterations 1:99, never updating the stored state in the second condition, and then for iteration 100 the second condition would compare the current state with the first state, instead of the 99th.
Note that this is true for both any, all and _fast_any.
Disclaimer, was surfaced during AI-assisted session
allandanyare short-circuiting, such that if subcriteria are stateful, they can be gated by earlier predicates returning true or false.For example,
sc = StopAfterIteration(100) & StopWhenChangeLess(M, 1e-9)would have the first condition fire for iterations1:99, never updating the stored state in the second condition, and then for iteration 100 the second condition would compare the current state with the first state, instead of the 99th.Note that this is true for both
any,alland_fast_any.Disclaimer, was surfaced during AI-assisted session