54 bool info(
unsigned inf)
const override;
55 size_t nops()
const override;
56 ex op(
size_t i)
const override;
59 int degree(
const ex & s)
const override;
61 ex coeff(
const ex & s,
int n = 1)
const override;
67 bool has(
const ex & other,
unsigned options = 0)
const override;
90 void print_power(
const print_context &
c,
const char *powersymbol,
const char *openbrace,
const char *closebrace,
unsigned level)
const;
118 return dynallocate<power>(b, e);
120template<
typename T1,
typename T2>
121inline ex pow(
const T1 & b,
const T2 & e)
123 return dynallocate<power>(
ex(b),
ex(e));
Archiving of GiNaC expressions.
Interface to GiNaC's ABC.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Wrapper template for making GiNaC classes out of STL containers.
Lightweight wrapper for GiNaC's symbolic objects.
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
This class holds a two-component object, a basis and and exponent representing exponentiation.
static ex expand_mul(const mul &m, const numeric &n, unsigned options, bool from_expand=false)
Expand factors of m in m^n where m is a mul and n is an integer.
void do_print_dflt(const print_dflt &c, unsigned level) const
ex normal(exmap &repl, exmap &rev_lookup, lst &modifier) const override
Implementation of ex::normal() for powers.
void do_print_csrc(const print_csrc &c, unsigned level) const
static ex expand_add(const add &a, long n, unsigned options)
expand a^n where a is an add and n is a positive integer.
int degree(const ex &s) const override
Return degree of highest power in object s.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
ex subs(const exmap &m, unsigned options=0) const override
Substitute a set of objects by arbitrary expressions.
int ldegree(const ex &s) const override
Return degree of lowest power in object s.
static ex expand_add_2(const add &a, unsigned options)
Special case of power::expand_add.
ex real_part() const override
void archive(archive_node &n) const override
Save (a.k.a.
ex derivative(const symbol &s) const override
Implementation of ex::diff() for a power.
ex map(map_function &f) const override
Construct new expression by applying the specified function to all sub-expressions (one level only,...
ex eval() const override
Perform automatic term rewriting rules in this class.
void do_print_python(const print_python &c, unsigned level) const
ex series(const relational &s, int order, unsigned options=0) const override
Implementation of ex::series() for powers.
ex to_rational(exmap &repl) const override
Implementation of ex::to_rational() for powers.
void print_power(const print_context &c, const char *powersymbol, const char *openbrace, const char *closebrace, unsigned level) const
void do_print_python_repr(const print_python_repr &c, unsigned level) const
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
ex op(size_t i) const override
Return operand/member at position i.
void do_print_latex(const print_latex &c, unsigned level) const
power(const ex &lh, const T &rh)
ex conjugate() const override
ex to_polynomial(exmap &repl) const override
Implementation of ex::to_polynomial() for powers.
ex coeff(const ex &s, int n=1) const override
Return coefficient of degree n in object s.
bool has(const ex &other, unsigned options=0) const override
Test for occurrence of a pattern.
ex evalm() const override
Evaluate sums, products and integer powers of matrices.
return_type_t return_type_tinfo() const override
size_t nops() const override
Number of operands/members.
ex expand(unsigned options=0) const override
Expand expression, i.e.
bool info(unsigned inf) const override
Information about the object.
ex eval_ncmul(const exvector &v) const override
void do_print_csrc_cl_N(const print_csrc_cl_N &c, unsigned level) const
unsigned return_type() const override
ex imag_part() const override
bool is_polynomial(const ex &var) const override
Check whether this is a polynomial in the given variables.
ex evalf() const override
Evaluate object numerically.
Base class for print_contexts.
Context for C source output using CLN numbers.
Base context for C source output.
Context for default (ginsh-parsable) output.
Context for latex-parsable output.
Context for python-parsable output.
Context for python pretty-print output.
This class holds a relation consisting of two expressions and a logical relation between them.
Interface to GiNaC's light-weight expression handles.
const numeric pow(const numeric &x, const numeric &y)
std::map< ex, ex, ex_is_less > exmap
GINAC_DECLARE_UNARCHIVER(add)
const numeric sqrt(const numeric &x)
Numeric square root.
std::vector< ex > exvector
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
Function object for map().
To distinguish between different kinds of non-commutative objects.