GiNaC 1.8.7
Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes | List of all members
GiNaC::structure< T, ComparisonPolicy > Class Template Reference

Wrapper template for making GiNaC classes out of C++ structures. More...

#include <structure.h>

Inheritance diagram for GiNaC::structure< T, ComparisonPolicy >:
GiNaC::basic GiNaC::refcounted

Public Member Functions

 structure (const T &t)
 Construct structure as a copy of a given C++ structure. More...
 
ex eval () const override
 Perform automatic non-interruptive term rewriting rules. More...
 
ex evalm () const override
 Evaluate sums, products and integer powers of matrices. More...
 
ex eval_indexed (const basic &i) const override
 Perform automatic symbolic evaluations on indexed expression that contains this object as the base expression. More...
 
void print (const print_context &c, unsigned level=0) const override
 Output to stream. More...
 
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 operator[] (const ex &index) const override
 
ex operator[] (size_t i) const override
 
exlet_op (size_t i) override
 Return modifiable operand/member at position i. More...
 
exoperator[] (const ex &index) override
 
exoperator[] (size_t i) override
 
bool has (const ex &other, unsigned options=0) const override
 Test for occurrence of a pattern. 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 map (map_function &f) const override
 Construct new expression by applying the specified function to all sub-expressions (one level only, not recursively). More...
 
int degree (const ex &s) const override
 Return degree of highest power in object s. More...
 
int ldegree (const ex &s) const override
 Return degree of lowest power in object s. More...
 
ex coeff (const ex &s, int n=1) const override
 Return coefficient of degree n in object s. More...
 
ex expand (unsigned options=0) const override
 Expand expression, i.e. More...
 
ex collect (const ex &s, bool distributed=false) const override
 Sort expanded expression in terms of powers of some object(s). More...
 
ex series (const relational &r, int order, unsigned options=0) const override
 Default implementation of ex::series(). More...
 
ex normal (exmap &repl, exmap &rev_lookup, lst &modifier) const override
 Default implementation of ex::normal(). More...
 
ex to_rational (exmap &repl) const override
 Default implementation of ex::to_rational(). More...
 
ex to_polynomial (exmap &repl) const override
 
numeric integer_content () const override
 
ex smod (const numeric &xi) const override
 Apply symmetric modular homomorphism to an expanded multivariate polynomial. More...
 
numeric max_coefficient () const override
 Implementation ex::max_coefficient(). More...
 
exvector get_free_indices () const override
 Return a vector containing the free indices of an expression. More...
 
ex add_indexed (const ex &self, const ex &other) const override
 Add two indexed expressions. More...
 
ex scalar_mul_indexed (const ex &self, const numeric &other) const override
 Multiply an indexed expression with a scalar. More...
 
bool contract_with (exvector::iterator self, exvector::iterator other, exvector &v) const override
 Try to contract two indexed expressions that appear in the same product. More...
 
unsigned return_type () const override
 
return_type_t return_type_tinfo () const override
 
const T * operator-> () const
 
T & get_struct ()
 
const T & get_struct () const
 
- 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

ex eval_ncmul (const exvector &v) const override
 
bool match_same_type (const basic &other) const override
 Returns true if the attributes of two objects are similar enough for a match. More...
 
ex derivative (const symbol &s) const override
 Default implementation of ex::diff(). More...
 
bool is_equal_same_type (const basic &other) const override
 Returns true if two objects of same type are equal. More...
 
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...
 
- 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...
 

Static Private Member Functions

static const char * get_class_name ()
 

Private Attributes

obj
 

Additional Inherited Members

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

Detailed Description

template<class T, template< class > class ComparisonPolicy>
class GiNaC::structure< T, ComparisonPolicy >

Wrapper template for making GiNaC classes out of C++ structures.

Definition at line 115 of file structure.h.

Constructor & Destructor Documentation

◆ structure()

template<class T , template< class > class ComparisonPolicy>
GiNaC::structure< T, CP >::structure ( const T &  t)
inline

Construct structure as a copy of a given C++ structure.

Default constructor.

Definition at line 123 of file structure.h.

Member Function Documentation

◆ get_class_name()

template<class T , template< class > class ComparisonPolicy>
static const char * GiNaC::structure< T, ComparisonPolicy >::get_class_name ( )
inlinestaticprivate

Definition at line 119 of file structure.h.

◆ eval()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::eval ( ) const
inlineoverridevirtual

Perform automatic non-interruptive term rewriting rules.

Reimplemented from GiNaC::basic.

