GiNaC  1.8.0
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
GiNaC::ex Class Reference

Lightweight wrapper for GiNaC's symbolic objects. More...

#include <ex.h>

Public Member Functions

 ex () noexcept
 
 ex (const basic &other)
 
 ex (int i)
 
 ex (unsigned int i)
 
 ex (long i)
 
 ex (unsigned long i)
 
 ex (long long i)
 
 ex (unsigned long long i)
 
 ex (double const d)
 
 ex (const std::string &s, const ex &l)
 Construct ex from string and a list of symbols. More...
 
void swap (ex &other) noexcept
 Efficiently swap the contents of two expressions. More...
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_preorder_iterator preorder_begin () const
 
const_preorder_iterator preorder_end () const noexcept
 
const_postorder_iterator postorder_begin () const
 
const_postorder_iterator postorder_end () const noexcept
 
ex eval () const
 
ex evalf () const
 
ex evalm () const
 
ex eval_ncmul (const exvector &v) const
 
ex eval_integ () const
 
void print (const print_context &c, unsigned level=0) const
 Print expression to stream. More...
 
void dbgprint () const
 Little wrapper arount print to be called within a debugger. More...
 
void dbgprinttree () const
 Little wrapper arount printtree to be called within a debugger. More...
 
bool info (unsigned inf) const
 
size_t nops () const
 
ex op (size_t i) const
 
ex operator[] (const ex &index) const
 
ex operator[] (size_t i) const
 
exlet_op (size_t i)
 Return modifiable operand/member at position i. More...
 
exoperator[] (const ex &index)
 
exoperator[] (size_t i)
 
ex lhs () const
 Left hand side of relational expression. More...
 
ex rhs () const
 Right hand side of relational expression. More...
 
ex conjugate () const
 
ex real_part () const
 
ex imag_part () const
 
bool has (const ex &pattern, unsigned options=0) const
 
bool find (const ex &pattern, exset &found) const
 Find all occurrences of a pattern. More...
 
bool match (const ex &pattern) const
 Check whether expression matches a specified pattern. More...
 
bool match (const ex &pattern, exmap &repls) const
 
ex subs (const exmap &m, unsigned options=0) const
 
ex subs (const lst &ls, const lst &lr, unsigned options=0) const
 Substitute objects in an expression (syntactic substitution) and return the result as a new expression. More...
 
ex subs (const ex &e, unsigned options=0) const
 Substitute objects in an expression (syntactic substitution) and return the result as a new expression. More...
 
ex map (map_function &f) const
 
ex map (ex(*f)(const ex &e)) const
 
void accept (visitor &v) const
 
void traverse_preorder (visitor &v) const
 Traverse expression tree with given visitor, preorder traversal. More...
 
void traverse_postorder (visitor &v) const
 Traverse expression tree with given visitor, postorder traversal. More...
 
void traverse (visitor &v) const
 
bool is_polynomial (const ex &vars) const
 Check whether expression is a polynomial. More...
 
int degree (const ex &s) const
 
int ldegree (const ex &s) const
 
ex coeff (const ex &s, int n=1) const
 
ex lcoeff (const ex &s) const
 
ex tcoeff (const ex &s) const
 
ex expand (unsigned options=0) const
 
ex collect (const ex &s, bool distributed=false) const
 
ex diff (const symbol &s, unsigned nth=1) const
 Compute partial derivative of an expression. More...
 
ex series (const ex &r, int order, unsigned options=0) const
 Compute the truncated series expansion of an expression. More...
 
ex normal () const
 Normalization of rational functions. More...
 
ex to_rational (exmap &repl) const
 Rationalization of non-rational functions. More...
 
ex to_polynomial (exmap &repl) const
 
ex numer () const
 Get numerator of an expression. More...
 
ex denom () const
 Get denominator of an expression. More...
 
ex numer_denom () const
 Get numerator and denominator of an expression. More...
 
ex unit (const ex &x) const
 Compute unit part (= sign of leading coefficient) of a multivariate polynomial in Q[x]. More...
 
ex content (const ex &x) const
 Compute content part (= unit normal GCD of all coefficients) of a multivariate polynomial in Q[x]. More...
 
numeric integer_content () const
 Compute the integer content (= GCD of all numeric coefficients) of an expanded polynomial. More...
 
ex primpart (const ex &x) const
 Compute primitive part of a multivariate polynomial in Q[x]. More...
 
ex primpart (const ex &x, const ex &cont) const
 Compute primitive part of a multivariate polynomial in Q[x] when the content part is already known. More...
 
void unitcontprim (const ex &x, ex &u, ex &c, ex &p) const
 Compute unit part, content part, and primitive part of a multivariate polynomial in Q[x]. More...
 
ex smod (const numeric &xi) const
 
numeric max_coefficient () const
 Return maximum (absolute value) coefficient of a polynomial. More...
 
exvector get_free_indices () const
 
ex simplify_indexed (unsigned options=0) const
 Simplify/canonicalize expression containing indexed objects. More...
 
ex simplify_indexed (const scalar_products &sp, unsigned options=0) const
 Simplify/canonicalize expression containing indexed objects. More...
 
int compare (const ex &other) const
 
bool is_equal (const ex &other) const
 
bool is_zero () const
 
bool is_zero_matrix () const
 Check whether expression is zero or zero matrix. More...
 
ex symmetrize () const
 Symmetrize expression over its free indices. More...
 
ex symmetrize (const lst &l) const
 Symmetrize expression over a list of objects (symbols, indices). More...
 
ex antisymmetrize () const
 Antisymmetrize expression over its free indices. More...
 
ex antisymmetrize (const lst &l) const
 Antisymmetrize expression over a list of objects (symbols, indices). More...
 
ex symmetrize_cyclic () const
 Symmetrize expression by cyclic permutation over its free indices. More...
 
ex symmetrize_cyclic (const lst &l) const
 Symmetrize expression by cyclic permutation over a list of objects (symbols, indices). More...
 
unsigned return_type () const
 
return_type_t return_type_tinfo () const
 
unsigned gethash () const
 

Private Member Functions

void makewriteable ()
 Make this ex writable (if more than one ex handle the same basic) by unlinking the object and creating an unshared copy of it. More...
 
void share (const ex &other) const
 Share equal objects between expressions. More...
 

Static Private Member Functions

static ptr< basicconstruct_from_basic (const basic &other)
 Helper function for the ex-from-basic constructor. More...
 
static basicconstruct_from_int (int i)
 
static basicconstruct_from_uint (unsigned int i)
 
static basicconstruct_from_long (long i)
 
static basicconstruct_from_ulong (unsigned long i)
 
static basicconstruct_from_longlong (long long i)
 
