GiNaC 1.8.7
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GiNaC::expairseq Class Reference

A sequence of class expair. More...

#include <expairseq.h>

Inheritance diagram for GiNaC::expairseq:
GiNaC::basic GiNaC::refcounted GiNaC::add GiNaC::mul

Public Member Functions

 expairseq (const ex &lh, const ex &rh)
 
 expairseq (const exvector &v)
 
 expairseq (const epvector &v, const ex &oc, bool do_index_renaming=false)
 
 expairseq (epvector &&vp, const ex &oc, bool do_index_renaming=false)
 
unsigned precedence () const override
 Return relative operator precedence (for parenthezing output). More...
 
bool info (unsigned inf) const override
 Information about the object. More...
 
size_t nops () const override
 Number of operands/members. More...
 
ex op (size_t i) const override
 Return operand/member at position i. More...
 
ex map (map_function &f) const override
 Construct new expression by applying the specified function to all sub-expressions (one level only, not recursively). More...
 
ex eval () const override
 Perform coefficient-wise automatic term rewriting rules in this class. More...
 
ex to_rational (exmap &repl) const override
 Implementation of ex::to_rational() for expairseqs. More...
 
ex to_polynomial (exmap &repl) const override
 Implementation of ex::to_polynomial() for expairseqs. More...
 
bool match (const ex &pattern, exmap &repl_lst) const override
 Check whether the expression matches a given pattern. More...
 
ex subs (const exmap &m, unsigned options=0) const override
 Substitute a set of objects by arbitrary expressions. More...
 
ex conjugate () const override
 
void archive (archive_node &n) const override
 Save (serialize) the object into archive node. More...
 
void read_archive (const archive_node &n, lst &syms) override
 Load (deserialize) the object from an archive node. More...
 
- Public Member Functions inherited from GiNaC::basic
virtual ~basic ()
 basic destructor, virtual because class ex will delete objects of derived classes via a basic*. More...
 
 basic (const basic &other)
 
const basicoperator= (const basic &other)
 basic assignment operator: the other object might be of a derived class. More...
 
virtual basicduplicate () const
 Create a clone of this object on the heap. More...
 
virtual ex eval () const
 Perform automatic non-interruptive term rewriting rules. More...
 
virtual ex evalf () const
 Evaluate object numerically. More...
 
virtual ex evalm () const
 Evaluate sums, products and integer powers of matrices. More...
 
virtual ex eval_integ () const
 Evaluate integrals, if result is known. More...
 
virtual ex eval_indexed (const basic &i) const
 Perform automatic symbolic evaluations on indexed expression that contains this object as the base expression. More...
 
virtual void print (const print_context &c, unsigned level=0) const
 Output to stream. More...
 
virtual void dbgprint () const
 Little wrapper around print to be called within a debugger. More...
 
virtual void dbgprinttree () const
 Little wrapper around printtree to be called within a debugger. More...
 
virtual unsigned precedence () const
 Return relative operator precedence (for parenthezing output). More...
 
virtual bool info (unsigned inf) const
 Information about the object. More...
 
virtual size_t nops () const
 Number of operands/members. More...
 
virtual ex op (size_t i) const
 Return operand/member at position i. More...
 
virtual ex operator[] (const ex &index) const
 
virtual ex operator[] (size_t i) const
 
virtual exlet_op (size_t i)
 Return modifiable operand/member at position i. More...
 
virtual exoperator[] (const ex &index)
 
virtual exoperator[] (size_t i)
 
virtual bool has (const ex &other, unsigned options=0) const
 Test for occurrence of a pattern. More...
 
virtual bool match (const ex &pattern, exmap &repls) const
 Check whether the expression matches a given pattern. More...
 
virtual ex subs (const exmap &m, unsigned options=0) const
 Substitute a set of objects by arbitrary expressions. More...
 
virtual ex map (map_function &f) const
 Construct new expression by applying the specified function to all sub-expressions (one level only, not recursively). More...
 
virtual void accept (GiNaC::visitor &v) const
 
