[GiNaC-devel] Patch for get_dummy_indices

Vladimir Kisil kisilv at maths.leeds.ac.uk
Tue Nov 16 16:02:03 CET 2004


>>>>> "CB" == Christian Bauer <Christian.Bauer at uni-mainz.de> writes:

    CB> This is on purpose. Since dummy indices always come in pairs,

	I meant a case like "a.get_dummy_indices(b)", where my intuitive
  expectation was that the return value should has the same covariance
  as in "a". Since this expectation once took a day for me to realise
  the problem I propose either:

  1. Change it. The old and new behaviour can be easily switched by a an
  optional boolean argument keep_covariance (with a whatever default
  value) in idx.cpp as follows:

528c539
< 	shaker_sort(v.begin(), v.end(), ex_is_less(), ex_swap());
---
> 	if (keep_covariance)
> 	 	shaker_sort(v.begin(), v.end(), idx_is_less(), ex_swap());
> 	else
> 	 	shaker_sort(v.begin(), v.end(), ex_is_less(), ex_swap());

		; or

  2. Left it as it is already in GiNaC and add somewhere a line of
  documentation for the feature in indexed.h. (ginac.info does not mention
  get_dummy_indices() at present).

  Best,
  Vladimir
-- 
Vladimir V. Kisil     email: kisilv at maths.leeds.ac.uk
--                      www: http://maths.leeds.ac.uk/~kisilv/




More information about the GiNaC-devel mailing list