]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_trans.cpp
Happy New Year!
[ginac.git] / ginac / inifcns_trans.cpp
index d7fa377e269395d6b6b2c0af0591f44242c1a363..9982853961286be457af33ee445339aeb4651f65 100644 (file)
@@ -4,7 +4,7 @@
  *  functions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -98,7 +98,7 @@ static ex exp_expand(const ex & arg, unsigned options)
                for (const_iterator i = exp_arg.begin(); i != exp_arg.end(); ++i)
                        prodseq.push_back(exp(*i));
 
-               return (new mul(prodseq))->setflag(status_flags::dynallocated | status_flags::expanded);
+               return dynallocate<mul>(prodseq).setflag(status_flags::expanded);
        }
 
        return exp(exp_arg).hold();
@@ -242,12 +242,8 @@ static ex log_series(const ex &arg,
                        // in this case n more (or less) terms are needed
                        // (sadly, to generate them, we have to start from the beginning)
                        if (n == 0 && coeff == 1) {
-                               epvector epv;
-                               ex acc = (new pseries(rel, epv))->setflag(status_flags::dynallocated);
-                               epv.reserve(2);
-                               epv.push_back(expair(-1, _ex0));
-                               epv.push_back(expair(Order(_ex1), order));
-                               ex rest = pseries(rel, std::move(epv)).add_series(argser);
+                               ex rest = pseries(rel, epvector{expair(-1, _ex0), expair(Order(_ex1), order)}).add_series(argser);
+                               ex acc = dynallocate<pseries>(rel, epvector());
                                for (int i = order-1; i>0; --i) {
                                        epvector cterm { expair(i%2 ? _ex1/i : _ex_1/i, _ex0) };
                                        acc = pseries(rel, std::move(cterm)).add_series(ex_to<pseries>(acc));