virtual bool is_polynomial (const ex &var) const
 Check whether this is a polynomial in the given variables. More...
 
virtual int degree (const ex &s) const
 Return degree of highest power in object s. More...
 
virtual int ldegree (const ex &s) const
 Return degree of lowest power in object s. More...
 
virtual ex coeff (const ex &s, int n=1) const
 Return coefficient of degree n in object s. More...
 
virtual ex expand (unsigned options=0) const
 Expand expression, i.e. More...
 
virtual ex collect (const ex &s, bool distributed=false) const
 Sort expanded expression in terms of powers of some object(s). More...
 
virtual ex series (const relational &r, int order, unsigned options=0) const
 Default implementation of ex::series(). More...
 
virtual ex normal (exmap &repl, exmap &rev_lookup, lst &modifier) const
 Default implementation of ex::normal(). More...
 
virtual ex to_rational (exmap &repl) const
 Default implementation of ex::to_rational(). More...
 
virtual ex to_polynomial (exmap &repl) const
 
virtual numeric integer_content () const
 
virtual ex smod (const numeric &xi) const
 Apply symmetric modular homomorphism to an expanded multivariate polynomial. More...
 
virtual numeric max_coefficient () const
 Implementation ex::max_coefficient(). More...
 
virtual exvector get_free_indices () const
 Return a vector containing the free indices of an expression. More...
 
virtual ex add_indexed (const ex &self, const ex &other) const
 Add two indexed expressions. More...
 
virtual ex scalar_mul_indexed (const ex &self, const numeric &other) const
 Multiply an indexed expression with a scalar. More...
 
virtual bool contract_with (exvector::iterator self, exvector::iterator other, exvector &v) const
 Try to contract two indexed expressions that appear in the same product. More...
 
virtual unsigned return_type () const
 
virtual return_type_t return_type_tinfo () const
 
virtual ex conjugate () const
 
virtual ex real_part () const
 
virtual ex imag_part () const
 
template<class T >
void print_dispatch (const print_context &c, unsigned level) const
 Like print(), but dispatch to the specified class. More...
 
void print_dispatch (const registered_class_info &ri, const print_context &c, unsigned level) const
 Like print(), but dispatch to the specified class. More...
 
virtual void archive (archive_node &n) const
 Save (serialize) the object into archive node. More...
 
virtual void read_archive (const archive_node &n, lst &syms)
 Load (deserialize) the object from an archive node. More...
 
ex subs_one_level (const exmap &m, unsigned options) const
 Helper function for subs(). More...
 
ex diff (const symbol &s, unsigned nth=1) const
 Default interface of nth derivative ex::diff(s, n). More...
 
int compare (const basic &other) const
 Compare objects syntactically to establish canonical ordering. More...
 
bool is_equal (const basic &other) const
 Test for syntactic equality. More...
 
const basichold () const
 Stop further evaluation. More...
 
unsigned gethash () const
 
const basicsetflag (unsigned f) const
 Set some status_flags. More...
 
const basicclearflag (unsigned f) const
 Clear some status_flags. More...
 
- Public Member Functions inherited from GiNaC::refcounted
 refcounted () noexcept
 
unsigned int add_reference () noexcept
 
unsigned int remove_reference () noexcept
 
unsigned int get_refcount () const noexcept
 
void set_refcount (unsigned int r) noexcept
 

Protected Member Functions

bool is_equal_same_type (const basic &other) const override
 Returns true if two objects of same type are equal. More...
 
unsigned return_type () const override
 
unsigned calchash () const override
 Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so. More...
 
ex expand (unsigned options=0) const override
 Expand expression, i.e. More...
 
virtual ex thisexpairseq (const epvector &v, const ex &oc, bool do_index_renaming=false) const
 Create an object of this type. More...
 
virtual ex thisexpairseq (epvector &&vp, const ex &oc, bool do_index_renaming=false) const
 
virtual void printseq (const print_context &c, char delim, unsigned this_precedence, unsigned upper_precedence) const
 
virtual void printpair (const print_context &c, const expair &p, unsigned upper_precedence) const
 
