RandGauss_Direct

Generates pseudo-random samples with a Gaussian distribution in the direct mode.

Syntax

IppStatus ippsRandGauss_Direct_16s(Ipp16s* pDst, int len, Ipp16s mean, Ipp16s stdev, unsigned int* pSeed);

IppStatus ippsRandGauss_Direct_32f(Ipp32f* pDst, int len, Ipp32f mean, Ipp32f stdev, unsigned int* pSeed);

IppStatus ippsRandGauss_Direct_64f(Ipp64f* pDst, int len, Ipp64f mean, Ipp64f stdev, unsigned int* pSeed);

Parameters

pDst

Pointer to the array which stores the samples.

pSeed

Pointer to the seed value used by the pseudo-random number generation algorithm.

len

Number of samples to be computed.

mean

Mean of the Gaussian distribution.

stdev

Standard deviation of the Gaussian distribution.

Description

The function ippsRandGauss_Direct is declared in the ipps.h file. This function generates len pseudo-random samples with a Gaussian distribution, and stores them in the array pDst.This function does not require to initialize the generator state structure in advance. All parameters of the pseudo-random number generator are set directly in the function.

The example below demonstrates how to use the function ippsRandGauss_Direct.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pDst or pSeed pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Using the Function ippsaRandGauss_Direct

void func_gauss_direct()
{
    Ipp16s* pDst;
    int len = 512;
    Ipp16s mean = 0;
    Ipp16s stdev = 2047;
    unsigned int Seed = 0;
    IppStatus status;

		
    status = ippsRandGauss_Direct_16s(pDst, len, mean, stdev, &Seed);
    if(ippStsNoErr != status)
      printf("IPP Error: %s",ippGetStatusString(status));
}

		
result:




Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.