-
Notifications
You must be signed in to change notification settings - Fork 0
ds.generators
metmajer edited this page Mar 16, 2013
·
5 revisions
The ds.generators
module is a collection of data series generator factories.
f(algorithm)
Creates a new FunctionDataSeriesGenerator
, which initializes data series from
the outputs of algorithm
, a function y = f(x). Any excess arguments provided
after algorithm
will be applied to each invocation of the algorithm on an input
value.
See the ds.functions
module for a list of provided functions
and Wikipedia, List of mathematical functions
for a comprehensive list of mathematical functions.
var algorithm = function(x, a, b) { return a * x + b; };
ds.generators.f(algorithm, 2, 1); // a = 2, b = 1
-
Function(*):* algorithm A function y = f(x), which maps an input value
x
to an output value y. The algorithm may expect additional arguments afterx
.
- FunctionDataSeriesGenerator Returns a new generator instance.
-
Error Throws if
algorithm
is not a function.