50wildcard::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)
Archiving of GiNaC expressions.
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
const basic & setflag(unsigned f) const
Set some status_flags.
unsigned hashvalue
hash value
unsigned flags
of type status_flags
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.
Lightweight wrapper for GiNaC's symbolic objects.
Base class for print_contexts.
Context for python-parsable output.
Context for tree-like output for debugging.
@ expanded
.expand(0) has already done its job (other expand() options ignore this flag)
@ evaluated
.eval() has already done its job
@ hash_calculated
.calchash() has already done its job
This class acts as a wildcard for subs(), match(), has() and find().
bool match(const ex &pattern, exmap &repl_lst) const override
Check whether the expression matches a given pattern.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
wildcard(unsigned label)
Construct wildcard with specified label.
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags,...
void archive(archive_node &n) const override
Save (a.k.a.
void do_print(const print_context &c, unsigned level) const
unsigned label
Label used to distinguish different wildcards.
void do_print_python_repr(const print_python_repr &c, unsigned level) const
void do_print_tree(const print_tree &c, unsigned level) const
bool haswild(const ex &x)
Check whether x has a wildcard anywhere as a subexpression.
unsigned golden_ratio_hash(uintptr_t n)
Truncated multiplication with golden ratio, for computing hash values.
std::map< ex, ex, ex_is_less > exmap
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
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
static unsigned make_hash_seed(const std::type_info &tinfo)
We need a hash function which gives different values for objects of different types.
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T(lst, basic, print_func< print_context >(&lst::do_print). print_func< print_tree >(&lst::do_print_tree)) template<> bool lst GINAC_BIND_UNARCHIVER(lst)
Specialization of container::info() for lst.
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
Interface to GiNaC's wildcard objects.