|
From: | William Gillam |
Subject: | [bug-libmatheval] Libmatheval needs composition of functions |
Date: | Thu, 25 Oct 2018 15:53:21 +0000 |
This isn't a bug report, but rather a general suggestion for improvement. It seems to me that this library would be greatly enhanced by the addition of a function
void * evaluator_compose (void * f, int count, char **names, void **g)
returning an evaluator for the function obtained from f by substituting g[i] for the variable names[i] appearing in f (i.e. composing f and the g[i] appropriately). The already extant function
evaluator_evaluate
is then basically a special case of this where the g[i] are constant.
(You could already "fake" the evaluator_compose function by printing out the string representations of f and the g[i] and literally doing the replacements on the strings, but this capacity should be built-in to the library...)
(Sorry if the actual C syntax is not right. I'm not a programmer, but I think the idea is pretty clear...)
--William D. Gillam |
[Prev in Thread] | Current Thread | [Next in Thread] |