X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Findexed.cpp;h=c6a84e31ac70e6346091651bd0eb61f1a70fef5d;hp=459caa92f473c535bdb81415d5fcadc42a3bc3fd;hb=f30eb24864efd57bd7271cfccd8e526321682266;hpb=591b85b0697370f2f5f25a29a1e94ff831a02c12 diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 459caa92..c6a84e31 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -187,7 +187,7 @@ void indexed::archive(archive_node &n) const DEFAULT_UNARCHIVE(indexed) ////////// -// functions overriding virtual functions from bases classes +// functions overriding virtual functions from base classes ////////// void indexed::print(const print_context & c, unsigned level) const @@ -201,7 +201,6 @@ void indexed::print(const print_context & c, unsigned level) const << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec << ", " << seq.size()-1 << " indices" << ", symmetry=" << symtree << std::endl; - c.s << std::endl; unsigned delta_indent = static_cast(c).delta_indent; seq[0].print(c, level + delta_indent); printindices(c, level + delta_indent); @@ -411,6 +410,14 @@ void indexed::validate(void) const } } +/** Implementation of ex::diff() for an indexed object always returns 0. + * + * @see ex::diff */ +ex indexed::derivative(const symbol & s) const +{ + return _ex0(); +} + ////////// // global functions ////////// @@ -527,8 +534,8 @@ exvector power::get_free_indices(void) const * by the function */ static ex rename_dummy_indices(const ex & e, exvector & global_dummy_indices, exvector & local_dummy_indices) { - int global_size = global_dummy_indices.size(), - local_size = local_dummy_indices.size(); + unsigned global_size = global_dummy_indices.size(), + local_size = local_dummy_indices.size(); // Any local dummy indices at all? if (local_size == 0) @@ -557,7 +564,8 @@ static ex rename_dummy_indices(const ex & e, exvector & global_dummy_indices, ex for (unsigned i=0; i(local_dummy_indices[i]).get_dim().is_equal(ex_to(global_dummy_indices[i]).get_dim())) { all_equal = false; local_syms.append(loc_sym); global_syms.append(glob_sym); @@ -587,7 +595,7 @@ ex simplify_indexed_product(const ex & e, exvector & free_indices, exvector & du v.push_back(e.op(0)); v.push_back(e.op(0)); } else { - for (int i=0; i 1 + if (num_dummies > 1 && ex_to(ex_to(*it1).symtree).has_symmetry() && ex_to(ex_to(*it2).symtree).has_symmetry()) { // Check all pairs of dummy indices - for (unsigned idx1=0; idx1