static basicconstruct_from_ulonglong (unsigned long long i)
 
static basicconstruct_from_double (double d)
 
static ptr< basicconstruct_from_string_and_lst (const std::string &s, const ex &l)
 

Private Attributes

ptr< basicbp
 pointer to basic object managed by this More...
 

Friends

class archive_node
 
bool are_ex_trivially_equal (const ex &, const ex &)
 Compare two objects of class quickly without doing a deep tree traversal. More...
 
template<class T >
const T & ex_to (const ex &)
 Return a reference to the basic-derived class T object embedded in an expression. More...
 
template<class T >
bool is_a (const ex &)
 Check if ex is a handle to a T, including base classes. More...
 
template<class T >
bool is_exactly_a (const ex &)
 Check if ex is a handle to a T, not including base classes. More...
 

Detailed Description

Lightweight wrapper for GiNaC's symbolic objects.

It holds a pointer to the other object in order to do garbage collection by the method of reference counting. I.e., it is a smart pointer. Also, the constructor ex::ex(const basic & other) calls the methods that do automatic evaluation. E.g., x-x turns automatically into 0.

Definition at line 72 of file ex.h.

Constructor & Destructor Documentation

◆ ex() [1/10]

GiNaC::ex::ex ( )
inlinenoexcept

Definition at line 262 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [2/10]

GiNaC::ex::ex ( const basic other)
inline

Definition at line 268 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [3/10]

GiNaC::ex::ex ( int  i)
inline

Definition at line 274 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [4/10]

GiNaC::ex::ex ( unsigned int  i)
inline

Definition at line 280 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [5/10]

GiNaC::ex::ex ( long  i)
inline

Definition at line 286 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [6/10]

GiNaC::ex::ex ( unsigned long  i)
inline

Definition at line 292 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [7/10]

GiNaC::ex::ex ( long long  i)
inline

Definition at line 298 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [8/10]

GiNaC::ex::ex ( unsigned long long  i)
inline

Definition at line 304 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [9/10]

GiNaC::ex::ex ( double const  d)
inline

Definition at line 310 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

◆ ex() [10/10]

GiNaC::ex::ex ( const std::string &  s,
const ex l 
)
inline

Construct ex from string and a list of symbols.

The input grammar is similar to the GiNaC output format. All symbols and indices to be used in the expression must be specified in a lst in the second argument. Undefined symbols and other parser errors will throw an exception.

Definition at line 316 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

Member Function Documentation

◆ swap()

void GiNaC::ex::swap ( ex other)
inlinenoexcept

Efficiently swap the contents of two expressions.

Definition at line 104 of file ex.h.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

Referenced by GiNaC::ncmul::derivative(), GiNaC::ex_swap::operator()(), GiNaC::swap(), GiNaC::expair::swap(), and std::swap().

◆ begin()

const_iterator GiNaC::ex::begin ( ) const
inlinenoexcept

◆ end()

const_iterator GiNaC::ex::end ( ) const
inlinenoexcept

◆ preorder_begin()

const_preorder_iterator GiNaC::ex::preorder_begin ( ) const
inline

Definition at line 657 of file ex.h.

References nops().

◆ preorder_end()

const_preorder_iterator GiNaC::ex::preorder_end ( ) const
inlinenoexcept

Definition at line 662 of file ex.h.

◆ postorder_begin()

const_postorder_iterator GiNaC::ex::postorder_begin ( ) const
inline

Definition at line 667 of file ex.h.

References nops().

◆ postorder_end()

const_postorder_iterator GiNaC::ex::postorder_end ( ) const
inlinenoexcept

Definition at line 672 of file ex.h.

◆ eval()

ex GiNaC::ex::eval ( ) const
inline

Definition at line 120 of file ex.h.

References bp.

Referenced by GiNaC::eval().

◆ evalf()

ex GiNaC::ex::evalf ( ) const
inline

◆ evalm()

ex GiNaC::ex::evalm ( ) const
inline

◆ eval_ncmul()

ex GiNaC::ex::eval_ncmul ( const exvector v) const
inline

Definition at line 123 of file ex.h.

References bp.

Referenced by GiNaC::integral::eval_ncmul(), and GiNaC::relational::eval_ncmul().

◆ eval_integ()

ex GiNaC::ex::eval_integ ( ) const
inline

Definition at line 124 of file ex.h.

References bp.

Referenced by GiNaC::integral::eval_integ(), GiNaC::pseries::eval_integ(), and GiNaC::eval_integ().

◆ print()

void GiNaC::ex::print ( const print_context c,
unsigned  level = 0 
) const

Print expression to stream.

The formatting of the output is determined by the kind of print_context object that is passed. Possible formattings include ginsh-parsable output (the default), tree-like output for debugging, and C++ source.

See also
print_context

Definition at line 56 of file ex.cpp.

References bp, and c.

Referenced by GiNaC::abs_print_csrc_float(), GiNaC::abs_print_latex(), GiNaC::conjugate_print_latex(), GiNaC::integral::do_print(), GiNaC::multiple_polylog_kernel::do_print(), GiNaC::ELi_kernel::do_print(), GiNaC::Ebar_kernel::do_print(), GiNaC::Kronecker_dtau_kernel::do_print(), GiNaC::Kronecker_dz_kernel::do_print(), GiNaC::Eisenstein_kernel::do_print(), GiNaC::Eisenstein_h_kernel::do_print(), GiNaC::modular_form_kernel::do_print(), GiNaC::user_defined_kernel::do_print(), GiNaC::mul::do_print(), GiNaC::relational::do_print(), GiNaC::add::do_print_csrc(), GiNaC::idx::do_print_csrc(), GiNaC::mul::do_print_csrc(), GiNaC::power::do_print_csrc(), GiNaC::power::do_print_csrc_cl_N(), GiNaC::power::do_print_dflt(), GiNaC::integral::do_print_latex(), GiNaC::power::do_print_latex(), GiNaC::add::do_print_python_repr(), GiNaC::mul::do_print_python_repr(), GiNaC::power::do_print_python_repr(), GiNaC::pseries::do_print_python_repr(), GiNaC::relational::do_print_python_repr(), GiNaC::basic::do_print_tree(), GiNaC::clifford::do_print_tree(), GiNaC::idx::do_print_tree(), GiNaC::varidx::do_print_tree(), GiNaC::spinidx::do_print_tree(), GiNaC::pseries::do_print_tree(), GiNaC::factorial_print_dflt_latex(), GiNaC::H_print_latex(), GiNaC::imag_part_print_latex(), GiNaC::operator<<(), GiNaC::expair::print(), GiNaC::add::print_add(), GiNaC::idx::print_index(), GiNaC::mul::print_overall_coeff(), GiNaC::power::print_power(), GiNaC::pseries::print_series(), GiNaC::print_sym_pow(), GiNaC::real_part_print_latex(), GiNaC::S_print_latex(), and GiNaC::zeta1_print_latex().

