#include "power.h"
#include "archive.h"
#include "inifcns.h"
-#include "tostring.h"
#include "utils.h"
#include "hash_seed.h"
#include "remember.h"
// the following lines have been generated for max. @maxargs@ parameters
+++ for N in range(1, maxargs + 1):
function::function(unsigned ser, @seq('const ex & param%(n)d', N)@)
- : exprseq(@seq('param%(n)d', N)@), serial(ser)
+ : exprseq{@seq('param%(n)d', N)@}, serial(ser)
{
}
---
ex function::eval(int level) const
{
+ if ((level == 1) && (flags & status_flags::evaluated)) {
+ return *this;
+ }
+
if (level>1) {
// first evaluate children, then we will end up here again
return function(serial,evalchildren(level));
}
}
// No power function defined? Fall back to returning a power object.
- return (new GiNaC::power(*this, power_param))->setflag(status_flags::dynallocated |
- status_flags::evaluated);
+ return dynallocate<GiNaC::power>(*this, power_param).setflag(status_flags::evaluated);
}
ex function::expand(unsigned options) const
return serial;
++serial;
}
- throw (std::runtime_error("no function '" + name + "' with " + ToString(nparams) + " parameters defined"));
+ throw (std::runtime_error("no function '" + name + "' with " + std::to_string(nparams) + " parameters defined"));
}
/** Return the print name of the function. */