23#ifndef GINAC_EXPAIRSEQ_H
24#define GINAC_EXPAIRSEQ_H
34typedef epvector::iterator
epp;
63 bool info(
unsigned inf)
const override;
64 size_t nops()
const override;
65 ex op(
size_t i)
const override;
70 bool match(
const ex & pattern,
exmap& repl_lst)
const override;
71 ex subs(
const exmap & m,
unsigned options = 0)
const override;
80 ex expand(
unsigned options=0)
const override;
87 unsigned this_precedence,
88 unsigned upper_precedence)
const;
90 unsigned upper_precedence)
const;
142 for (epvector::const_iterator i=epv.begin(); i!=epv.end(); ++i)
150 for (exvector::const_iterator i=v.begin(); i!=v.end(); ++i)
164 if (dummies_of_factor.size() == 0)
166 sort(dummies_of_factor.begin(), dummies_of_factor.end(),
ex_is_less());
168 dummies_of_factor, x);
177 dummies_of_factor.begin(), dummies_of_factor.end(),
178 std::back_insert_iterator<exvector>(new_dummy_indices),
ex_is_less());
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.
Lightweight wrapper for GiNaC's symbolic objects.
exvector get_free_indices() const
A sequence of class expair.
ex eval() const override
Perform coefficient-wise automatic term rewriting rules in this class.
epvector subschildren(const exmap &m, unsigned options=0) const
Member-wise substitute in this sequence.
void combine_same_terms_sorted_seq()
Compact a presorted expairseq by combining all matching expairs to one each.
size_t nops() const override
Number of operands/members.
bool is_equal_same_type(const basic &other) const override
Returns true if two objects of same type are equal.
expairseq(const ex &lh, const ex &rh)
virtual bool expair_needs_further_processing(epp it)
ex conjugate() const override
void construct_from_2_expairseq(const expairseq &s1, const expairseq &s2)
bool match(const ex &pattern, exmap &repl_lst) const override
Check whether the expression matches a given pattern.
ex subs(const exmap &m, unsigned options=0) const override
Substitute a set of objects by arbitrary expressions.
unsigned return_type() const override
ex to_polynomial(exmap &repl) const override
Implementation of ex::to_polynomial() for expairseqs.
void construct_from_epvector(const epvector &v, bool do_index_renaming=false)
void construct_from_2_ex(const ex &lh, const ex &rh)
virtual ex default_overall_coeff() const
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
virtual void printpair(const print_context &c, const expair &p, unsigned upper_precedence) const
bool is_canonical() const
Check if this expairseq is in sorted (canonical) form.
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
virtual ex thisexpairseq(const epvector &v, const ex &oc, bool do_index_renaming=false) const
Create an object of this type.
virtual expair combine_pair_with_coeff_to_pair(const expair &p, const ex &c) const
bool info(unsigned inf) const override
Information about the object.
void construct_from_exvector(const exvector &v)
void read_archive(const archive_node &n, lst &syms) override
Load (deserialize) the object from an archive node.
virtual expair combine_ex_with_coeff_to_pair(const ex &e, const ex &c) const
void make_flat(const exvector &v)
Combine this expairseq with argument exvector.
virtual void printseq(const print_context &c, char delim, unsigned this_precedence, unsigned upper_precedence) const
virtual bool can_make_flat(const expair &p) const
ex to_rational(exmap &repl) const override
Implementation of ex::to_rational() for expairseqs.
ex expand(unsigned options=0) const override
Expand expression, i.e.
void construct_from_expairseq_ex(const expairseq &s, const ex &e)
void do_print(const print_context &c, unsigned level) const
epvector evalchildren() const
Member-wise evaluate the expairs in this sequence.
ex op(size_t i) const override
Return operand/member at position i.
virtual ex recombine_pair_to_ex(const expair &p) const
Form an ex out of an expair, using the corresponding semantics.
void do_print_tree(const print_tree &c, unsigned level) const
virtual void combine_overall_coeff(const ex &c)
ex map(map_function &f) const override
Construct new expression by applying the specified function to all sub-expressions (one level only,...
epvector expandchildren(unsigned options) const
Member-wise expand the expairs in this sequence.
void canonicalize()
Brings this expairseq into a sorted (canonical) form.
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags,...
virtual expair split_ex_to_pair(const ex &e) const
Form an expair from an ex, using the corresponding semantics.
make_flat_inserter(const exvector &v, bool b)
ex handle_factor(const ex &x, const ex &coeff)
void combine_indices(const exvector &dummies_of_factor)
make_flat_inserter(const epvector &epv, bool b)
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
Base class for print_contexts.
Context for tree-like output for debugging.
Definition of expression pairs (building blocks of expairseq).
Interface to GiNaC's indexed expressions.
container< std::list > lst
std::map< ex, ex, ex_is_less > exmap
std::vector< expair > epvector
expair-vector
epvector * conjugateepvector(const epvector &epv)
Complex conjugate every element of an epvector.
bool are_ex_trivially_equal(const ex &e1, const ex &e2)
Compare two objects of class quickly without doing a deep tree traversal.
bool is_a(const basic &obj)
Check if obj is a T, including base classes.
ex coeff(const ex &thisex, const ex &s, int n=1)
epvector::iterator epp
expair-vector pointer
lst rename_dummy_indices_uniquely(const exvector &va, const exvector &vb)
Similar to above, where va and vb are the same and the return value is a list of two lists for substi...
std::vector< ex > exvector
exvector get_all_dummy_indices_safely(const ex &e)
More reliable version of the form.
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Function object for map().