X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fidx.cpp;h=63d29971bff122f3e34e40ba9a6eb866acbd7717;hp=6a9ac8ae3ad33250c10e8a2a2dcc04ce8c1b9d47;hb=319edd89b3a1062a23a659416db7aa9117df3a94;hpb=93997f8dd95626382a895b3800fc2846da4f109b diff --git a/ginac/idx.cpp b/ginac/idx.cpp index 6a9ac8ae..63d29971 100644 --- a/ginac/idx.cpp +++ b/ginac/idx.cpp @@ -409,7 +409,7 @@ bool idx::is_dummy_pair_same_type(const basic & other) const if (dim.is_equal(o.dim)) return true; - return (dim < o.dim || dim > o.dim); + return (dim < o.dim || dim > o.dim || (is_a(dim) && is_a(o.dim)) || (is_a(dim) && is_a(o.dim))); } bool varidx::is_dummy_pair_same_type(const basic & other) const @@ -449,9 +449,9 @@ ex idx::replace_dim(const ex & new_dim) const ex idx::minimal_dim(const idx & other) const { - if (dim.is_equal(other.dim) || dim < other.dim) + if (dim.is_equal(other.dim) || dim < other.dim || (is_a(dim) && is_a(other.dim))) return dim; - else if (dim > other.dim) + else if (dim > other.dim || (is_a(dim) && is_a(other.dim))) return other.dim; else throw (std::runtime_error("idx::minimal_dim: index dimensions cannot be ordered"));