|
NAG[g05qdc] NAG[nag_rngs_2_way_table] - Generates a random table matrix
|
|
Calling Sequence
g05qdc(mode, totr, totc, x, igen, iseed, r, 'nrow'=nrow, 'ncol'=ncol, 'nr'=nr, 'fail'=fail)
nag_rngs_2_way_table(. . .)
Parameters
|
mode - integer;
|
|
|
On entry: a code for selecting the operation to be performed by the function:
|
|
Set up reference vector only.
|
|
Generate two-way table using reference vector set up in a prior call to nag_rngs_2_way_table (g05qdc).
|
|
Set up reference vector and generate two-way table.
|
|
Constraint: . .
|
|
|
totr - Vector(1..nrow, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
, for ;
|
|
.
|
|
|
totc - Vector(1..ncol, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
, for ;
|
|
.
|
|
|
x - Matrix(1..dim1, 1..ncol, datatype=integer[kernelopts('wordsize')/8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
|
iseed - Vector(1.. , datatype=integer[kernelopts('wordsize')/8]);
|
|
|
On entry: contains values which define the current state of the selected generator.
|
|
On exit: contains updated values defining the new state of the selected generator.
|
|
|
r - Vector(1..nr, datatype=float[8]);
|
|
|
On entry: if mode is set to , the reference vector from the previous call to nag_rngs_2_way_table (g05qdc).
|
|
On exit: the reference vector.
|
|
|
'nrow'=nrow - integer; (optional)
|
|
|
On entry: , the number of rows in the table.
|
|
Constraint: . .
|
|
|
'ncol'=ncol - integer; (optional)
|
|
|
Default value: the first dimension of and the second dimension of the array x.
|
|
On entry: , the number of columns in the table.
|
|
Constraint: . .
|
|
|
'nr'=nr - integer; (optional)
|
|
|
On entry: the dimension of the array r as declared in the function from which nag_rngs_2_way_table (g05qdc) is called.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_rngs_2_way_table (g05qdc) generates a random two-way table.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_INT"
On entry, . Constraint: .
On entry, . Constraint: .
On entry, nr not large enough, . Minimum length required .
On entry, . Constraint: .
"NE_INT_2"
On entry, or : , .
"NE_INTERNAL_ERROR"
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please consult NAG for assistance.
"NE_PREV_CALL"
nrow or ncol is not the same as when r was set up in a previous call. Previous value of , current value of . Previous value of , current value of .
"NE_REAL_ARRAY_ELEM_CONS"
On entry, totc has at least one negative element.
On entry, totr has at least one negative element.
"NE_REAL_ARRAYS_SUM"
On entry, the arrays totr and totc do not sum to the same total: totr array total is , totc array total is .
|
|
|
Examples
|
|
>
|
mode := 2:
nrow := 4:
ncol := 3:
igen := 1:
nr := 60:
totr := Vector([9, 11, 7, 23], datatype=integer[kernelopts('wordsize')/8]):
totc := Vector([16, 17, 17], datatype=integer[kernelopts('wordsize')/8]):
x := Matrix(4, 3, datatype=integer[kernelopts('wordsize')/8]):
iseed := Vector([1762543, 9324783, 42344, 742355], datatype=integer[kernelopts('wordsize')/8]):
r := Vector(60, datatype=float[8]):
NAG:-g05qdc(mode, totr, totc, x, igen, iseed, r, 'nrow' = nrow, 'ncol' = ncol, 'nr' = nr):
|
|
|