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), then m * 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([[[1079106830703163808, 3459384031587249938], # random
        [8049598135358749809, 3711974831622109574]],

        [[ 346377385468830352, 8096829319065988726],
        [2838928252329023857, 5551944918900034754]]])
>>> rs.tomaxint((2,2,2)) < vp.iinfo(vp.int_).max
array([[[ True,  True],
        [ True,  True]],

       [[ True,  True],
        [ True,  True]]])