diff --git a/website/pip/index.html b/website/pip/index.html index 162a856..c64dee5 100644 --- a/website/pip/index.html +++ b/website/pip/index.html @@ -49,7 +49,7 @@ $> initdb
$> cd pip_plugin $> make @@ -78,12 +78,12 @@ $> psql template_1 -f install[.ctype].sqlFor example:
CREATE TABLE my_probabilistic_data( - name varchar(100), + name varchar(100), data pip_eqn ); INSERT INTO my_probabilistic_data - SELECT input.name, - CREATE_VARIABLE("Normal", vector(input.mean, input.stddev)) + SELECT input.name, + CREATE_VARIABLE("Normal", ROW(input.mean, input.stddev)) FROM input;This example creates a random variable by iterating over each row of the table 'input'. The Normal distribution requires two parameters: a mean and a standard deviation, both of which are drawn from the corresponding row of the input table.@@ -194,23 +194,23 @@ FROM results;
CREATE_VARIABLE("Zero", vector())
CREATE_VARIABLE("Zero", ROW())
CREATE_VARIABLE("Exponential", vector(lambda))
CREATE_VARIABLE("Exponential", ROW(lambda))
CREATE_VARIABLE("Normal", vector(mean, stddev))
CREATE_VARIABLE("Normal", ROW(mean, stddev))
CREATE_VARIABLE("Poisson", vector(lambda))
CREATE_VARIABLE("Poisson", ROW(lambda))
CREATE_VARIABLE("Uniform", vector(low, high))
CREATE_VARIABLE("Uniform", ROW(low, high))
init_fn
void init_fn(pip_var *var, HeapTupleHeader params)-When your initializer is invoked,
var
will contain a pointer to initialized pip variable. var->group_state
will contain a pointer to an allocated, but uninitialized block of [paramsize] bytes. params
is a pointer to the postgres vector() of parameters. See below for information on utility functions for parsing the parameter vector.var
will contain a pointer to initialized pip variable. var->group_state
will contain a pointer to an allocated, but uninitialized block of [paramsize] bytes. params
is a pointer to the postgres ROW() of parameters. See below for information on utility functions for parsing the parameter vector.
gen_fn
@@ -262,7 +262,7 @@ When invoked, str
will contain a pointer to a (large) allocated, bu
input_fn
int input_fn(pip_var *var, char *str)-When the input function is invoked,
var
will contain a pointer to initialized pip variable. var->group_state
will contain a pointer to an allocated, but uninitialized block of [paramsize] bytes. str
references a C string containing a human-readable representation of this distribution's parameters, as used in [output_fn]. The input function should parse this string (e.g., using sscanf) and initialize var->group_state
in the same way as [init_fn]. Note: Although this function is optional, be aware that not including it will prevent users from being able to import data defined in terms of this distribution.
+When the input function is invoked, var
will contain a pointer to initialized pip variable. var->group_state
will contain a pointer to an allocated, but uninitialized block of [paramsize] bytes. str
references a C string containing a human-readable representation of this distribution's parameters, as used in [output_fn]. The input function should parse this string (e.g., using sscanf) and initialize var->group_state
in the same way as [init_fn]. Note: Although this function is optional, be aware that not including it will prevent users from being able to import data defined in terms of this distribution.
void pip_box_muller(float8 *X, float8 *Y, int64 *seed)
seed
), independent, normally distributed floating point numbers (with mean of 0 and standard deviation of 1) using the Box-Muller method. The independent variables will be stored in X
and Y
-- either or both may be used. The seed
value is passed by reference, and is stepped to its next value automatically (note that the Box-Muller method requires two random numbers as input and as a consequence, seed
is actually stepped twice).
+seed
), independent, normally distributed floating point numbers (with mean of 0 and standard deviation of 1) using the Box-Muller method. The independent variables will be stored in X
and Y
-- either or both may be used. The seed
value is passed by reference, and is stepped to its next value automatically (note that the Box-Muller method requires two random numbers as input and as a consequence, seed
is actually stepped twice).