public class DistantSamplerState extends java.lang.Object implements State, java.lang.Cloneable
step() specification: Pick a random sample and change it to a different sample that is distinct from the rest.
undo() specification: Undo the change of the previous step() call. You may assume that there is at least one step() call between each undo() call, that is, you are only required to undo the most recent step.
energy() specification: Return the sum of inverse-squared Euclidean distances between pairs of data points.
clone() specification: Perform a deep clone of this DistantSamplerState, such that changes to the copy do not affect the original or vice versa.
toString() specification: Return the standard Java String representation of getSampleIndices().
Constructor and Description |
---|
DistantSamplerState(double[][] data,
int numSamples)
Initializes the current sample selection to be
numSamples unique indices to the data array. |
Modifier and Type | Method and Description |
---|---|
DistantSamplerState |
clone() |
double |
energy() |
int[] |
getSampleIndices()
Return a sorted list of the indices of data points chosen for the current sample.
|
void |
step() |
java.lang.String |
toString() |
void |
undo() |
public DistantSamplerState(double[][] data, int numSamples)
numSamples
unique indices to the data array.data
- - a rectangular 2D array with each row being a single datum vector, and the columns 0 through
n - 1 being the vector elements of an n-dimensional vector.numSamples
- - the number of sample selections to make from this data, that is, the number of data rows to be selected.public DistantSamplerState clone()
public int[] getSampleIndices()
public java.lang.String toString()
toString
in class java.lang.Object