A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
setSeed
ArrayFire Functions | ArrayFire Functions by Category » Functions to create and modify Arrays » Functions to create arrays. » Random Number Generation

Set the seed for random number generation. More...

## Functions
AFAPI void | setSeed (const unsigned long long seed)
| C++ Interface to set the seed of the default random number generator.
AFAPI af_err | af_set_seed (const unsigned long long seed)

## Detailed Description

Set the seed for random number generation.

Sets the seed for the current default random engine.

## Function Documentation

## ◆ af_set_seed()

AFAPI af_err af_set_seed | ( | const unsigned long long | seed | ) |

Parameters

  [in] | seed | a 64-bit unsigned integer

Returns
  AF_SUCCESS, if function returns successfully, else an af_err code is given

## ◆ setSeed()

AFAPI void setSeed | ( | const unsigned long long | seed | ) |

C++ Interface to set the seed of the default random number generator.

Parameters

  [in] | seed | 64-bit unsigned integer