X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fidx.cpp;h=df79607d2f1b5ac16cc2662481e416c257e4dfd2;hp=c72e478e305bc02398394aa7486ceafe3d1d9150;hb=cb85fdf34e2b96f35fa65d9b6b6a1a0b30512ea4;hpb=0117bd6ef4af029934703940d59e1c70866937b0 diff --git a/ginac/idx.cpp b/ginac/idx.cpp index c72e478e..df79607d 100644 --- a/ginac/idx.cpp +++ b/ginac/idx.cpp @@ -320,7 +320,7 @@ bool idx::match(const ex & pattern, lst & repl_lst) const { if (!is_ex_of_type(pattern, idx)) return false; - const idx &o = ex_to_idx(pattern); + const idx &o = ex_to(pattern); if (!dim.is_equal(o.dim)) return false; return value.match(o.value, repl_lst); @@ -330,7 +330,7 @@ bool varidx::match(const ex & pattern, lst & repl_lst) const { if (!is_ex_of_type(pattern, varidx)) return false; - const varidx &o = ex_to_varidx(pattern); + const varidx &o = ex_to(pattern); if (covariant != o.covariant) return false; return inherited::match(pattern, repl_lst); @@ -340,7 +340,7 @@ bool spinidx::match(const ex & pattern, lst & repl_lst) const { if (!is_ex_of_type(pattern, spinidx)) return false; - const spinidx &o = ex_to_spinidx(pattern); + const spinidx &o = ex_to(pattern); if (dotted != o.dotted) return false; return inherited::match(pattern, repl_lst); @@ -469,7 +469,7 @@ bool is_dummy_pair(const ex & e1, const ex & e2) if (!is_ex_of_type(e1, idx) || !is_ex_of_type(e2, idx)) return false; - return is_dummy_pair(ex_to_idx(e1), ex_to_idx(e2)); + return is_dummy_pair(ex_to(e1), ex_to(e2)); } void find_free_and_dummy(exvector::const_iterator it, exvector::const_iterator itend, exvector & out_free, exvector & out_dummy) @@ -483,7 +483,7 @@ void find_free_and_dummy(exvector::const_iterator it, exvector::const_iterator i // Only one index? Then it is a free one if it's not numeric if (itend - it == 1) { - if (ex_to_idx(*it).is_symbolic()) + if (ex_to(*it).is_symbolic()) out_free.push_back(*it); return; } @@ -491,7 +491,7 @@ void find_free_and_dummy(exvector::const_iterator it, exvector::const_iterator i // Sort index vector. This will cause dummy indices come to lie next // to each other (because the sort order is defined to guarantee this). exvector v(it, itend); - shaker_sort(v.begin(), v.end(), ex_is_less()); + shaker_sort(v.begin(), v.end(), ex_is_less(), ex_swap()); // Find dummy pairs and free indices it = v.begin(); itend = v.end(); @@ -503,12 +503,12 @@ void find_free_and_dummy(exvector::const_iterator it, exvector::const_iterator i if (it == itend) return; } else { - if (!it->is_equal(*last) && ex_to_idx(*last).is_symbolic()) + if (!it->is_equal(*last) && ex_to(*last).is_symbolic()) out_free.push_back(*last); } last = it++; } - if (ex_to_idx(*last).is_symbolic()) + if (ex_to(*last).is_symbolic()) out_free.push_back(*last); }