virtual expair split_ex_to_pair (const ex &e) const
 Form an expair from an ex, using the corresponding semantics. More...
 
virtual expair combine_ex_with_coeff_to_pair (const ex &e, const ex &c) const
 
virtual expair combine_pair_with_coeff_to_pair (const expair &p, const ex &c) const
 
virtual ex recombine_pair_to_ex (const expair &p) const
 Form an ex out of an expair, using the corresponding semantics. More...
 
virtual bool expair_needs_further_processing (epp it)
 
virtual ex default_overall_coeff () const
 
virtual void combine_overall_coeff (const ex &c)
 
virtual void combine_overall_coeff (const ex &c1, const ex &c2)
 
virtual bool can_make_flat (const expair &p) const
 
void do_print (const print_context &c, unsigned level) const
 
void do_print_tree (const print_tree &c, unsigned level) const
 
void construct_from_2_ex (const ex &lh, const ex &rh)
 
void construct_from_2_expairseq (const expairseq &s1, const expairseq &s2)
 
void construct_from_expairseq_ex (const expairseq &s, const ex &e)
 
void construct_from_exvector (const exvector &v)
 
void construct_from_epvector (const epvector &v, bool do_index_renaming=false)
 
void construct_from_epvector (epvector &&v, bool do_index_renaming=false)
 
void make_flat (const exvector &v)
 Combine this expairseq with argument exvector. More...
 
void make_flat (const epvector &v, bool do_index_renaming=false)
 Combine this expairseq with argument epvector. More...
 
void canonicalize ()
 Brings this expairseq into a sorted (canonical) form. More...
 
void combine_same_terms_sorted_seq ()
 Compact a presorted expairseq by combining all matching expairs to one each. More...
 
bool is_canonical () const
 Check if this expairseq is in sorted (canonical) form. More...
 
epvector expandchildren (unsigned options) const
 Member-wise expand the expairs in this sequence. More...
 
epvector evalchildren () const
 Member-wise evaluate the expairs in this sequence. More...
 
epvector subschildren (const exmap &m, unsigned options=0) const
 Member-wise substitute in this sequence. More...
 
- Protected Member Functions inherited from GiNaC::basic
 basic ()
 
virtual ex eval_ncmul (const exvector &v) const
 
virtual bool match_same_type (const basic &other) const
 Returns true if the attributes of two objects are similar enough for a match. More...
 
virtual ex derivative (const symbol &s) const
 Default implementation of ex::diff(). More...
 
virtual int compare_same_type (const basic &other) const
 Returns order relation between two objects of same type. More...
 
virtual bool is_equal_same_type (const basic &other) const
 Returns true if two objects of same type are equal. More...
 
virtual unsigned calchash () const
 Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so. More...
 
void ensure_if_modifiable () const
 Ensure the object may be modified without hurting others, throws if this is not the case. More...
 
void do_print (const print_context &c, unsigned level) const
 Default output to stream. More...
 
void do_print_tree (const print_tree &c, unsigned level) const
 Tree output to stream. More...
 
void do_print_python_repr (const print_python_repr &c, unsigned level) const
 Python parsable output to stream. More...
 

Protected Attributes

epvector seq
 
ex overall_coeff
 
- Protected Attributes inherited from GiNaC::basic
unsigned flags
 of type status_flags More...
 
unsigned hashvalue
 hash value More...
 

Detailed Description

A sequence of class expair.

This is used for time-critical classes like sums and products of terms since handling a list of coeff and rest is much faster than handling a list of products or powers, respectively. (Not incidentally, Maple does it the same way, maybe others too.) The semantics is (at least) twofold: one for addition and one for multiplication and several methods have to be overridden by derived classes to reflect the change in semantics. However, most functionality turns out to be shared between addition and multiplication, which is the reason why there is this base class.

Definition at line 49 of file expairseq.h.

Constructor & Destructor Documentation

◆ expairseq() [1/4]

GiNaC::expairseq::expairseq ( const ex lh,
const ex rh 
)

Definition at line 80 of file expairseq.cpp.

