LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::gen::MatlabRng Class Reference

One MATLAB global random stream, as left by rng(seed). More...

#include <line/gen/matlab_rng.h>

Public Member Functions

 MatlabRng (long long seed=0)
void reseed (long long seed)
 MATLAB rng(seed).
double rand ()
 One MATLAB rand draw.
int randi (int lo, int hi)
 MATLAB randi([lo, hi]).
std::vector< std::size_t > randperm (std::size_t n)
 MATLAB randperm(n), returned 0-based.
std::vector< double > randfixedsum (std::size_t n, double s, double a, double b)
 One column of randfixedsum(n,1,s,a,b) (matlab/lib/thirdparty/randfixedsum.m): draws rand(n-1,1) twice, then rand(n,1) for the permutation.

Detailed Description

One MATLAB global random stream, as left by rng(seed).

Definition at line 39 of file matlab_rng.h.

Constructor & Destructor Documentation

◆ MatlabRng()

line::gen::MatlabRng::MatlabRng ( long long seed = 0)
inlineexplicit

Definition at line 41 of file matlab_rng.h.

Member Function Documentation

◆ rand()

double line::gen::MatlabRng::rand ( )
inline

One MATLAB rand draw.

Definition at line 47 of file matlab_rng.h.

Referenced by randfixedsum(), randi(), and randperm().

◆ randfixedsum()

std::vector< double > line::gen::MatlabRng::randfixedsum ( std::size_t n,
double s,
double a,
double b )
inline

One column of randfixedsum(n,1,s,a,b) (matlab/lib/thirdparty/randfixedsum.m): draws rand(n-1,1) twice, then rand(n,1) for the permutation.

Definition at line 67 of file matlab_rng.h.

References rand(), and randperm().

Referenced by line::gen::randfixedsumone().

◆ randi()

int line::gen::MatlabRng::randi ( int lo,
int hi )
inline

MATLAB randi([lo, hi]).

Definition at line 50 of file matlab_rng.h.

References rand().

Referenced by line::gen::rand_spanning_tree(), and line::gen::randintfixedsum().

◆ randperm()

std::vector< std::size_t > line::gen::MatlabRng::randperm ( std::size_t n)
inline

MATLAB randperm(n), returned 0-based.

Definition at line 53 of file matlab_rng.h.

References rand().

Referenced by line::gen::rand_graph(), and randfixedsum().

◆ reseed()

void line::gen::MatlabRng::reseed ( long long seed)
inline

MATLAB rng(seed).

Definition at line 44 of file matlab_rng.h.


The documentation for this class was generated from the following file: