public class DistantSampler
extends java.lang.Object
Constructor and Description |
---|
DistantSampler() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
generateUniformData(int numPoints,
int dimensions,
long seed)
Generate a rectangular matrix of random uniform data in the range [0, 1) for a given number of vectors, the number of dimensions of each vectors, and a random number seed.
|
static void |
main(java.lang.String[] args)
Generate data using
generateUniformData(100, 2, 0L) , create a DistantSamplerState with this
data for 10 samples, optimize with sample(), print the resulting state, print the energy,
and visualize the result in text. |
static DistantSamplerState |
sample(double[][] data,
int numSamples) |
public static double[][] generateUniformData(int numPoints, int dimensions, long seed)
numPoints
- the given number of data vectorsdimensions
- the given number of dimensions per vectorseed
- random number seed for data generationpublic static DistantSamplerState sample(double[][] data, int numSamples)
data
- a rectangular matrix in which each row is a data vectornumSamples
- the number of vector samples to be selected from the given datagenerateUniformData(100, 2, 0L)
, your median energy should be
less than 132.public static void main(java.lang.String[] args)
generateUniformData(100, 2, 0L)
, create a DistantSamplerState with this
data for 10 samples, optimize with sample(), print the resulting state, print the energy,
and visualize the result in text.args
- (not used)