* Please do not modify it directly, edit function.cppy instead!
* function.py options: maxargs=@maxargs@
*
- * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2023 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
void function::read_archive(const archive_node& n, lst& sym_lst)
{
inherited::read_archive(n, sym_lst);
- // Find serial number by function name
+ // Find serial number by function name and number of parameters
+ unsigned np = seq.size();
std::string s;
if (n.find_string("name", s)) {
unsigned int ser = 0;
for (auto & it : registered_functions()) {
- if (s == it.name) {
+ if (s == it.name && np == registered_functions()[ser].nparams) {
serial = ser;
return;
}
++ser;
}
- throw (std::runtime_error("unknown function '" + s + "' in archive"));
+ throw (std::runtime_error("unknown function '" + s +
+ "' with " + std::to_string(np) + " parameters in archive"));
} else
throw (std::runtime_error("unnamed function in archive"));
}
}
current_serial = serial;
if (opt.evalf_use_exvector_args)
- return ((evalf_funcp_exvector)(opt.evalf_f))(seq);
+ return ((evalf_funcp_exvector)(opt.evalf_f))(eseq);
switch (opt.nparams) {
// the following lines have been generated for max. @maxargs@ parameters
+++ for N in range(1, maxargs + 1):