iNewAbstractStream

Creates and initializes an abstract random stream for integer arrays.

Syntax

Fortran:

status = vslinewabstractstream( stream, n, ibuf, icallback )

C:

status = vsliNewAbstractStream( &stream, n, ibuf, icallback );

Include Files

The FORTRAN 77 interfaces are specified in the mkl_vsl.f77 include file, the Fortran 90 interfaces are specified in the mkl_vsl.f90 include file, and the C interfaces are specified in the mkl_vsl_functions.h include file.

Input Parameters

Name

Type

Description

n

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Size of the array ibuf

ibuf

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const unsigned int

Array of n 32-bit integers

icallback

See Note below

Fortran: Address of the callback function used for ibuf update

C: Pointer to the callback function used for ibuf update

Note iconNote

Format of the callback function in FORTRAN 77: INTEGER FUNCTION IUPDATEFUNC( stream, n, ibuf, nmin, nmax, idx )
INTEGER*4 stream(2)
INTEGER n
INTEGER*4 ibuf(n)
INTEGER nmin
INTEGER nmax
INTEGER idx

Format of the callback function in Fortran 90: INTEGER FUNCTION IUPDATEFUNC[C]( stream, n, ibuf, nmin, nmax, idx )
TYPE(VSL_STREAM_STATE),POINTER :: stream[reference]
INTEGER(KIND=4),INTENT(IN) :: n[reference]
INTEGER(KIND=4),INTENT(OUT) :: ibuf[reference](0:n-1)
INTEGER(KIND=4),INTENT(IN) :: nmin[reference]
INTEGER(KIND=4),INTENT(IN) :: nmax[reference]
INTEGER(KIND=4),INTENT(IN) :: idx[reference]

Format of the callback function in C: int iUpdateFunc( VSLStreamStatePtr stream, int* n, unsigned int ibuf[], int* nmin, int* nmax, int* idx );

The callback function returns the number of elements in the array actually updated by the function. Table icallback Callback Function Parameters gives the description of the callback function parameters.

icallback Callback Function Parameters

Parameters

Short Description

stream

Abstract random stream descriptor

n

Size of ibuf

ibuf

Array of random numbers associated with the stream stream

nmin

Minimal quantity of numbers to update

nmax

Maximal quantity of numbers that can be updated

idx

Position in cyclic buffer ibuf to start update 0idx<n.

Output Parameters

Name

Type

Description

stream

FORTRAN 77: INTEGER*4 stream(2)

Fortran 90: TYPE(VSL_STREAM_STATE), TINTENT(OUT)

C: VSLStreamStatePtr*

Descriptor of the stream state structure

Description

The iNewAbstractStream function creates a new abstract stream and associates it with an integer array ibuf and your callback function icallback that is intended for updating of ibuf content.

Return Values

VSL_ERROR_OK, VSL_STATUS_OK

Indicates no error, execution is successful.

VSL_ERROR_BADARGS

Parameter n is not positive.

VSL_ERROR_MEM_FAILURE

System cannot allocate memory for stream.

VSL_ERROR_NULL_PTR

Either buffer or callback function parameter is a NULL pointer.


Submit feedback on this help topic

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