frnd

 

Description

Generates an array of random numbers from an F-distribution, seeds and generator number passed explicitly

Syntax

int frnd( double * v, uint n, int df1, int df2 )

Parameters

v
[output] Pointer to a double array, which contain the results
n
[input] The number of pseudo-random numbers to be generated. n>=1
df1
[input] The number of degree of freedom, ??, of the distribution
df2
[input] The number of degree of freedom, ??, of the distribution

Return

Return NE_NOERROR(0) on success, otherwise error.

Examples

EX1

//This example is to generate pseudo-random numbers from an F-distribution
int frnd_ex1()
{
    int n = 10;
    vector v( n );
 
    int df1 = 2;
    int df2 = 3;
        
    int nRet = frnd( v, n, df1, df2);
 
    if(0 != nRet)
        return 0;
    
    for(int i=0;i<n;i++)
        printf("v[%d]: %f\n",i, v[i]);

    return 1;
}

Remark

See Also

binornd

header to Include

origin.h

Reference