Class Long2IntArray
- java.lang.Object
-
- org.apache.commons.rng.simple.internal.Long2IntArray
-
- All Implemented Interfaces:
Seed2ArrayConverter<Long,int[]>,SeedConverter<Long,int[]>
public class Long2IntArray extends Object implements Seed2ArrayConverter<Long,int[]>
Uses alongvalue to seed aSplitMix64RNG and create aint[]with the requested number of random values.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description Long2IntArray(int size)Create an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]convert(Long seed)Converts seed from input type to output type.int[]convert(Long seed, int outputSize)Converts seed from input type to output type.
-
-
-
Constructor Detail
-
Long2IntArray
public Long2IntArray(int size)
Create an instance.- Parameters:
size- Size of the output array.
-
-
Method Detail
-
convert
public int[] convert(Long seed)
Converts seed from input type to output type.- Specified by:
convertin interfaceSeedConverter<Long,int[]>- Parameters:
seed- Original seed value.- Returns:
- the converted seed value.
-
convert
public int[] convert(Long seed, int outputSize)
Converts seed from input type to output type. The output type is expected to be an array.- Specified by:
convertin interfaceSeed2ArrayConverter<Long,int[]>- Parameters:
seed- Original seed value.outputSize- Output size.- Returns:
- the converted seed value.
- Since:
- 1.3
-
-