Skip to content

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.

Examples:

var algorithm = function(x, a, b) { return a * x + b; };
ds.generators.f(algorithm, 2, 1); // a = 2, b = 1

Params:

  • Function(*):* algorithm A function y = f(x), which maps an input value x to an output value y. The algorithm may expect additional arguments after x.

Returns:

Throws:

  • Error Throws if algorithm is not a function.
Clone this wiki locally