◆ dbgprint()

void GiNaC::ex::dbgprint ( ) const

Little wrapper arount print to be called within a debugger.

Definition at line 62 of file ex.cpp.

References bp.

◆ dbgprinttree()

void GiNaC::ex::dbgprinttree ( ) const

Little wrapper arount printtree to be called within a debugger.

Definition at line 68 of file ex.cpp.

References bp.

◆ info()

bool GiNaC::ex::info ( unsigned  inf) const
inline

Definition at line 132 of file ex.h.

References bp.

Referenced by GiNaC::abs_eval(), GiNaC::abs_info(), GiNaC::abs_power(), GiNaC::acos_eval(), GiNaC::acosh_eval(), GiNaC::asin_eval(), GiNaC::asinh_conjugate(), GiNaC::asinh_eval(), GiNaC::atan2_eval(), GiNaC::atan_conjugate(), GiNaC::atan_eval(), GiNaC::atanh_eval(), GiNaC::beta_eval(), GiNaC::beta_series(), GiNaC::mul::can_be_further_expanded(), GiNaC::mul::can_make_flat(), GiNaC::power::conjugate(), GiNaC::pseries::conjugate(), content(), GiNaC::cos_eval(), GiNaC::cosh_eval(), GiNaC::csgn_series(), GiNaC::matrix::determinant(), GiNaC::divide(), GiNaC::divide_in_z(), GiNaC::add::do_print_csrc(), GiNaC::idx::do_print_csrc(), GiNaC::power::do_print_csrc(), GiNaC::eta_eval(), GiNaC::eta_evalf(), GiNaC::eta_series(), GiNaC::power::eval(), GiNaC::exp_eval(), GiNaC::exp_power(), GiNaC::power::expand(), GiNaC::find_common_factor(), GiNaC::func_arg_info(), GiNaC::G2_eval(), GiNaC::G2_evalf(), GiNaC::G3_eval(), GiNaC::G3_evalf(), GiNaC::gcd(), GiNaC::H_eval(), GiNaC::H_evalf(), GiNaC::power::has(), GiNaC::heur_gcd(), GiNaC::idx::idx(), GiNaC::power::imag_part(), GiNaC::pseries::imag_part(), GiNaC::add::info(), GiNaC::mul::info(), GiNaC::power::info(), GiNaC::multiple_polylog_kernel::is_numeric(), GiNaC::ELi_kernel::is_numeric(), GiNaC::Ebar_kernel::is_numeric(), GiNaC::Kronecker_dtau_kernel::is_numeric(), GiNaC::Kronecker_dz_kernel::is_numeric(), GiNaC::Eisenstein_kernel::is_numeric(), GiNaC::Eisenstein_h_kernel::is_numeric(), GiNaC::modular_form_kernel::is_numeric(), GiNaC::user_defined_kernel::is_numeric(), GiNaC::power::is_polynomial(), GiNaC::iterated_integral2_eval(), GiNaC::iterated_integral3_eval(), GiNaC::iterated_integral_evalf_impl(), GiNaC::lcm(), GiNaC::lcmcoeff(), GiNaC::lgamma_conjugate(), GiNaC::lgamma_eval(), GiNaC::lgamma_series(), GiNaC::Li2_conjugate(), GiNaC::Li2_eval(), GiNaC::Li2_series(), GiNaC::Li_eval(), GiNaC::Li_evalf(), GiNaC::Li_series(), GiNaC::log_conjugate(), GiNaC::log_eval(), GiNaC::log_expand(), GiNaC::log_imag_part(), GiNaC::log_real_part(), GiNaC::log_series(), GiNaC::lsolve(), GiNaC::power::normal(), GiNaC::Order_imag_part(), GiNaC::matrix::pow(), GiNaC::prem(), GiNaC::psi1_eval(), GiNaC::psi1_series(), GiNaC::psi2_eval(), GiNaC::psi2_series(), GiNaC::quo(), GiNaC::power::real_part(), GiNaC::pseries::real_part(), GiNaC::rem(), GiNaC::resultant(), GiNaC::S_eval(), GiNaC::S_evalf(), GiNaC::S_series(), GiNaC::mul::series(), GiNaC::power::series(), GiNaC::sin_eval(), GiNaC::sinh_eval(), GiNaC::sprem(), GiNaC::step_series(), subs(), GiNaC::tan_eval(), GiNaC::tanh_eval(), GiNaC::tgamma_eval(), GiNaC::tgamma_series(), GiNaC::expairseq::to_polynomial(), GiNaC::power::to_polynomial(), GiNaC::expairseq::to_rational(), GiNaC::power::to_rational(), GiNaC::matrix::trace(), GiNaC::tryfactsubs(), unitcontprim(), GiNaC::zeta2_deriv(), and GiNaC::zeta2_eval().

◆ nops()

size_t GiNaC::ex::nops ( ) const
inline

◆ op()

ex GiNaC::ex::op ( size_t  i) const
inline

Definition at line 136 of file ex.h.

References bp.

Referenced by GiNaC::abs_eval(), GiNaC::matrix::add_indexed(), GiNaC::algebraic_match_mul_with_mul(), GiNaC::ncmul::append_factors(), GiNaC::atan_series(), GiNaC::atanh_series(), GiNaC::mul::can_be_further_expanded(), GiNaC::basic::collect(), GiNaC::collect_symbols(), GiNaC::color_trace(), GiNaC::su3f::contract_with(), GiNaC::su3d::contract_with(), GiNaC::matrix::contract_with(), GiNaC::cos_eval(), GiNaC::cosh_eval(), GiNaC::ncmul::count_factors(), GiNaC::csgn_eval(), GiNaC::decomp_rational(), denom(), GiNaC::const_postorder_iterator::descend(), GiNaC::divide(), GiNaC::divide_in_z(), GiNaC::epsilon_tensor(), GiNaC::indexed::eval(), GiNaC::power::eval(), GiNaC::integral::eval_integ(), GiNaC::exp_eval(), GiNaC::indexed::expand(), GiNaC::integral::expand(), GiNaC::mul::expand(), find(), GiNaC::find_common_factor(), GiNaC::matrix::fraction_free_elimination(), GiNaC::G2_eval(), GiNaC::G2_evalf(), GiNaC::G3_eval(), GiNaC::G3_evalf(), GiNaC::gcd_pf_mul(), GiNaC::gcd_pf_pow(), GiNaC::gcd_pf_pow_pow(), GiNaC::get_all_dummy_indices_safely(), GiNaC::get_first_symbol(), GiNaC::clifford::get_metric(), GiNaC::H_evalf(), GiNaC::power::has(), GiNaC::hasindex(), GiNaC::haswild(), GiNaC::const_preorder_iterator::increment(), GiNaC::lcmcoeff(), GiNaC::Li2_series(), GiNaC::Li_deriv(), GiNaC::Li_evalf(), GiNaC::log_eval(), GiNaC::lorentz_eps(), GiNaC::lsolve(), GiNaC::basic::match(), GiNaC::multiply_lcm(), normal(), GiNaC::basic::normal(), GiNaC::power::normal(), numer(), GiNaC::op(), GiNaC::op0_is_equal::operator()(), GiNaC::ex_base_is_less::operator()(), GiNaC::const_iterator::operator*(), GiNaC::const_iterator::operator[](), GiNaC::product_to_exvector(), GiNaC::replace_with_symbol(), GiNaC::reposition_dummy_indices(), GiNaC::clifford::same_metric(), GiNaC::matrix::scalar_mul_indexed(), GiNaC::simplify_indexed(), GiNaC::sin_eval(), GiNaC::sinh_eval(), GiNaC::spmapkey::spmapkey(), GiNaC::sqrfree_parfrac(), GiNaC::step_eval(), subs(), GiNaC::symminfo::symminfo(), GiNaC::tan_eval(), GiNaC::tanh_eval(), traverse_postorder(), traverse_preorder(), GiNaC::tryfactsubs(), and GiNaC::zeta2_deriv().

