+#endif // ndef NO_NAMESPACE_GINAC
+
+//////////
+// helper class function_options
+//////////
+
+function_options::function_options()
+{
+ initialize();
+}
+
+function_options::function_options(std::string const & n, std::string const & tn)
+{
+ initialize();
+ set_name(n,tn);
+}
+
+function_options::~function_options()
+{
+ // nothing to clean up at the moment
+}
+
+void function_options::initialize(void)
+{
+ set_name("unnamed_function","\\\\operatorname{unnamed}");
+ nparams=0;
+ eval_f=evalf_f=derivative_f=series_f=0;
+ evalf_params_first=true;
+ use_return_type=false;
+ use_remember=false;
+ functions_with_same_name=1;
+}
+
+function_options & function_options::set_name(std::string const & n,
+ std::string const & tn)
+{
+ name=n;
+ if (tn==std::string()) {
+ TeX_name="\\\\operatorname{"+name+"}";
+ } else {
+ TeX_name=tn;
+ }
+ return *this;
+}
+
+// the following lines have been generated for max. ${maxargs} parameters
+$eval_func_implementation
+$evalf_func_implementation
+$derivative_func_implementation
+$series_func_implementation
+// end of generated lines
+
+function_options & function_options::set_return_type(unsigned rt, unsigned rtt)
+{
+ use_return_type=true;
+ return_type=rt;
+ return_type_tinfo=rtt;
+ return *this;
+}
+
+function_options & function_options::do_not_evalf_params(void)
+{
+ evalf_params_first=false;
+ return *this;
+}
+
+function_options & function_options::remember(unsigned size,
+ unsigned assoc_size,
+ unsigned strategy)
+{
+ use_remember=true;
+ remember_size=size;
+ remember_assoc_size=assoc_size;
+ remember_strategy=strategy;
+ return *this;
+}
+
+function_options & function_options::overloaded(unsigned o)
+{
+ functions_with_same_name=o;
+ return *this;
+}
+
+void function_options::test_and_set_nparams(unsigned n)
+{
+ if (nparams==0) {
+ nparams=n;
+ } else if (nparams!=n) {
+ // we do not throw an exception here because this code is
+ // usually executed before main(), so the exception could not
+ // caught anyhow
+ std::cerr << "WARNING: number of parameters ("
+ << n << ") differs from number set before ("
+ << nparams << ")" << std::endl;
+ }
+}