Package org.joml.sampling
Class BestCandidateSampling.Disk
- java.lang.Object
-
- org.joml.sampling.BestCandidateSampling.Disk
-
- Enclosing class:
- BestCandidateSampling
public static class BestCandidateSampling.Disk extends java.lang.ObjectGenerates Best Candidate samples on a unit disk.- Author:
- Kai Burjack
-
-
Constructor Summary
Constructors Constructor Description Disk()Create a new instance ofBestCandidateSampling.Diskto configure and generate 'best candidate' sample positions on the unit disk.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BestCandidateSampling.Diskgenerate(float[] xys)Generate 'best candidate' sample positions and store the coordinates of all generated samples into the givenxysfloat array.BestCandidateSampling.Diskgenerate(java.nio.FloatBuffer xys)Generate 'best candidate' sample positions and store the coordinates of all generated samples into the givenxysFloatBuffer.BestCandidateSampling.Diskgenerate(Callback2d callback)Generate 'best candidate' sample positions and call the givencallbackfor each generated sample.BestCandidateSampling.DisknumCandidates(int numCandidates)Set the number of candidates to try for each generated sample.BestCandidateSampling.DisknumSamples(int numSamples)Set the number of samples to generate.BestCandidateSampling.Diskseed(long seed)Set the seed to initialize the pseudo-random number generator with.
-
-
-
Constructor Detail
-
Disk
public Disk()
Create a new instance ofBestCandidateSampling.Diskto configure and generate 'best candidate' sample positions on the unit disk.
-
-
Method Detail
-
seed
public BestCandidateSampling.Disk seed(long seed)
Set the seed to initialize the pseudo-random number generator with.- Parameters:
seed- the seed value- Returns:
- this
-
numSamples
public BestCandidateSampling.Disk numSamples(int numSamples)
Set the number of samples to generate.- Parameters:
numSamples- the number of samples- Returns:
- this
-
numCandidates
public BestCandidateSampling.Disk numCandidates(int numCandidates)
Set the number of candidates to try for each generated sample.- Parameters:
numCandidates- the number of candidates to try- Returns:
- this
-
generate
public BestCandidateSampling.Disk generate(float[] xys)
Generate 'best candidate' sample positions and store the coordinates of all generated samples into the givenxysfloat array.This method performs heap allocations, so should be used sparingly.
- Parameters:
xys- will hold the x and y coordinates of all samples in the orderXYXYXY.... This array must have a length of at leastnumSamples- Returns:
- this
-
generate
public BestCandidateSampling.Disk generate(java.nio.FloatBuffer xys)
Generate 'best candidate' sample positions and store the coordinates of all generated samples into the givenxysFloatBuffer.The samples will be written starting at the current position of the FloatBuffer. The position of the FloatBuffer will not be modified.
This method performs heap allocations, so should be used sparingly.
- Parameters:
xys- will hold the x and y coordinates of all samples in the orderXYXYXY.... This FloatBuffer must have at leastnumSamplesremaining elements. The position of the buffer will not be modified by this method- Returns:
- this
-
generate
public BestCandidateSampling.Disk generate(Callback2d callback)
Generate 'best candidate' sample positions and call the givencallbackfor each generated sample.This method performs heap allocations, so should be used sparingly.
- Parameters:
callback- will be called with the coordinates of each generated sample position- Returns:
- this
-
-