From f85392050266dd11d26503fdfbccbeea63b2b898 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Mon, 20 Oct 2003 19:54:21 +0000 Subject: [PATCH] added an "options" parameter to simplify_indexed(), for future extensions --- ginac/ex.h | 12 ++++++------ ginac/indexed.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ginac/ex.h b/ginac/ex.h index 9bfa9e99..2447c3f2 100644 --- a/ginac/ex.h +++ b/ginac/ex.h @@ -189,8 +189,8 @@ public: // indexed objects exvector get_free_indices() const { return bp->get_free_indices(); } - ex simplify_indexed() const; - ex simplify_indexed(const scalar_products & sp) const; + ex simplify_indexed(unsigned options = 0) const; + ex simplify_indexed(const scalar_products & sp, unsigned options = 0) const; // comparison int compare(const ex & other) const; @@ -769,11 +769,11 @@ inline ex series(const ex & thisex, const ex & r, int order, unsigned options = inline bool match(const ex & thisex, const ex & pattern, lst & repl_lst) { return thisex.match(pattern, repl_lst); } -inline ex simplify_indexed(const ex & thisex) -{ return thisex.simplify_indexed(); } +inline ex simplify_indexed(const ex & thisex, unsigned options = 0) +{ return thisex.simplify_indexed(options); } -inline ex simplify_indexed(const ex & thisex, const scalar_products & sp) -{ return thisex.simplify_indexed(sp); } +inline ex simplify_indexed(const ex & thisex, const scalar_products & sp, unsigned options = 0) +{ return thisex.simplify_indexed(sp, options); } inline ex symmetrize(const ex & thisex) { return thisex.symmetrize(); } diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 50e3b01b..edbc7300 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -1108,7 +1108,7 @@ ex simplify_indexed(const ex & e, exvector & free_indices, exvector & dummy_indi * the free indices in sums are consistent. * * @return simplified expression */ -ex ex::simplify_indexed() const +ex ex::simplify_indexed(unsigned options) const { exvector free_indices, dummy_indices; scalar_products sp; @@ -1122,7 +1122,7 @@ ex ex::simplify_indexed() const * * @param sp Scalar products to be replaced automatically * @return simplified expression */ -ex ex::simplify_indexed(const scalar_products & sp) const +ex ex::simplify_indexed(const scalar_products & sp, unsigned options) const { exvector free_indices, dummy_indices; return GiNaC::simplify_indexed(*this, free_indices, dummy_indices, sp); -- 2.44.0