# function.pl options: \$maxargs=${maxargs}
#
-# GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+# GiNaC Copyright (C) 1999-2008 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
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
*
- * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2008 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
ex expand(unsigned options=0) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
+ ex eval_ncmul(const exvector & v) const;
unsigned calchash() const;
ex series(const relational & r, int order, unsigned options = 0) const;
ex thiscontainer(const exvector & v) const;
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
*
- * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2008 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
#include <string>
#include <stdexcept>
#include <list>
+#include <limits>
#include "function.h"
#include "operators.h"
exvector v = seq;
GINAC_ASSERT(is_a<symmetry>(opt.symtree));
int sig = canonicalize(v.begin(), ex_to<symmetry>(opt.symtree));
- if (sig != INT_MAX) {
+ if (sig != std::numeric_limits<int>::max()) {
// Something has changed while sorting arguments, more evaluations later
if (sig == 0)
return _ex0;
throw(std::logic_error("function::evalf(): invalid nparams"));
}
+/**
+ * This method is defined to be in line with behaviour of function::return_type()
+ */
+ex function::eval_ncmul(const exvector & v) const
+{
+ // If this function is called then the list of arguments is non-empty
+ // and the first argument is non-commutative, see function::return_type()
+ return seq.begin()->eval_ncmul(v);
+}
+
unsigned function::calchash() const
{
unsigned v = golden_ratio_hash(golden_ratio_hash((p_int)tinfo()) ^ serial);
std::vector<function_options> & function::registered_functions()
{
- static std::vector<function_options> * rf = new std::vector<function_options>;
- return *rf;
+ static std::vector<function_options> rf = std::vector<function_options>();
+ return rf;
}
bool function::lookup_remember_table(ex & result) const