[GiNaC-devel] [PATCH 3/5, GiNaC 1.3] power::expand_mul: do not try to rename indices if the object has no indices at all.

Alexei Sheplyakov varg at theor.jinr.ru
Mon Sep 17 17:03:27 CEST 2007


---
 ginac/power.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ginac/power.cpp b/ginac/power.cpp
index 676b862..bbcb453 100644
--- a/ginac/power.cpp
+++ b/ginac/power.cpp
@@ -916,7 +916,7 @@ ex power::expand_mul(const mul & m, const numeric & n, unsigned options, bool fr
 	}
 
 	// Leave it to multiplication since dummy indices have to be renamed
-	if (get_all_dummy_indices(m).size() > 0 && n.is_positive()) {
+	if (m.info(info_flags::has_indices) && (get_all_dummy_indices(m).size() > 0) && n.is_positive()) {
 		ex result = m;
 		for (int i=1; i < n.to_int(); i++)
 			result *= rename_dummy_indices_uniquely(m,m);
-- 
1.5.2.4

Best regards,
  Alexei

-- 
All science is either physics or stamp collecting.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-devel/attachments/20070917/6e625c4a/attachment.pgp


More information about the GiNaC-devel mailing list