◆ operator[]() [1/4]

ex GiNaC::ex::operator[] ( const ex index) const
inline

Definition at line 137 of file ex.h.

References bp.

◆ operator[]() [2/4]

ex GiNaC::ex::operator[] ( size_t  i) const
inline

Definition at line 138 of file ex.h.

References bp.

◆ let_op()

ex & GiNaC::ex::let_op ( size_t  i)

Return modifiable operand/member at position i.

Definition at line 206 of file ex.cpp.

References bp, and makewriteable().

◆ operator[]() [3/4]

ex & GiNaC::ex::operator[] ( const ex index)

Definition at line 212 of file ex.cpp.

References bp, and makewriteable().

◆ operator[]() [4/4]

ex & GiNaC::ex::operator[] ( size_t  i)

Definition at line 218 of file ex.cpp.

References bp, and makewriteable().

◆ lhs()

ex GiNaC::ex::lhs ( ) const

Left hand side of relational expression.

Definition at line 225 of file ex.cpp.

References bp.

Referenced by GiNaC::fsolve(), GiNaC::lhs(), GiNaC::pseries::pseries(), and GiNaC::Eisenstein_h_kernel::series().

◆ rhs()

ex GiNaC::ex::rhs ( ) const

Right hand side of relational expression.

Definition at line 233 of file ex.cpp.

References bp.

Referenced by GiNaC::fsolve(), GiNaC::pseries::pseries(), GiNaC::rhs(), and GiNaC::Eisenstein_h_kernel::series().

◆ conjugate()

ex GiNaC::ex::conjugate ( ) const
inline

◆ real_part()

ex GiNaC::ex::real_part ( ) const
inline

◆ imag_part()

ex GiNaC::ex::imag_part ( ) const
inline

◆ has()

bool GiNaC::ex::has ( const ex pattern,
unsigned  options = 0 
) const
inline

◆ find()

bool GiNaC::ex::find ( const ex pattern,
exset found 
) const

Find all occurrences of a pattern.

The found matches are appended to the "found" list. If the expression itself matches the pattern, the children are not further examined. This function returns true when any matches were found.

Definition at line 105 of file ex.cpp.

References find(), match(), nops(), and op().

Referenced by GiNaC::divide_in_z(), find(), GiNaC::find(), GiNaC::pseries::mul_series(), and GiNaC::replace_with_symbol().

◆ match() [1/2]

bool GiNaC::ex::match ( const ex pattern) const

Check whether expression matches a specified pattern.

Definition at line 95 of file ex.cpp.

References bp.

Referenced by find(), GiNaC::power::has(), GiNaC::basic::match(), GiNaC::match(), and GiNaC::tryfactsubs().

◆ match() [2/2]

bool GiNaC::ex::match ( const ex pattern,
exmap repls 
) const
inline

Definition at line 154 of file ex.h.

References bp.

◆ subs() [1/3]

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

Definition at line 826 of file ex.h.

References bp, m, and options.

Referenced by GiNaC::adaptivesimpson(), GiNaC::mul::algebraic_subs_mul(), GiNaC::atan_series(), GiNaC::atanh_series(), GiNaC::beta_series(), GiNaC::collect_common_factors(), GiNaC::integral::conjugate(), GiNaC::csgn_series(), denom(), GiNaC::integral::derivative(), GiNaC::divide_in_z(), GiNaC::EllipticE_series(), GiNaC::EllipticK_series(), GiNaC::eta_series(), GiNaC::tensdelta::eval_indexed(), GiNaC::integral::eval_integ(), GiNaC::integral::evalf(), GiNaC::expand_dummy_sum(), GiNaC::fsolve(), GiNaC::gcd(), GiNaC::clifford::get_metric(), GiNaC::H_evalf(), GiNaC::heur_gcd_z(), GiNaC::modular_form_kernel::is_numeric(), GiNaC::user_defined_kernel::is_numeric(), GiNaC::user_defined_kernel::Laurent_series(), GiNaC::lgamma_series(), GiNaC::Li2_series(), GiNaC::Li_series(), GiNaC::log_series(), normal(), GiNaC::power::normal(), numer(), numer_denom(), GiNaC::psi1_series(), GiNaC::psi2_series(), GiNaC::rename_dummy_indices(), GiNaC::rename_dummy_indices_uniquely(), GiNaC::tensor::replace_contr_index(), GiNaC::replace_with_symbol(), GiNaC::reposition_dummy_indices(), GiNaC::S_series(), GiNaC::basic::series(), GiNaC::integral::series(), GiNaC::power::series(), GiNaC::step_series(), GiNaC::subs(), GiNaC::basic::subs(), GiNaC::clifford::subs(), GiNaC::idx::subs(), GiNaC::power::subs(), GiNaC::pseries::subs(), GiNaC::relational::subs(), GiNaC::basic::subs_one_level(), GiNaC::container< C >::subschildren(), GiNaC::subsvalue(), GiNaC::symm(), GiNaC::symmetrize_cyclic(), GiNaC::tan_series(), GiNaC::tanh_series(), and GiNaC::tgamma_series().

◆ subs() [2/3]

ex GiNaC::ex::subs ( const lst ls,
const lst lr,
unsigned  options = 0 
) const

