nlcpy.random.RandomState.tomaxint¶
-
RandomState.
tomaxint
(self, size)¶ Random integers between 0 and
nlcpy.iinfo(nlcpy.int).max
, inclusive.Return a sample of uniformly distributed random integers in the interval
[0, nlcpy.iinfo(nlcpy.int).max]
. The nlcpy.int64/nlcpy.int32 type translates to the C long integer type, which is int64_t in NLCPy.- Parameters
- sizeint or tuple of ints, optional
Output shape. If the given shape is, e.g.,
(m, n, k)
, thenm * n * k
samples are drawn.
- Returns
- outndarray
Drawn samples, with shape size.
Examples
>>> import numpy as np >>> import nlcpy as vp >>> rs = vp.random.RandomState() # need a RandomState object >>> rs.tomaxint((2,2,2)) array([[[1170048599, 1600360186], # random [ 739731006, 1947757578]], [[1871712945, 752307660], [1601631370, 1479324245]]]) >>> rs.tomaxint((2,2,2)) < vp.iinfo(vp.int).max array([[[ True, True], [ True, True]], [[ True, True], [ True, True]]])