References construct_from_2_ex(), GINAC_ASSERT, and is_canonical().

Referenced by thisexpairseq().

◆ expairseq() [2/4]

GiNaC::expairseq::expairseq ( const exvector v)

Definition at line 86 of file expairseq.cpp.

References construct_from_exvector(), GINAC_ASSERT, and is_canonical().

◆ expairseq() [3/4]

GiNaC::expairseq::expairseq ( const epvector v,
const ex oc,
bool  do_index_renaming = false 
)

Definition at line 92 of file expairseq.cpp.

References construct_from_epvector(), GINAC_ASSERT, and is_canonical().

◆ expairseq() [4/4]

GiNaC::expairseq::expairseq ( epvector &&  vp,
const ex oc,
bool  do_index_renaming = false 
)

Definition at line 100 of file expairseq.cpp.

References construct_from_epvector(), GINAC_ASSERT, and is_canonical().

Member Function Documentation

◆ precedence()

unsigned GiNaC::expairseq::precedence ( ) const
inlineoverridevirtual

Return relative operator precedence (for parenthezing output).

Reimplemented from GiNaC::basic.

Reimplemented in GiNaC::mul.

Definition at line 62 of file expairseq.h.

Referenced by do_print(), and printpair().

◆ info()

bool GiNaC::expairseq::info ( unsigned  inf) const
overridevirtual

◆ nops()

size_t GiNaC::expairseq::nops ( ) const
overridevirtual

◆ op()

ex GiNaC::expairseq::op ( size_t  i) const
overridevirtual

◆ map()

ex GiNaC::expairseq::map ( map_function f) const
overridevirtual

Construct new expression by applying the specified function to all sub-expressions (one level only, not recursively).

Reimplemented from GiNaC::basic.

Definition at line 218 of file expairseq.cpp.

References default_overall_coeff(), GiNaC::ex::is_equal(), overall_coeff, recombine_pair_to_ex(), seq, split_ex_to_pair(), and thisexpairseq().

◆ eval()

ex GiNaC::expairseq::eval ( ) const
overridevirtual

Perform coefficient-wise automatic term rewriting rules in this class.

Reimplemented from GiNaC::basic.

Reimplemented in GiNaC::mul.

Definition at line 240 of file expairseq.cpp.

References evalchildren(), GiNaC::status_flags::evaluated, GiNaC::basic::flags, GiNaC::basic::hold(), and overall_coeff.

◆ to_rational()

ex GiNaC::expairseq::to_rational ( exmap repl) const
overridevirtual

◆ to_polynomial()

ex GiNaC::expairseq::to_polynomial ( exmap repl) const
overridevirtual

◆ match()

bool GiNaC::expairseq::match ( const ex pattern,
exmap repl_lst 
) const
overridevirtual

Check whether the expression matches a given pattern.

For every wildcard object in the pattern, a pair with the wildcard as a key and matching expression as a value is added to repl_lst.

Reimplemented from GiNaC::basic.

Definition at line 287 of file expairseq.cpp.

References GiNaC::ex::begin(), default_overall_coeff(), GiNaC::ex::is_equal(), GiNaC::match(), GiNaC::ex::nops(), nops(), GiNaC::ex::op(), op(), split_ex_to_pair(), and thisexpairseq().

◆ subs()

ex GiNaC::expairseq::subs ( const exmap m,
unsigned  options = 0 
) const
overridevirtual

Substitute a set of objects by arbitrary expressions.

The ex returned will already be evaluated.

Reimplemented from GiNaC::basic.

Definition at line 377 of file expairseq.cpp.

References GiNaC::subs_options::algebraic, m, GiNaC::subs_options::no_index_renaming, options, overall_coeff, GiNaC::basic::subs_one_level(), subschildren(), and thisexpairseq().

◆ conjugate()

ex GiNaC::expairseq::conjugate ( ) const
overridevirtual

Reimplemented from GiNaC::basic.

Reimplemented in GiNaC::mul.

Definition at line 274 of file expairseq.cpp.

