X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fbasic.cpp;h=16d0dfddafe37419f7e2fe911c1e5afa07cd2579;hp=c899d19f1659c2641d3b4048108bf5b90019c5f7;hb=b617b5cf86e6f8ac01a339d9747c535257fcf8d0;hpb=b9cd4b49ffbfbf3e1c36a2b594ec3148a5baca64 diff --git a/ginac/basic.cpp b/ginac/basic.cpp index c899d19f..16d0dfdd 100644 --- a/ginac/basic.cpp +++ b/ginac/basic.cpp @@ -134,7 +134,7 @@ void basic::print(const print_context & c, unsigned level) const c.s << "[" << class_name() << " object]"; } -/** Little wrapper arount print to be called within a debugger. +/** Little wrapper around print to be called within a debugger. * This is needed because you cannot call foo.print(cout) from within the * debugger because it might not know what cout is. This method can be * invoked with no argument and it will simply print to stdout. @@ -146,7 +146,7 @@ void basic::dbgprint(void) const std::cerr << std::endl; } -/** Little wrapper arount printtree to be called within a debugger. +/** Little wrapper around printtree to be called within a debugger. * * @see basic::dbgprint * @see basic::printtree */ @@ -213,24 +213,40 @@ ex basic::operator[](int i) const return op(i); } -/** Search ocurrences. An object 'has' an expression if it is the expression +/** Search ocurrences. An object 'has' an expression if it is the expression * itself or one of the children 'has' it. As a consequence (according to * the definition of children) given e=x+y+z, e.has(x) is true but e.has(x+y) - * is false. */ + * is false. The expression can also contain wildcards. */ bool basic::has(const ex & other) const { GINAC_ASSERT(other.bp!=0); lst repl_lst; - if (match(*other.bp, repl_lst)) return true; - if (nops()>0) { - for (unsigned i=0; isetflag(status_flags::dynallocated); + copy->clearflag(status_flags::hash_calculated); + ex e(*copy); + for (unsigned i=0; i