Substitute objects in an expression (syntactic substitution) and return the result as a new expression.

Definition at line 120 of file ex.cpp.

References GiNaC::container< C >::begin(), bp, GiNaC::container< C >::end(), GINAC_ASSERT, lr, m, GiNaC::container< C >::nops(), options, GiNaC::subs_options::pattern_is_not_product, and GiNaC::subs_options::pattern_is_product.

◆ subs() [3/3]

ex GiNaC::ex::subs ( const ex e,
unsigned  options = 0 
) const

Substitute objects in an expression (syntactic substitution) and return the result as a new expression.

There are two valid types of replacement arguments: 1) a relational like object==ex and 2) a list of relationals lst{object1==ex1,object2==ex2,...}.

Definition at line 144 of file ex.cpp.

References bp, GINAC_ASSERT, info(), GiNaC::info_flags::list, m, op(), options, GiNaC::subs_options::pattern_is_not_product, GiNaC::subs_options::pattern_is_product, r, and GiNaC::info_flags::relation_equal.

◆ map() [1/2]

ex GiNaC::ex::map ( map_function f) const
inline

Definition at line 162 of file ex.h.

References bp.

Referenced by GiNaC::color_trace(), and GiNaC::expand_dummy_sum().

◆ map() [2/2]

ex GiNaC::ex::map ( ex(*)(const ex &e)  f) const

◆ accept()

void GiNaC::ex::accept ( visitor v) const
inline

Definition at line 166 of file ex.h.

References bp.

Referenced by traverse_postorder(), and traverse_preorder().

◆ traverse_preorder()

void GiNaC::ex::traverse_preorder ( visitor v) const

Traverse expression tree with given visitor, preorder traversal.

Definition at line 186 of file ex.cpp.

References accept(), n, nops(), op(), and traverse_preorder().

Referenced by traverse(), and traverse_preorder().

◆ traverse_postorder()

void GiNaC::ex::traverse_postorder ( visitor v) const

Traverse expression tree with given visitor, postorder traversal.

Definition at line 196 of file ex.cpp.

References accept(), n, nops(), op(), and traverse_postorder().

Referenced by traverse_postorder().

◆ traverse()

void GiNaC::ex::traverse ( visitor v) const
inline

Definition at line 169 of file ex.h.

References traverse_preorder().

◆ is_polynomial()

bool GiNaC::ex::is_polynomial ( const ex vars) const

Check whether expression is a polynomial.

Definition at line 241 of file ex.cpp.

References bp.

Referenced by GiNaC::is_polynomial(), and GiNaC::power::is_polynomial().

◆ degree()

int GiNaC::ex::degree ( const ex s) const
inline

◆ ldegree()

int GiNaC::ex::ldegree ( const ex s) const
inline

◆ coeff()

ex GiNaC::ex::coeff ( const ex s,
int  n = 1 
) const
inline

◆ lcoeff()

ex GiNaC::ex::lcoeff ( const ex s) const
inline

Definition at line 176 of file ex.h.

References coeff(), and degree().

Referenced by content(), GiNaC::get_symbol_stats(), and unit().

◆ tcoeff()

ex GiNaC::ex::tcoeff ( const ex s) const
inline

Definition at line 177 of file ex.h.

References coeff(), and ldegree().

◆ expand()

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

◆ collect()

ex GiNaC::ex::collect ( const ex s,
bool  distributed = false 
) const
inline

Definition at line 181 of file ex.h.

References bp.

Referenced by GiNaC::matrix::charpoly(), and GiNaC::collect().

◆ diff()

ex GiNaC::ex::diff ( const symbol s,
unsigned  nth = 1 
) const

Compute partial derivative of an expression.

Parameters
ssymbol by which the expression is derived
nthorder of derivative (default 1)
Returns
partial derivative as a new expression

Definition at line 86 of file ex.cpp.

References bp.

Referenced by GiNaC::abs_expl_derivative(), GiNaC::conjugate_expl_derivative(), GiNaC::integral::derivative(), GiNaC::power::derivative(), GiNaC::diff(), GiNaC::basic::diff(), GiNaC::fsolve(), GiNaC::imag_part_expl_derivative(), GiNaC::log_series(), GiNaC::Order_expl_derivative(), GiNaC::real_part_expl_derivative(), GiNaC::basic::series(), and GiNaC::sqrfree_yun().

◆ series()

ex GiNaC::ex::series ( const ex r,
int  order,
unsigned  options = 0 
) const

Compute the truncated series expansion of an expression.

This function returns an expression containing an object of class pseries to represent the series. If the series does not terminate within the given truncation order, the last term of the series will be an order term.

Parameters
rexpansion relation, lhs holds variable and rhs holds point
ordertruncation order of series calculations
optionsof class series_options
Returns
an expression holding a pseries object

Definition at line 1259 of file pseries.cpp.

References GiNaC::_ex0, bp, options, order, and r.

Referenced by GiNaC::Bernoulli_polynomial(), GiNaC::EllipticE_series(), GiNaC::EllipticK_series(), GiNaC::generalised_Bernoulli_number(), GiNaC::modular_form_kernel::is_numeric(), GiNaC::modular_form_kernel::Laurent_series(), GiNaC::integration_kernel::Laurent_series(), GiNaC::Eisenstein_kernel::Laurent_series(), GiNaC::Eisenstein_h_kernel::Laurent_series(), GiNaC::user_defined_kernel::Laurent_series(), GiNaC::Li2_series(), GiNaC::Li_series(), GiNaC::log_series(), GiNaC::Eisenstein_h_kernel::q_expansion_modular_form(), GiNaC::S_series(), GiNaC::series(), GiNaC::add::series(), GiNaC::integral::series(), GiNaC::Eisenstein_kernel::series(), GiNaC::Eisenstein_h_kernel::series(), GiNaC::pseries::series(), GiNaC::mul::series(), GiNaC::power::series(), and GiNaC::tgamma_series().

◆ normal()

ex GiNaC::ex::normal ( ) const

Normalization of rational functions.

This function converts an expression to its normal form "numerator/denominator", where numerator and denominator are (relatively prime) polynomials. Any subexpressions which are not rational functions (like non-rational numbers, non-integer powers or functions like sin(), cos() etc.) are replaced by temporary symbols which are re-substituted by the (normalized) subexpressions before normal() returns (this way, any expression can be treated as a rational function). normal() is applied recursively to arguments of functions etc.

Returns
normalized expression

Definition at line 2489 of file normal.cpp.

References bp, GINAC_ASSERT, GiNaC::subs_options::no_pattern, GiNaC::container< C >::nops(), op(), GiNaC::container< C >::op(), and subs().