References GiNaC::are_ex_trivially_equal(), GiNaC::ex::conjugate(), GiNaC::conjugateepvector(), overall_coeff, seq, thisexpairseq(), and x.

◆ archive()

void GiNaC::expairseq::archive ( archive_node n) const
overridevirtual

Save (serialize) the object into archive node.

Archive the object.

Losely speaking, this method turns an expression into a byte stream (which can be saved and restored later on, or sent via network, etc.)

Reimplemented from GiNaC::basic.

Definition at line 132 of file expairseq.cpp.

References n, overall_coeff, and seq.

◆ read_archive()

void GiNaC::expairseq::read_archive ( const archive_node n,
lst syms 
)
overridevirtual

Load (deserialize) the object from an archive node.

Construct object from archive_node.

Note
This method is essentially a constructor. However, constructors can't be virtual. So, if unarchiving routines are implemented as constructors one would need to define such a constructor in every class, even if all it does is simply calling constructor of a superclass.

Reimplemented from GiNaC::basic.

Definition at line 112 of file expairseq.cpp.

References canonicalize(), GiNaC::basic::coeff(), GINAC_ASSERT, is_canonical(), n, overall_coeff, and seq.

◆ is_equal_same_type()

bool GiNaC::expairseq::is_equal_same_type ( const basic other) const
overrideprotectedvirtual

Returns true if two objects of same type are equal.

Normally needs not be reimplemented as long as it wasn't overwritten by some parent class, since it just calls compare_same_type(). The reason why this function exists is that sometimes it is easier to determine equality than an order relation and then it can be overridden.

Reimplemented from GiNaC::basic.

Definition at line 419 of file expairseq.cpp.

References GiNaC::ex::is_equal(), overall_coeff, and seq.

◆ return_type()

unsigned GiNaC::expairseq::return_type ( ) const
overrideprotectedvirtual

Reimplemented from GiNaC::basic.

Reimplemented in GiNaC::mul.

Definition at line 441 of file expairseq.cpp.

References GiNaC::return_types::noncommutative_composite.

◆ calchash()

unsigned GiNaC::expairseq::calchash ( ) const
overrideprotectedvirtual

Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so.

The method inherited from class basic computes a hash value based on the type and hash values of possible members. For this reason it is well suited for container classes but atomic classes should override this implementation because otherwise they would all end up with the same hashvalue.

Reimplemented from GiNaC::basic.

Definition at line 446 of file expairseq.cpp.

References GiNaC::status_flags::evaluated, GiNaC::basic::flags, GiNaC::ex::gethash(), GiNaC::status_flags::hash_calculated, GiNaC::basic::hashvalue, GiNaC::make_hash_seed(), overall_coeff, GiNaC::rotate_left(), seq, and GiNaC::basic::setflag().

◆ expand()

ex GiNaC::expairseq::expand ( unsigned  options = 0) const
overrideprotectedvirtual

Expand expression, i.e.

multiply it out and return the result as a new expression.

Reimplemented from GiNaC::basic.

Reimplemented in GiNaC::mul.

Definition at line 466 of file expairseq.cpp.

References expandchildren(), GiNaC::status_flags::expanded, options, overall_coeff, GiNaC::basic::setflag(), and thisexpairseq().

◆ thisexpairseq() [1/2]

ex GiNaC::expairseq::thisexpairseq ( const epvector v,
const ex oc,
bool  do_index_renaming = false 
) const
protectedvirtual

Create an object of this type.

This method works similar to a constructor. It is useful because expairseq has (at least) two possible different semantics but we want to inherit methods thus avoiding code duplication. Sometimes a method in expairseq has to create a new one of the same semantics, which cannot be done by a ctor because the name (add, mul,...) is unknown on the expairseq level. In order for this trick to work a derived class must of course override this definition.

Reimplemented in GiNaC::add, and GiNaC::mul.

Definition at line 489 of file expairseq.cpp.

References expairseq().

Referenced by conjugate(), expand(), map(), match(), subs(), to_polynomial(), and to_rational().

◆ thisexpairseq() [2/2]

