.DESLib.RandomLib.Variates.U01

Information

U01

Uniform random number generation function

Syntax

U01(g)

Description

Returns a uniform random number in the interval (0,1), and updates the state of the Generator g by one step

Examples

model Example
  CMRG.RngStream g;
  Real u[5];
algorithm
  when initial() then
    g := Variates.initGenerator();
  end when;
  when time <= 0 then
    for i in 1:5 loop
      (u[i],g) := Variates.U01(g);
    end for;
  end when;
end Example;

// u = {0.988831,0.760616,0.855857,0.546418,0.868702}

Definition

function U01 = CMRG.RandU01;

Generated at 2024-11-24T19:25:44Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos