{
if (is_ex_exactly_of_type(e,mul)) {
const mul &mulref(ex_to<mul>(e));
- ex numfactor = mulref.overall_coeff;
+ const ex &numfactor = mulref.overall_coeff;
mul *mulcopyp = new mul(mulref);
mulcopyp->overall_coeff = _ex1;
mulcopyp->clearflag(status_flags::evaluated);
GINAC_ASSERT(is_exactly_a<numeric>(c));
if (is_ex_exactly_of_type(e, mul)) {
const mul &mulref(ex_to<mul>(e));
- ex numfactor = mulref.overall_coeff;
+ const ex &numfactor = mulref.overall_coeff;
mul *mulcopyp = new mul(mulref);
mulcopyp->overall_coeff = _ex1;
mulcopyp->clearflag(status_flags::evaluated);
if (ex_to<numeric>(p.coeff).is_equal(_num1))
return p.rest;
else
- return p.rest*p.coeff;
+ return (new mul(p.rest,p.coeff))->setflag(status_flags::dynallocated);
}
ex add::expand(unsigned options) const
* if no members were changed. */
epvector * expairseq::expandchildren(unsigned options) const
{
- epvector::const_iterator last = seq.end();
+ const epvector::const_iterator last = seq.end();
epvector::const_iterator cit = seq.begin();
while (cit!=last) {
const ex &expanded_ex = cit->rest.expand(options);
* pointer, if sequence is unchanged. */
epvector * mul::expandchildren(unsigned options) const
{
- epvector::const_iterator last = seq.end();
+ const epvector::const_iterator last = seq.end();
epvector::const_iterator cit = seq.begin();
while (cit!=last) {
const ex & factor = recombine_pair_to_ex(*cit);