Definition at line 129 of file structure.h.

References GiNaC::basic::hold().

◆ evalm()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::evalm ( ) const
inlineoverridevirtual

Evaluate sums, products and integer powers of matrices.

Reimplemented from GiNaC::basic.

Definition at line 130 of file structure.h.

References GiNaC::evalm().

◆ eval_ncmul()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::eval_ncmul ( const exvector v) const
inlineoverrideprotectedvirtual

Reimplemented from GiNaC::basic.

Definition at line 132 of file structure.h.

References GiNaC::hold_ncmul().

◆ eval_indexed()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::eval_indexed ( const basic i) const
inlineoverridevirtual

Perform automatic symbolic evaluations on indexed expression that contains this object as the base expression.

Reimplemented from GiNaC::basic.

Definition at line 134 of file structure.h.

References GiNaC::basic::hold().

◆ print()

template<class T , template< class > class ComparisonPolicy>
void GiNaC::structure< T, ComparisonPolicy >::print ( const print_context c,
unsigned  level = 0 
) const
inlineoverridevirtual

Output to stream.

This performs double dispatch on the dynamic type of *this and the dynamic type of the supplied print context.

Parameters
cprint context object that describes the output formatting
levelvalue that is used to identify the precedence or indentation level for placing parentheses and formatting

Reimplemented from GiNaC::basic.

Definition at line 137 of file structure.h.

References c.

◆ precedence()

template<class T , template< class > class ComparisonPolicy>
unsigned GiNaC::structure< T, ComparisonPolicy >::precedence ( ) const
inlineoverridevirtual

Return relative operator precedence (for parenthezing output).

Reimplemented from GiNaC::basic.

Definition at line 138 of file structure.h.

◆ info()

template<class T , template< class > class ComparisonPolicy>
bool GiNaC::structure< T, ComparisonPolicy >::info ( unsigned  inf) const
inlineoverridevirtual

Information about the object.

See also
class info_flags

Reimplemented from GiNaC::basic.

Definition at line 141 of file structure.h.

◆ nops()

template<class T , template< class > class ComparisonPolicy>
size_t GiNaC::structure< T, ComparisonPolicy >::nops ( ) const
inlineoverridevirtual

Number of operands/members.

Reimplemented from GiNaC::basic.

Definition at line 144 of file structure.h.

◆ op()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::op ( size_t  i) const
inlineoverridevirtual

Return operand/member at position i.

Reimplemented from GiNaC::basic.

Definition at line 145 of file structure.h.

References GiNaC::op().

◆ operator[]() [1/4]

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::operator[] ( const ex index) const
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 146 of file structure.h.

◆ operator[]() [2/4]

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::operator[] ( size_t  i) const
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 147 of file structure.h.

◆ let_op()

template<class T , template< class > class ComparisonPolicy>
ex & GiNaC::structure< T, ComparisonPolicy >::let_op ( size_t  i)
inlineoverridevirtual

Return modifiable operand/member at position i.

Reimplemented from GiNaC::basic.

Definition at line 148 of file structure.h.

◆ operator[]() [3/4]

template<class T , template< class > class ComparisonPolicy>
ex & GiNaC::structure< T, ComparisonPolicy >::operator[] ( const ex index)
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 149 of file structure.h.

◆ operator[]() [4/4]

template<class T , template< class > class ComparisonPolicy>
ex & GiNaC::structure< T, ComparisonPolicy >::operator[] ( size_t  i)
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 150 of file structure.h.

◆ has()

template<class T , template< class > class ComparisonPolicy>
bool GiNaC::structure< T, ComparisonPolicy >::has ( const ex pattern,
unsigned  options = 0 
) const
inlineoverridevirtual

Test for occurrence of a pattern.

An object 'has' a pattern if it matches the pattern 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.

Reimplemented from GiNaC::basic.

Definition at line 153 of file structure.h.

References GiNaC::has(), and options.

◆ match()

template<class T , template< class > class ComparisonPolicy>
bool GiNaC::structure< T, ComparisonPolicy >::match ( const ex pattern,
exmap repl_lst 
) const
inlineoverridevirtual

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 154 of file structure.h.

References GiNaC::match().

◆ match_same_type()

template<class T , template< class > class ComparisonPolicy>
bool GiNaC::structure< T, ComparisonPolicy >::match_same_type ( const basic other) const
inlineoverrideprotectedvirtual

Returns true if the attributes of two objects are similar enough for a match.

This function must not match subexpressions (this is already done by basic::match()). Only attributes not accessible by op() should be compared. This is also the reason why this function doesn't take the wildcard replacement list from match() as an argument: only subexpressions are subject to wildcard matches. Also, this function only needs to be implemented for container classes because is_equal_same_type() is automatically used instead of match_same_type() if nops() == 0.

See also
basic::match

Reimplemented from GiNaC::basic.

Definition at line 156 of file structure.h.

◆ subs()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::subs ( const exmap m,
unsigned  options = 0 
) const
inlineoverridevirtual

Substitute a set of objects by arbitrary expressions.

The ex returned will already be evaluated.

Reimplemented from GiNaC::basic.

Definition at line 160 of file structure.h.

References m, options, and GiNaC::subs().

◆ map()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::map ( map_function f) const
inlineoverridevirtual

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

Reimplemented from GiNaC::basic.

Definition at line 163 of file structure.h.

◆ degree()

template<class T , template< class > class ComparisonPolicy>
int GiNaC::structure< T, ComparisonPolicy >::degree ( const ex s) const
inlineoverridevirtual

Return degree of highest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 166 of file structure.h.

References GiNaC::degree().

◆ ldegree()

template<class T , template< class > class ComparisonPolicy>
int GiNaC::structure< T, ComparisonPolicy >::ldegree ( const ex s) const
inlineoverridevirtual

Return degree of lowest power in object s.

Reimplemented from GiNaC::basic.

Definition at line 167 of file structure.h.

References GiNaC::ldegree().

◆ coeff()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::coeff ( const ex s,
int  n = 1 
) const
inlineoverridevirtual

Return coefficient of degree n in object s.

Reimplemented from GiNaC::basic.

Definition at line 168 of file structure.h.

References GiNaC::coeff(), and n.

◆ expand()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::expand ( unsigned  options = 0) const
inlineoverridevirtual

Expand expression, i.e.

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

Reimplemented from GiNaC::basic.

Definition at line 171 of file structure.h.

References GiNaC::expand(), and options.

◆ collect()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::collect ( const ex s,
bool  distributed = false 
) const
inlineoverridevirtual

Sort expanded expression in terms of powers of some object(s).

Parameters
sobject(s) to sort in
distributedrecursive or distributed form (only used when s is a list)

Reimplemented from GiNaC::basic.

Definition at line 172 of file structure.h.

References GiNaC::collect().

◆ derivative()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::derivative ( const symbol s) const
inlineoverrideprotectedvirtual

Default implementation of ex::diff().

It maps the operation on the operands (or returns 0 when the object has no operands).

See also
ex::diff

Reimplemented from GiNaC::basic.

Definition at line 176 of file structure.h.

◆ series()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::series ( const relational r,
int  order,
unsigned  options = 0 
) const
inlineoverridevirtual

Default implementation of ex::series().

This performs Taylor expansion.

See also
ex::series

Reimplemented from GiNaC::basic.

Definition at line 178 of file structure.h.

References options, order, r, and GiNaC::series().

◆ normal()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::normal ( exmap repl,
exmap rev_lookup,
lst modifier 
) const
inlineoverridevirtual

Default implementation of ex::normal().

It normalizes the children and replaces the object with a temporary symbol.

See also
ex::normal

Reimplemented from GiNaC::basic.

Definition at line 181 of file structure.h.

References GiNaC::normal().

◆ to_rational()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::to_rational ( exmap repl) const
inlineoverridevirtual

Default implementation of ex::to_rational().

This replaces the object with a temporary symbol.

Reimplemented from GiNaC::basic.

Definition at line 182 of file structure.h.

References GiNaC::to_rational().

◆ to_polynomial()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::to_polynomial ( exmap repl) const
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 183 of file structure.h.

References GiNaC::to_polynomial().

◆ integer_content()

template<class T , template< class > class ComparisonPolicy>
numeric GiNaC::structure< T, ComparisonPolicy >::integer_content ( ) const
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 186 of file structure.h.

◆ smod()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::smod ( const numeric xi) const
inlineoverridevirtual

Apply symmetric modular homomorphism to an expanded multivariate polynomial.

This function is usually used internally by heur_gcd().

Parameters
ximodulus
Returns
mapped polynomial
See also
heur_gcd

Reimplemented from GiNaC::basic.

Definition at line 187 of file structure.h.

◆ max_coefficient()

template<class T , template< class > class ComparisonPolicy>
numeric GiNaC::structure< T, ComparisonPolicy >::max_coefficient ( ) const
inlineoverridevirtual

Implementation ex::max_coefficient().