ex GiNaC::expairseq::thisexpairseq ( epvector &&  vp,
const ex oc,
bool  do_index_renaming = false 
) const
protectedvirtual

Reimplemented in GiNaC::add, and GiNaC::mul.

Definition at line 494 of file expairseq.cpp.

References expairseq().

◆ printseq()

void GiNaC::expairseq::printseq ( const print_context c,
char  delim,
unsigned  this_precedence,
unsigned  upper_precedence 
) const
protectedvirtual

◆ printpair()

void GiNaC::expairseq::printpair ( const print_context c,
const expair p,
unsigned  upper_precedence 
) const
protectedvirtual

Definition at line 499 of file expairseq.cpp.

References c, GiNaC::expair::coeff, precedence(), GiNaC::ex::print(), and GiNaC::expair::rest.

Referenced by is_canonical(), and printseq().

◆ split_ex_to_pair()

expair GiNaC::expairseq::split_ex_to_pair ( const ex e) const
protectedvirtual

Form an expair from an ex, using the corresponding semantics.

See also
expairseq::recombine_pair_to_ex()

Reimplemented in GiNaC::add, and GiNaC::mul.

Definition at line 532 of file expairseq.cpp.

References GiNaC::_ex1.

Referenced by construct_from_2_ex(), construct_from_expairseq_ex(), make_flat(), map(), match(), subschildren(), to_polynomial(), and to_rational().

◆ combine_ex_with_coeff_to_pair()

expair GiNaC::expairseq::combine_ex_with_coeff_to_pair ( const ex e,
const ex c 
) const
protectedvirtual

Reimplemented in GiNaC::add, and GiNaC::mul.

Definition at line 538 of file expairseq.cpp.

References c, and GINAC_ASSERT.

Referenced by evalchildren(), and subschildren().

◆ combine_pair_with_coeff_to_pair()

expair GiNaC::expairseq::combine_pair_with_coeff_to_pair ( const expair p,
const ex c 
) const
protectedvirtual

Reimplemented in GiNaC::add, and GiNaC::mul.

Definition at line 547 of file expairseq.cpp.

References c, GiNaC::expair::coeff, GINAC_ASSERT, and GiNaC::expair::rest.

◆ recombine_pair_to_ex()

ex GiNaC::expairseq::recombine_pair_to_ex ( const expair p) const
protectedvirtual

Form an ex out of an expair, using the corresponding semantics.

See also
expairseq::split_ex_to_pair()

Reimplemented in GiNaC::add, and GiNaC::mul.

Definition at line 559 of file expairseq.cpp.

References GiNaC::expair::coeff, and GiNaC::expair::rest.

Referenced by map(), op(), subschildren(), to_polynomial(), and to_rational().

◆ expair_needs_further_processing()

bool GiNaC::expairseq::expair_needs_further_processing ( epp  it)
protectedvirtual

Reimplemented in GiNaC::mul.

Definition at line 564 of file expairseq.cpp.

References GiNaC::_ex1.

Referenced by combine_same_terms_sorted_seq(), construct_from_2_expairseq(), and construct_from_expairseq_ex().

◆ default_overall_coeff()

ex GiNaC::expairseq::default_overall_coeff ( ) const
protectedvirtual

Reimplemented in GiNaC::mul.

Definition at line 574 of file expairseq.cpp.

References GiNaC::_ex0.

Referenced by do_print_tree(), map(), match(), nops(), op(), printseq(), to_polynomial(), and to_rational().

◆ combine_overall_coeff() [1/2]

void GiNaC::expairseq::combine_overall_coeff ( const ex c)
protectedvirtual

Reimplemented in GiNaC::mul.

Definition at line 579 of file expairseq.cpp.

References c, GINAC_ASSERT, and overall_coeff.

Referenced by construct_from_2_ex(), construct_from_2_expairseq(), construct_from_expairseq_ex(), and make_flat().

◆ combine_overall_coeff() [2/2]

void GiNaC::expairseq::combine_overall_coeff ( const ex c1,
const ex c2 
)
protectedvirtual

Reimplemented in GiNaC::mul.

Definition at line 586 of file expairseq.cpp.