Referenced by GiNaC::matrix::determinant(), GiNaC::matrix::fraction_free_elimination(), GiNaC::matrix::gauss_elimination(), GiNaC::normal(), GiNaC::power::normal(), GiNaC::pseries::normal(), and GiNaC::matrix::trace().

◆ to_rational()

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

Rationalization of non-rational functions.

This function converts a general expression to a rational function by replacing all non-rational subexpressions (like non-rational numbers, non-integer powers or functions like sin(), cos() etc.) to temporary symbols. This makes it possible to use functions like gcd() and divide() on non-rational functions by applying to_rational() on the arguments, calling the desired function and re-substituting the temporary symbols in the result. To make the last step possible, all temporary symbols and their associated expressions are collected in the map specified by the repl parameter, ready to be passed as an argument to ex::subs().

Parameters
replcollects all temporary symbols and their replacements
Returns
rationalized expression

Definition at line 2597 of file normal.cpp.

References bp.

Referenced by GiNaC::matrix::fraction_free_elimination(), GiNaC::power::to_polynomial(), GiNaC::to_rational(), GiNaC::expairseq::to_rational(), and GiNaC::power::to_rational().

◆ to_polynomial()

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

◆ numer()

ex GiNaC::ex::numer ( ) const

Get numerator of an expression.

If the expression is not of the normal form "numerator/denominator", it is first converted to this form and then the numerator is returned.

See also
ex::normal
Returns
numerator

Definition at line 2514 of file normal.cpp.

References bp, GINAC_ASSERT, GiNaC::subs_options::no_pattern, GiNaC::container< C >::nops(), op(), GiNaC::container< C >::op(), and subs().

Referenced by GiNaC::numer().

◆ denom()

ex GiNaC::ex::denom ( ) const

Get denominator of an expression.

If the expression is not of the normal form "numerator/denominator", it is first converted to this form and then the denominator is returned.

See also
ex::normal
Returns
denominator

Definition at line 2539 of file normal.cpp.

References bp, GINAC_ASSERT, GiNaC::subs_options::no_pattern, GiNaC::container< C >::nops(), op(), GiNaC::container< C >::op(), and subs().

Referenced by GiNaC::denom().

◆ numer_denom()

ex GiNaC::ex::numer_denom ( ) const

Get numerator and denominator of an expression.

If the expression is not of the normal form "numerator/denominator", it is first converted to this form and then a list [numerator, denominator] is returned.

See also
ex::normal
Returns
a list [numerator, denominator]

Definition at line 2564 of file normal.cpp.

References bp, GINAC_ASSERT, GiNaC::subs_options::no_pattern, GiNaC::container< C >::nops(), GiNaC::container< C >::op(), and subs().

Referenced by GiNaC::matrix::fraction_free_elimination(), and GiNaC::numer_denom().

◆ unit()

ex GiNaC::ex::unit ( const ex x) const

Compute unit part (= sign of leading coefficient) of a multivariate polynomial in Q[x].

The product of unit part, content part, and primitive part is the polynomial itself.

Parameters
xmain variable
Returns
unit part
See also
ex::content, ex::primpart, ex::unitcontprim

Definition at line 923 of file normal.cpp.

References GiNaC::_ex1, GiNaC::_ex_1, c, expand(), GiNaC::get_first_symbol(), lcoeff(), GiNaC::info_flags::negative, and x.

Referenced by content(), GiNaC::frac_cancel(), primpart(), and unitcontprim().

◆ content()

ex GiNaC::ex::content ( const ex x) const

Compute content part (= unit normal GCD of all coefficients) of a multivariate polynomial in Q[x].

The product of unit part, content part, and primitive part is the polynomial itself.

Parameters
xmain variable
Returns
content part
See also
ex::unit, ex::primpart, ex::unitcontprim

Definition at line 945 of file normal.cpp.

References GiNaC::_ex0, c, expand(), GiNaC::gcd(), info(), GiNaC::info_flags::integer, integer_content(), is_zero(), lcoeff(), GiNaC::info_flags::negative, r, unit(), and x.

Referenced by GiNaC::sr_gcd(), and unitcontprim().

◆ integer_content()

numeric GiNaC::ex::integer_content ( ) const

Compute the integer content (= GCD of all numeric coefficients) of an expanded polynomial.

For a polynomial with rational coefficients, this returns g/l where g is the GCD of the coefficients' numerators and l is the LCM of the coefficients' denominators.

Returns
integer content

Definition at line 318 of file normal.cpp.

References bp.

Referenced by content(), GiNaC::power::eval(), GiNaC::gcd(), and GiNaC::heur_gcd_z().

◆ primpart() [1/2]

ex GiNaC::ex::primpart ( const ex x) const

Compute primitive part of a multivariate polynomial in Q[x].

The result will be a unit-normal polynomial with a content part of 1. The product of unit part, content part, and primitive part is the polynomial itself.

Parameters
xmain variable
Returns
primitive part
See also
ex::unit, ex::content, ex::unitcontprim

Definition at line 981 of file normal.cpp.

References c, unitcontprim(), and x.

Referenced by GiNaC::sr_gcd().

◆ primpart() [2/2]

ex GiNaC::ex::primpart ( const ex x,
const ex c 
) const

Compute primitive part of a multivariate polynomial in Q[x] when the content part is already known.

This function is faster in computing the primitive part than the previous function.

Parameters
xmain variable
cpreviously computed content part
Returns
primitive part

Definition at line 997 of file normal.cpp.

References GiNaC::_ex0, GiNaC::_ex1, c, is_zero(), GiNaC::quo(), unit(), and x.

◆ unitcontprim()

void GiNaC::ex::unitcontprim ( const ex x,
ex u,
ex c,
ex p 
) const

Compute unit part, content part, and primitive part of a multivariate polynomial in Q[x].

The product of the three parts is the polynomial itself.

Parameters
xmain variable
uunit part (returned)
ccontent part (returned)
pprimitive part (returned)
See also
ex::unit, ex::content, ex::primpart

Definition at line 1022 of file normal.cpp.

References GiNaC::_ex0, GiNaC::_ex1, GiNaC::_ex_1, GiNaC::abs(), c, content(), expand(), info(), is_zero(), GiNaC::info_flags::negative, GiNaC::quo(), unit(), and x.

Referenced by GiNaC::gcd(), and primpart().

◆ smod()

ex GiNaC::ex::smod ( const numeric xi) const
inline

Definition at line 202 of file ex.h.

References bp.

Referenced by GiNaC::interpolate().

◆ max_coefficient()

numeric GiNaC::ex::max_coefficient ( ) const

Return maximum (absolute value) coefficient of a polynomial.

This function is used internally by heur_gcd().

Returns
maximum coefficient
See also
heur_gcd

Definition at line 1154 of file normal.cpp.

