The class power member functions expand_add(), expand_add_2(), and
expand_mul() do not access any member variable of class power. (In
fact, the only reason not to hide them entirely is that they invoke
protected members of classs expairseq, add, and mul which requires
them to be friends of these classes.)
/** expand a^n where a is an add and n is a positive integer.
* @see power::expand */
/** expand a^n where a is an add and n is a positive integer.
* @see power::expand */
-ex power::expand_add(const add & a, long n, unsigned options) const
+ex power::expand_add(const add & a, long n, unsigned options)
{
// The special case power(+(x,...y;x),2) can be optimized better.
if (n==2)
{
// The special case power(+(x,...y;x),2) can be optimized better.
if (n==2)
/** Special case of power::expand_add. Expands a^2 where a is an add.
* @see power::expand_add */
/** Special case of power::expand_add. Expands a^2 where a is an add.
* @see power::expand_add */
-ex power::expand_add_2(const add & a, unsigned options) const
+ex power::expand_add_2(const add & a, unsigned options)
{
epvector result;
size_t result_size = (a.nops() * (a.nops()+1)) / 2;
{
epvector result;
size_t result_size = (a.nops() * (a.nops()+1)) / 2;
/** Expand factors of m in m^n where m is a mul and n is an integer.
* @see power::expand */
/** Expand factors of m in m^n where m is a mul and n is an integer.
* @see power::expand */
-ex power::expand_mul(const mul & m, const numeric & n, unsigned options, bool from_expand) const
+ex power::expand_mul(const mul & m, const numeric & n, unsigned options, bool from_expand)
{
GINAC_ASSERT(n.is_integer());
{
GINAC_ASSERT(n.is_integer());
void do_print_python_repr(const print_python_repr & c, unsigned level) const;
void do_print_csrc_cl_N(const print_csrc_cl_N & c, unsigned level) const;
void do_print_python_repr(const print_python_repr & c, unsigned level) const;
void do_print_csrc_cl_N(const print_csrc_cl_N & c, unsigned level) const;
- ex expand_add(const add & a, long n, unsigned options) const;
- ex expand_add_2(const add & a, unsigned options) const;
- ex expand_mul(const mul & m, const numeric & n, unsigned options, bool from_expand = false) const;
+ static ex expand_add(const add & a, long n, unsigned options);
+ static ex expand_add_2(const add & a, unsigned options);
+ static ex expand_mul(const mul & m, const numeric & n, unsigned options, bool from_expand = false);