References GINAC_ASSERT, and overall_coeff.

◆ can_make_flat()

bool GiNaC::expairseq::can_make_flat ( const expair p) const
protectedvirtual

Reimplemented in GiNaC::mul.

Definition at line 595 of file expairseq.cpp.

◆ do_print()

void GiNaC::expairseq::do_print ( const print_context c,
unsigned  level 
) const
protected

Definition at line 149 of file expairseq.cpp.

References c, precedence(), and printseq().

◆ do_print_tree()

void GiNaC::expairseq::do_print_tree ( const print_tree c,
unsigned  level 
) const
protected

◆ construct_from_2_ex()

void GiNaC::expairseq::construct_from_2_ex ( const ex lh,
const ex rh 
)
protected

◆ construct_from_2_expairseq()

void GiNaC::expairseq::construct_from_2_expairseq ( const expairseq s1,
const expairseq s2 
)
protected

◆ construct_from_expairseq_ex()

void GiNaC::expairseq::construct_from_expairseq_ex ( const expairseq s,
const ex e 
)
protected

◆ construct_from_exvector()

void GiNaC::expairseq::construct_from_exvector ( const exvector v)
protected

◆ construct_from_epvector() [1/2]

void GiNaC::expairseq::construct_from_epvector ( const epvector v,
bool  do_index_renaming = false 
)
protected

◆ construct_from_epvector() [2/2]

void GiNaC::expairseq::construct_from_epvector ( epvector &&  v,
bool  do_index_renaming = false 
)
protected

Definition at line 805 of file expairseq.cpp.

References canonicalize(), combine_same_terms_sorted_seq(), and make_flat().

◆ make_flat() [1/2]

void GiNaC::expairseq::make_flat ( const exvector v)
protected

Combine this expairseq with argument exvector.

It cares for associativity as well as for special handling of numerics.

Definition at line 819 of file expairseq.cpp.

References GiNaC::_ex1, combine_overall_coeff(), GiNaC::make_flat_inserter::handle_factor(), GiNaC::info_flags::has_indices, overall_coeff, seq, and split_ex_to_pair().

Referenced by construct_from_epvector(), and construct_from_exvector().

◆ make_flat() [2/2]

void GiNaC::expairseq::make_flat ( const epvector v,
bool  do_index_renaming = false 
)
protected

Combine this expairseq with argument epvector.

It cares for associativity as well as for special handling of numerics.

Definition at line 864 of file expairseq.cpp.

References GiNaC::_ex1, GiNaC::are_ex_trivially_equal(), GiNaC::ex::coeff(), combine_overall_coeff(), GiNaC::make_flat_inserter::handle_factor(), GiNaC::info_flags::has_indices, overall_coeff, and seq.

◆ canonicalize()

void GiNaC::expairseq::canonicalize ( )
protected

Brings this expairseq into a sorted (canonical) form.

Definition at line 915 of file expairseq.cpp.

References seq.

Referenced by construct_from_epvector(), construct_from_exvector(), and read_archive().

◆ combine_same_terms_sorted_seq()

void GiNaC::expairseq::combine_same_terms_sorted_seq ( )
protected

Compact a presorted expairseq by combining all matching expairs to one each.

On an add object, this is responsible for 2*x+3*x+y -> 5*x+y, for instance.

Definition at line 924 of file expairseq.cpp.

References construct_from_epvector(), expair_needs_further_processing(), last, and seq.

Referenced by construct_from_epvector(), and construct_from_exvector().

◆ is_canonical()

bool GiNaC::expairseq::is_canonical ( ) const
protected

Check if this expairseq is in sorted (canonical) form.

Useful mainly for debugging or in assertions since being sorted is an invariance.

Definition at line 972 of file expairseq.cpp.

References printpair(), and seq.

Referenced by GiNaC::add::add(), expairseq(), GiNaC::mul::mul(), and read_archive().

◆ expandchildren()

epvector GiNaC::expairseq::expandchildren ( unsigned  options) const
protected

Member-wise expand the expairs in this sequence.

See also
expairseq::expand()
Returns
epvector containing expanded pairs, empty if no members had to be changed.

Definition at line 1009 of file expairseq.cpp.

References GiNaC::are_ex_trivially_equal(), GiNaC::ex::coeff(), GiNaC::ex::expand(), last, options, and seq.

Referenced by GiNaC::add::expand(), and expand().

◆ evalchildren()

epvector GiNaC::expairseq::evalchildren ( ) const
protected

Member-wise evaluate the expairs in this sequence.

See also
expairseq::eval()
Returns
epvector containing evaluated pairs, empty if no members had to be changed.

Definition at line 1047 of file expairseq.cpp.

References combine_ex_with_coeff_to_pair(), GiNaC::expair::is_equal(), last, seq, and unlikely.

Referenced by GiNaC::add::eval(), eval(), and GiNaC::mul::eval().

◆ subschildren()

epvector GiNaC::expairseq::subschildren ( const exmap m,
unsigned  options = 0 
) const
protected

Member-wise substitute in this sequence.

See also
expairseq::subs()
Returns
epvector containing expanded pairs, empty if no members had to be changed.

Definition at line 1084 of file expairseq.cpp.

References GiNaC::are_ex_trivially_equal(), GiNaC::ex::coeff(), combine_ex_with_coeff_to_pair(), GiNaC::expair::is_equal(), last, m, options, GiNaC::subs_options::pattern_is_not_product, GiNaC::subs_options::pattern_is_product, recombine_pair_to_ex(), seq, split_ex_to_pair(), and GiNaC::ex::subs().

Referenced by subs().

Member Data Documentation

◆ seq

epvector GiNaC::expairseq::seq
protected

Definition at line 127 of file expairseq.h.

Referenced by archive(), calchash(), GiNaC::mul::can_be_further_expanded(), canonicalize(), GiNaC::add::coeff(), GiNaC::mul::coeff(), combine_same_terms_sorted_seq(), conjugate(), GiNaC::mul::conjugate(), construct_from_2_ex(), construct_from_2_expairseq(), construct_from_expairseq_ex(), GiNaC::add::degree(), GiNaC::mul::degree(), GiNaC::add::derivative(), GiNaC::mul::derivative(), GiNaC::mul::do_print(), GiNaC::add::do_print_csrc(), GiNaC::mul::do_print_csrc(), GiNaC::mul::do_print_latex(), do_print_tree(), GiNaC::add::eval(), GiNaC::mul::eval(), GiNaC::power::eval(), GiNaC::add::eval_ncmul(), GiNaC::mul::eval_ncmul(), evalchildren(), GiNaC::mul::evalf(), GiNaC::add::evalm(), GiNaC::mul::evalm(), GiNaC::mul::expand(), GiNaC::power::expand(), GiNaC::power::expand_add(), GiNaC::power::expand_add_2(), expandchildren(), GiNaC::mul::expandchildren(), GiNaC::mul::find_real_imag(), GiNaC::add::imag_part(), GiNaC::add::info(), info(), GiNaC::mul::info(), GiNaC::add::integer_content(), GiNaC::mul::integer_content(), is_canonical(), is_equal_same_type(), GiNaC::add::is_polynomial(), GiNaC::mul::is_polynomial(), GiNaC::add::ldegree(), GiNaC::mul::ldegree(), make_flat(), map(), GiNaC::add::max_coefficient(), GiNaC::mul::max_coefficient(), nops(), GiNaC::add::normal(), GiNaC::mul::normal(), op(), GiNaC::add::print_add(), printseq(), read_archive(), GiNaC::add::real_part(), GiNaC::add::return_type(), GiNaC::mul::return_type(), GiNaC::add::return_type_tinfo(), GiNaC::mul::return_type_tinfo(), GiNaC::add::series(), GiNaC::mul::series(), GiNaC::add::smod(), GiNaC::mul::smod(), subschildren(), to_polynomial(), and to_rational().

◆ overall_coeff

ex GiNaC::expairseq::overall_coeff
protected

The documentation for this class was generated from the following files:

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.