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

TypeNameDefaultDescription
Generatorg (from Var)Random number generator
Reala (from Var)0First parameter of the prob. distribution
Realb (from Var)0Second parameter of the prob. distribution
Realc (from Var)0Third parameter of the prob. distribution (only for the Johnson and Triangular distributions)
Reald (from Var)0Fourth parameter of the prob. distribution (only for the Johnson distribution)

Outputs

TypeNameDefaultDescription
Realx (from Var)Generated random variate
Generatorgout (from Var)Updated random number generator