Skip to content

Preprocess Helper Functions that Transitively Call Ctrlif #24

@LemongrabThree

Description

@LemongrabThree

If an RHS calls a function f that has no nondifferentiabilities, then f does not need to be preprocessed.

However, if f in turn calls a function g that does contain nondifferentiabilities, then f will need (some, minor) preprocessing: The preprocessed g has a new name, so the calls to g inside f need to be updated and equipped with an updateFunctionIndex call.

This mechanism already works (see preprocess_fcnInRhs.m) - but only for one level of function chaining.
Meaning if, instead of f calling g, f calls another function h which calls g and which contains no nondifferentiabilities, then IFDIFF will fail to recognize that f should be included in the preprocessing, and calls to f in the RHS will be left unchanged, leading to disastrous results.

To do: Change the mechanism for handling these transitively-called nondifferentiabilities so that it can handle arbitrarily long chains of function calls.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions