g05te generates a vector of pseudorandom integers from the discrete hypergeometric distribution of the number of specified items in a sample of size , taken from a population of size with specified items in it.
public static void g05te( mode, n, ns, np, m,  r, G05..::.G05State g05state,  x, out ifail )
|Visual Basic (Declaration)|
Public Shared Sub g05te ( _ mode As , _ n As , _ ns As , _ np As , _ m As , _ r As (), _ g05state As G05..::.G05State, _ x As (), _ < > ByRef ifail As _ )
public: static void g05te( mode, n, ns, np, m, array< >^ r, G05..::.G05State^ g05state, array< >^ x, [ ] % ifail )
static member g05te : mode: * n: * ns: * np: * m: * r:  * g05state:G05..::.G05State * x:  * ifail: byref -> unit
On entry: a code for selecting the operation to be performed by the method.
Constraint: , , or .
- Set up reference vector only.
- Generate variates using reference vector set up in a prior call to g05te.
- Set up reference vector and generate variates.
- Generate variates without using the reference vector.
On entry: , the number of pseudorandom numbers to be generated.Constraint: .
On entry: , the sample size of the hypergeometric distribution.Constraint: .
On entry: , the population size of the hypergeometric distribution.Constraint: .
On entry: , the number of specified items of the hypergeometric distribution.Constraint: .
- Type: array<
>()An array of size [lr]Note: lr must satisfy the constraint:
On entry: if , the reference vector from the previous call to g05te.On exit: the reference vector.
- if or , lr must not be too small, but the limit is too complicated to specify;
- if , lr must remain unchanged from the previous call to g05te.
- Type: array<
>()An array of size [n]On exit: the pseudorandom numbers from the specified hypergeometric distribution.
On exit: unless the method detects an error (see [Error Indicators and Warnings]).
g05te generates integers from a discrete hypergeometric distribution, where the probability of is
The variates can be generated with or without using a search table and index. If a search table is used then it is stored with the index in a reference vector and subsequent calls to g05te with the same parameter values can then use this reference vector to generate further variates. The reference array is generated by a recurrence relation if , otherwise Stirling's approximation is used.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (lr, lstate) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, at least one of ns, np or m is not the same as when r was set up in a previous call to g05te with or .On entry, the r vector was not initialized correctly or has been corrupted.
On entry, g05state vector was not initialized or has been corrupted.
The example program prints pseudorandom integers from a hypergeometric distribution with , and , generated by a single call to g05te, after initialization by the state constructor (for a repeatable sequence).