functionConstant
Constant value generation
Extends from Var (prototype for variate generation functions).
Information
Constant
Generates a constant number.
Syntax
Constant(g,a)
Description
Always generates the same number, equal to the parameter a.
Examples
Constant(g,1) =
(1,g)
for i in 1:5 loop
(u[i],g) := Constant(g,3);
end for;
// u = {3,3,3,3,3};
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Generator | g (from Var) | Random number generator | |
| Real | a (from Var) | 0 | First parameter of the prob. distribution |
| Real | b (from Var) | 0 | Second parameter of the prob. distribution |
| Real | c (from Var) | 0 | Third parameter of the prob. distribution (only for the Johnson and Triangular distributions) |
| Real | d (from Var) | 0 | Fourth parameter of the prob. distribution (only for the Johnson distribution) |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x (from Var) | Generated random variate | |
| Generator | gout (from Var) | Updated random number generator |