- GINAC_ASSERT(bp!=0);
- return bp->subs(e);
-}
-
-/** Return a vector containing the free indices of the object. */
-exvector ex::get_free_indices(void) const
-{
- GINAC_ASSERT(bp!=0);
- return bp->get_free_indices();
-}
-
-/** Simplify/canonicalize expression containing indexed objects. This
- * performs contraction of dummy indices where possible and checks whether
- * the free indices in sums are consistent.
- *
- * @return simplified expression */
-ex ex::simplify_indexed(void) const
-{
- return GiNaC::simplify_indexed(*this);
-}
-
-/** Simplify/canonicalize expression containing indexed objects. This
- * performs contraction of dummy indices where possible, checks whether
- * the free indices in sums are consistent, and automatically replaces
- * scalar products by known values if desired.
- *
- * @param sp Scalar products to be replaced automatically
- * @return simplified expression */
-ex ex::simplify_indexed(const scalar_products & sp) const
-{
- return GiNaC::simplify_indexed(*this, sp);
-}
-
-ex ex::simplify_ncmul(const exvector & v) const
-{
- GINAC_ASSERT(bp!=0);
- return bp->simplify_ncmul(v);
+ if (match(pattern)) {
+ found.append(*this);
+ found.sort();
+ found.unique();
+ return true;
+ }
+ bool any_found = false;
+ for (unsigned i=0; i<nops(); i++)
+ if (op(i).find(pattern, found))
+ any_found = true;
+ return any_found;