[GiNaC-devel] Small patch to indexed.cpp

Vladimir V. Kisil kisilv at maths.leeds.ac.uk
Sat Jan 24 00:30:37 CET 2015


	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 at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Small-optimization-in-simplify_indexed.patch
Type: text/x-diff
Size: 1475 bytes
Desc: patch
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20150123/727a4dd7/attachment.bin>


More information about the GiNaC-devel mailing list