evalf / nutils

The nutils project
http://www.nutils.org/
MIT License
88 stars 48 forks source link

separate optimize from simplify #870

Closed gertjanvanzwieten closed 4 months ago

gertjanvanzwieten commented 4 months ago

This PR limits the deep replacement of Evaluable._optimized_for_numpy1 to the operations of _optimized_for_numpy, no longer involving _simplified. This creates a logical separation between simplify and optimized and removes overlap between the two passes. The latter (.optimized) still implies the former (.simplified), but executes it strictly in a pre-processing pass, with the subsequent optimization making only local adjustments to the simplified state. The _optimized_for_numpy methods are modified to make these adjustments in a nimble fashion rather than relying on the heavy machinery of _simplified.