X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Findexed.cpp;h=cf52f4429c672d6287123d2f8f556ecb3d477935;hp=ca4beff53f63d2b57761c4380ae68a9b89829b1c;hb=13905769fe865764a271f0e2aeb22f422e1289d7;hpb=65f2693a0948d1db0bc68d7656c64e1fed91c158 diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index ca4beff5..cf52f442 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's indexed expressions. */ /* - * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2020 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -260,12 +260,8 @@ int indexed::compare_same_type(const basic & other) const return inherited::compare_same_type(other); } -ex indexed::eval(int level) const +ex indexed::eval() const { - // First evaluate children, then we will end up here again - if (level > 1) - return indexed(ex_to(symtree), evalchildren(level)); - const ex &base = seq[0]; // If the base object is 0, the whole object is 0 @@ -398,7 +394,7 @@ ex indexed::derivative(const symbol & s) const // global functions ////////// -struct idx_is_equal_ignore_dim : public std::binary_function { +struct idx_is_equal_ignore_dim { bool operator() (const ex &lh, const ex &rh) const { if (lh.is_equal(rh)) @@ -510,7 +506,7 @@ exvector ncmul::get_free_indices() const return free_indices; } -struct is_summation_idx : public std::unary_function { +struct is_summation_idx { bool operator()(const ex & e) { return is_dummy_pair(e, e); @@ -558,7 +554,9 @@ template static ex rename_dummy_indices(const ex & e, exvector & global int remaining = local_size - global_size; auto it = local_dummy_indices.begin(), itend = local_dummy_indices.end(); while (it != itend && remaining > 0) { - if (is_exactly_a(*it) && find_if(global_dummy_indices.begin(), global_dummy_indices.end(), bind2nd(idx_is_equal_ignore_dim(), *it)) == global_dummy_indices.end()) { + if (is_exactly_a(*it) && + find_if(global_dummy_indices.begin(), global_dummy_indices.end(), + [it](const ex &lh) { return idx_is_equal_ignore_dim()(lh, *it); }) == global_dummy_indices.end()) { global_dummy_indices.push_back(*it); global_size++; remaining--; @@ -721,7 +719,7 @@ next_index: ; } /* Ordering that only compares the base expressions of indexed objects. */ -struct ex_base_is_less : public std::binary_function { +struct ex_base_is_less { bool operator() (const ex &lh, const ex &rh) const { return (is_a(lh) ? lh.op(0) : lh).compare(is_a(rh) ? rh.op(0) : rh) < 0;