Small patch to indexed.cpp
Dear All, Looking at Vladislav's example of contacting Dirac gammas, I noted certain inefficiency in indexed.cpp. The general procedure simplify_indexed() calls simplify_indexed_product() for every its product-type sub-expression. If simplify_indexed_product() modified the expression it recursively calls simplify_indexed() to look at the new expression. In the Vladislav's example the deepness of nested calls can be around 135. The proposed small patch make a bit of optimisation: if the new expression shall be a product, then simplify_indexed_product() calls itself directly. Previously it end up there only after a call through simplify_indexed(). Although this reduces deepness of nested calls to around 100, the gain in speed is hardly noticeable---just a couple of percents (unfortunately). Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835
participants (1)
-
Vladimir V. Kisil