maths.functions.generators.UniformRandomGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jstat Show documentation
Show all versions of jstat Show documentation
Java Library for Statistical Analysis.
The newest version!
package maths.functions.generators;
import datastructs.I2DDataSet;
import datastructs.IVector;
import java.util.*;
public class UniformRandomGenerator implements IRandomGenerator {
@Override
public >> List> generate(DataSetTp dataSet, int n){
int min = 0;
int max = dataSet.m();
Random random = new Random();
List> result = new ArrayList<>();
Set touched = new HashSet<>();
for(int r=0; r