References bp.

Referenced by GiNaC::heur_gcd_z().

◆ get_free_indices()

exvector GiNaC::ex::get_free_indices ( ) const
inline

◆ simplify_indexed() [1/2]

ex GiNaC::ex::simplify_indexed ( unsigned  options = 0) const

Simplify/canonicalize expression containing indexed objects.

This performs contraction of dummy indices where possible and checks whether the free indices in sums are consistent.

Parameters
optionsSimplification options (currently unused)
Returns
simplified expression

Definition at line 1256 of file indexed.cpp.

References GiNaC::simplify_indexed().

Referenced by GiNaC::tensepsilon::contract_with(), and GiNaC::simplify_indexed().

◆ simplify_indexed() [2/2]

ex GiNaC::ex::simplify_indexed ( const scalar_products sp,
unsigned  options = 0 
) const

Simplify/canonicalize expression containing indexed objects.

This performs contraction of dummy indices where possible, checks whether the free indices in sums are consistent, and automatically replaces scalar products by known values if desired.

Parameters
spScalar products to be replaced automatically
optionsSimplification options (currently unused)
Returns
simplified expression

Definition at line 1271 of file indexed.cpp.

References GiNaC::simplify_indexed().

◆ compare()

int GiNaC::ex::compare ( const ex other) const
inline

◆ is_equal()

bool GiNaC::ex::is_equal ( const ex other) const
inline

Definition at line 345 of file ex.h.

References bp, and share().

Referenced by GiNaC::abs_power(), GiNaC::acos_eval(), GiNaC::acosh_eval(), GiNaC::asin_eval(), GiNaC::atan2_eval(), GiNaC::atan_eval(), GiNaC::atanh_eval(), GiNaC::atanh_series(), GiNaC::beta_eval(), GiNaC::power::coeff(), GiNaC::pseries::coeff(), GiNaC::add::combine_ex_with_coeff_to_pair(), GiNaC::mul::combine_pair_with_coeff_to_pair(), GiNaC::power::degree(), GiNaC::pseries::degree(), GiNaC::divide(), GiNaC::divide_in_z(), GiNaC::mul::do_print_csrc(), GiNaC::power::do_print_csrc(), GiNaC::power::do_print_csrc_cl_N(), GiNaC::power::do_print_dflt(), GiNaC::power::do_print_latex(), GiNaC::epsilon_tensor(), GiNaC::mul::eval(), GiNaC::power::eval(), GiNaC::matrix::eval_indexed(), GiNaC::tensdelta::eval_indexed(), GiNaC::tensmetric::eval_indexed(), GiNaC::mul::expand(), GiNaC::find_common_factor(), GiNaC::frac_cancel(), GiNaC::gcd(), GiNaC::gcd_pf_pow(), GiNaC::gcd_pf_pow_pow(), GiNaC::make_flat_inserter::handle_factor(), GiNaC::power::imag_part(), GiNaC::mul::info(), GiNaC::expair::is_canonical_numeric(), GiNaC::pseries::is_compatible_to(), GiNaC::idx::is_dummy_pair_same_type(), GiNaC::expair::is_equal(), is_zero(), GiNaC::power::ldegree(), GiNaC::pseries::ldegree(), GiNaC::Li2_eval(), GiNaC::Li2_series(), GiNaC::Li_eval(), GiNaC::log_eval(), GiNaC::lorentz_eps(), GiNaC::idx::match_same_type(), GiNaC::minimal_dim(), GiNaC::pseries::mul_series(), GiNaC::multiply_lcm(), GiNaC::power::normal(), GiNaC::ex_is_equal::operator()(), GiNaC::op0_is_equal::operator()(), GiNaC::idx_is_equal_ignore_dim::operator()(), GiNaC::spmapkey::operator==(), GiNaC::add::print_add(), GiNaC::mul::print_overall_coeff(), GiNaC::product_to_exvector(), GiNaC::quo(), GiNaC::power::real_part(), GiNaC::mul::recombine_pair_to_ex(), GiNaC::rem(), GiNaC::replace_with_symbol(), GiNaC::clifford::same_metric(), GiNaC::pseries::series(), GiNaC::power::series(), GiNaC::simplify_indexed(), GiNaC::add::split_ex_to_pair(), and GiNaC::sqrfree_yun().

◆ is_zero()

bool GiNaC::ex::is_zero ( ) const
inline

Definition at line 213 of file ex.h.

References GiNaC::_ex0, and is_equal().

Referenced by GiNaC::acos_conjugate(), GiNaC::acos_eval(), GiNaC::acosh_conjugate(), GiNaC::acosh_eval(), GiNaC::pseries::add_series(), GiNaC::asin_conjugate(), GiNaC::asin_eval(), GiNaC::asinh_eval(), GiNaC::atan(), GiNaC::atan2_eval(), GiNaC::atan_eval(), GiNaC::atanh_conjugate(), GiNaC::atanh_eval(), GiNaC::add::coeff(), content(), GiNaC::cosh_eval(), GiNaC::add::degree(), GiNaC::fderivative::derivative(), GiNaC::function::derivative(), GiNaC::matrix::determinant(), GiNaC::matrix::determinant_minor(), GiNaC::basic::diff(), GiNaC::divide(), GiNaC::divide_in_z(), GiNaC::add::do_print_csrc(), GiNaC::add::eval(), GiNaC::function::eval(), GiNaC::indexed::eval(), GiNaC::mul::eval(), GiNaC::power::eval(), GiNaC::pseries::evalm(), GiNaC::exp_eval(), GiNaC::mul::expand(), GiNaC::pseries::expand(), GiNaC::power::expand_add(), GiNaC::power::expand_add_2(), GiNaC::find_common_factor(), GiNaC::mul::find_real_imag(), GiNaC::frac_cancel(), GiNaC::gcd(), GiNaC::heur_gcd_z(), GiNaC::add::imag_part(), GiNaC::add::info(), GiNaC::interpolate(), GiNaC::is_zero(), is_zero_matrix(), GiNaC::add::ldegree(), GiNaC::lgamma_conjugate(), GiNaC::Li2_conjugate(), GiNaC::Li2_eval(), GiNaC::Li2_series(), GiNaC::Li3_eval(), GiNaC::Li_series(), GiNaC::log(), GiNaC::log_conjugate(), GiNaC::log_eval(), GiNaC::log_series(), GiNaC::matrix::markowitz_elimination(), GiNaC::pseries::mul_series(), GiNaC::pseries::normal(), GiNaC::Order_eval(), GiNaC::prem(), primpart(), GiNaC::add::print_add(), GiNaC::pseries::print_series(), GiNaC::quo(), GiNaC::add::real_part(), GiNaC::rem(), GiNaC::S_series(), GiNaC::clifford::same_metric(), GiNaC::basic::series(), GiNaC::power::series(), GiNaC::symbol::series(), GiNaC::simplify_indexed(), GiNaC::simplify_indexed_product(), GiNaC::sinh_eval(), GiNaC::add::smod(), GiNaC::sprem(), GiNaC::sqrfree_yun(), GiNaC::tanh_eval(), unitcontprim(), and GiNaC::indexed::validate().

