50 wildcard::wildcard(
unsigned l) : label(l)
61 inherited::read_archive(
n, sym_lst);
62 n.find_unsigned(
"label",
label);
69 inherited::archive(
n);
70 n.add_unsigned(
"label",
label);
95 c.s << std::string(level,
' ') << class_name() <<
"(" <<
label <<
")" <<
" @" <<
this 96 << std::hex <<
", hash=0x" <<
hashvalue <<
", flags=0x" <<
flags << std::dec
102 c.s << class_name() <<
'(' <<
label <<
')';
121 return is_equal(ex_to<basic>(pattern));
126 if (is_a<wildcard>(
x))
128 for (
size_t i=0; i<
x.
nops(); ++i)
unsigned hashvalue
hash value
wildcard(unsigned label)
Construct wildcard with specified label.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
const basic & setflag(unsigned f) const
Set some status_flags.
This class acts as a wildcard for subs(), match(), has() and find().
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags...
Archiving of GiNaC expressions.
void do_print_python_repr(const print_python_repr &c, unsigned level) const
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Context for python-parsable output.
void archive(archive_node &n) const override
Save (a.k.a.
void do_print(const print_context &c, unsigned level) const
Interface to GiNaC's wildcard objects.
void do_print_tree(const print_tree &c, unsigned level) const
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
bool haswild(const ex &x)
Check whether x has a wildcard anywhere as a subexpression.
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
static unsigned make_hash_seed(const std::type_info &tinfo)
We need a hash function which gives different values for objects of different types.
unsigned label
Label used to distinguish different wildcards.
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq, print_func< print_context >(&add::do_print). print_func< print_latex >(&add::do_print_latex). print_func< print_csrc >(&add::do_print_csrc). print_func< print_tree >(&add::do_print_tree). print_func< print_python_repr >(&add::do_print_python_repr)) add
std::map< ex, ex, ex_is_less > exmap
unsigned golden_ratio_hash(uintptr_t n)
Truncated multiplication with golden ratio, for computing hash values.
Base class for print_contexts.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
Lightweight wrapper for GiNaC's symbolic objects.
.calchash() has already done its job
bool is_equal(const basic &other) const
Test for syntactic equality.
virtual int compare_same_type(const basic &other) const
Returns order relation between two objects of same type.
Wrapper template for making GiNaC classes out of STL containers.
bool match(const ex &pattern, exmap &repl_lst) const override
Check whether the expression matches a given pattern.
.expand(0) has already done its job (other expand() options ignore this flag)
.eval() has already done its job
Context for tree-like output for debugging.
unsigned flags
of type status_flags
GINAC_BIND_UNARCHIVER(add)