See also
heur_gcd

Reimplemented from GiNaC::basic.

Definition at line 188 of file structure.h.

◆ get_free_indices()

template<class T , template< class > class ComparisonPolicy>
exvector GiNaC::structure< T, ComparisonPolicy >::get_free_indices ( ) const
inlineoverridevirtual

Return a vector containing the free indices of an expression.

Reimplemented from GiNaC::basic.

Definition at line 191 of file structure.h.

◆ add_indexed()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::add_indexed ( const ex self,
const ex other 
) const
inlineoverridevirtual

Add two indexed expressions.

They are guaranteed to be of class indexed (or a subclass) and their indices are compatible. This function is used internally by simplify_indexed().

Parameters
selfFirst indexed expression; its base object is *this
otherSecond indexed expression
Returns
sum of self and other
See also
ex::simplify_indexed()

Reimplemented from GiNaC::basic.

Definition at line 192 of file structure.h.

◆ scalar_mul_indexed()

template<class T , template< class > class ComparisonPolicy>
ex GiNaC::structure< T, ComparisonPolicy >::scalar_mul_indexed ( const ex self,
const numeric other 
) const
inlineoverridevirtual

Multiply an indexed expression with a scalar.

This function is used internally by simplify_indexed().

Parameters
selfIndexed expression; its base object is *this
otherNumeric value
Returns
product of self and other
See also
ex::simplify_indexed()

Reimplemented from GiNaC::basic.

Definition at line 193 of file structure.h.

References GiNaC::basic::ex.

◆ contract_with()

template<class T , template< class > class ComparisonPolicy>
bool GiNaC::structure< T, ComparisonPolicy >::contract_with ( exvector::iterator  self,
exvector::iterator  other,
exvector v 
) const
inlineoverridevirtual

Try to contract two indexed expressions that appear in the same product.

If a contraction exists, the function overwrites one or both of the expressions and returns true. Otherwise it returns false. It is guaranteed that both expressions are of class indexed (or a subclass) and that at least one dummy index has been found. This functions is used internally by simplify_indexed().

Parameters
selfPointer to first indexed expression; its base object is *this
otherPointer to second indexed expression
vThe complete vector of factors
Returns
true if the contraction was successful, false otherwise
See also
ex::simplify_indexed()

Reimplemented from GiNaC::basic.

Definition at line 194 of file structure.h.

◆ return_type()

template<class T , template< class > class ComparisonPolicy>
unsigned GiNaC::structure< T, ComparisonPolicy >::return_type ( ) const
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 197 of file structure.h.

References GiNaC::return_types::commutative.

◆ return_type_tinfo()

template<class T , template< class > class ComparisonPolicy>
return_type_t GiNaC::structure< T, ComparisonPolicy >::return_type_tinfo ( ) const
inlineoverridevirtual

Reimplemented from GiNaC::basic.

Definition at line 198 of file structure.h.

References r.

◆ is_equal_same_type()

template<class T , template< class > class ComparisonPolicy>
bool GiNaC::structure< T, ComparisonPolicy >::is_equal_same_type ( const basic other) const
inlineoverrideprotectedvirtual

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 207 of file structure.h.

References GINAC_ASSERT, and GiNaC::structure< T, ComparisonPolicy >::obj.

◆ calchash()

template<class T , template< class > class ComparisonPolicy>
unsigned GiNaC::structure< T, ComparisonPolicy >::calchash ( ) const
inlineoverrideprotectedvirtual

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 215 of file structure.h.

◆ operator->()

template<class T , template< class > class ComparisonPolicy>
const T * GiNaC::structure< T, ComparisonPolicy >::operator-> ( ) const
inline

Definition at line 220 of file structure.h.

References GiNaC::structure< T, ComparisonPolicy >::obj.

◆ get_struct() [1/2]

template<class T , template< class > class ComparisonPolicy>
T & GiNaC::structure< T, ComparisonPolicy >::get_struct ( )
inline

Definition at line 221 of file structure.h.

References GiNaC::structure< T, ComparisonPolicy >::obj.

◆ get_struct() [2/2]

template<class T , template< class > class ComparisonPolicy>
const T & GiNaC::structure< T, ComparisonPolicy >::get_struct ( ) const
inline

Definition at line 222 of file structure.h.

References GiNaC::structure< T, ComparisonPolicy >::obj.

Member Data Documentation

◆ obj

template<class T , template< class > class ComparisonPolicy>
T GiNaC::structure< T, ComparisonPolicy >::obj
private

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

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