◆ is_zero_matrix()

bool GiNaC::ex::is_zero_matrix ( ) const

Check whether expression is zero or zero matrix.

Definition at line 255 of file ex.cpp.

References evalm(), and is_zero().

◆ symmetrize() [1/2]

ex GiNaC::ex::symmetrize ( ) const

Symmetrize expression over its free indices.

Definition at line 1278 of file indexed.cpp.

References get_free_indices(), and GiNaC::symmetrize().

Referenced by GiNaC::symmetrize().

◆ symmetrize() [2/2]

ex GiNaC::ex::symmetrize ( const lst l) const

Symmetrize expression over a list of objects (symbols, indices).

Definition at line 557 of file symmetry.cpp.

References GiNaC::container< C >::begin(), GiNaC::container< C >::end(), and GiNaC::symm().

◆ antisymmetrize() [1/2]

ex GiNaC::ex::antisymmetrize ( ) const

Antisymmetrize expression over its free indices.

Definition at line 1284 of file indexed.cpp.

References GiNaC::antisymmetrize(), and get_free_indices().

Referenced by GiNaC::antisymmetrize().

◆ antisymmetrize() [2/2]

ex GiNaC::ex::antisymmetrize ( const lst l) const

Antisymmetrize expression over a list of objects (symbols, indices).

Definition at line 564 of file symmetry.cpp.

References GiNaC::container< C >::begin(), GiNaC::container< C >::end(), and GiNaC::symm().

◆ symmetrize_cyclic() [1/2]

ex GiNaC::ex::symmetrize_cyclic ( ) const

Symmetrize expression by cyclic permutation over its free indices.

Definition at line 1290 of file indexed.cpp.

References get_free_indices(), and GiNaC::symmetrize_cyclic().

Referenced by GiNaC::symmetrize_cyclic().

◆ symmetrize_cyclic() [2/2]

ex GiNaC::ex::symmetrize_cyclic ( const lst l) const

Symmetrize expression by cyclic permutation over a list of objects (symbols, indices).

Definition at line 572 of file symmetry.cpp.

References GiNaC::container< C >::begin(), GiNaC::container< C >::end(), and GiNaC::symmetrize_cyclic().

◆ return_type()

unsigned GiNaC::ex::return_type ( ) const
inline

◆ return_type_tinfo()

return_type_t GiNaC::ex::return_type_tinfo ( ) const
inline

◆ gethash()

unsigned GiNaC::ex::gethash ( ) const
inline

◆ construct_from_basic()

ptr< basic > GiNaC::ex::construct_from_basic ( const basic other)
staticprivate

Helper function for the ex-from-basic constructor.

This is where GiNaC's automatic evaluator and memory management are implemented.

See also
ex::ex(const basic &)

Definition at line 292 of file ex.cpp.

References bp, GiNaC::basic::duplicate(), GiNaC::status_flags::dynallocated, GiNaC::basic::eval(), GiNaC::status_flags::evaluated, GiNaC::basic::flags, GiNaC::refcounted::get_refcount(), and GINAC_ASSERT.

◆ construct_from_int()

basic & GiNaC::ex::construct_from_int ( int  i)
staticprivate

◆ construct_from_uint()

basic & GiNaC::ex::construct_from_uint ( unsigned int  i)
staticprivate

◆ construct_from_long()

basic & GiNaC::ex::construct_from_long ( long  i)
staticprivate

◆ construct_from_ulong()

basic & GiNaC::ex::construct_from_ulong ( unsigned long  i)
staticprivate

◆ construct_from_longlong()

basic & GiNaC::ex::construct_from_longlong ( long long  i)
staticprivate

Definition at line 534 of file ex.cpp.

References construct_from_int().

◆ construct_from_ulonglong()

basic & GiNaC::ex::construct_from_ulonglong ( unsigned long long  i)
staticprivate

Definition at line 543 of file ex.cpp.

References construct_from_uint().

◆ construct_from_double()

basic & GiNaC::ex::construct_from_double ( double  d)
staticprivate

Definition at line 552 of file ex.cpp.

◆ construct_from_string_and_lst()

static ptr<basic> GiNaC::ex::construct_from_string_and_lst ( const std::string &  s,
const ex l 
)
staticprivate

◆ makewriteable()

void GiNaC::ex::makewriteable ( )
private

Make this ex writable (if more than one ex handle the same basic) by unlinking the object and creating an unshared copy of it.

Definition at line 269 of file ex.cpp.

References bp, GiNaC::status_flags::dynallocated, and GINAC_ASSERT.

Referenced by let_op(), and operator[]().

◆ share()

void GiNaC::ex::share ( const ex other) const
private

Share equal objects between expressions.

See also
ex::compare(const ex &)

Definition at line 278 of file ex.cpp.

References bp, and GiNaC::status_flags::not_shareable.

Referenced by compare(), and is_equal().

Friends And Related Function Documentation

◆ archive_node

friend class archive_node
friend

Definition at line 73 of file ex.h.

◆ are_ex_trivially_equal

bool are_ex_trivially_equal ( const ex e1,
const ex e2 
)
friend

Compare two objects of class quickly without doing a deep tree traversal.

Returns
"true" if they are equal "false" if equality cannot be established quickly (e1 and e2 may still be equal, in this case.

Definition at line 684 of file ex.h.

◆ ex_to

template<class T >
const T& ex_to ( const ex e)
friend

Return a reference to the basic-derived class T object embedded in an expression.

This is fast but unsafe: the result is undefined if the expression does not contain a T object at its top level. Hence, you should generally check the type of e first. Also, you shouldn't cache the returned reference because GiNaC's garbage collector may destroy the referenced object any time it's used in another expression.

Parameters
eexpression
Returns
reference to object of class T
See also
is_exactly_a<class T>()

Definition at line 962 of file ex.h.

◆ is_a

template<class T >
bool is_a ( const ex obj)
friend

Check if ex is a handle to a T, including base classes.

Definition at line 939 of file ex.h.

◆ is_exactly_a

template<class T >
bool is_exactly_a ( const ex obj)
friend

Check if ex is a handle to a T, not including base classes.

Definition at line 946 of file ex.h.

Member Data Documentation

◆ bp

ptr<basic> GiNaC::ex::bp
mutableprivate

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.