Class BestCandidateSampling.Quad

  • Enclosing class:
    BestCandidateSampling


    public static class BestCandidateSampling.Quad
    extends Object
    Generates Best Candidate samples on a unit quad.
    Author:
    Kai Burjack
    • Constructor Detail

      • Quad

        public Quad​()
        Create a new instance of BestCandidateSampling.Quad to configure and generate 'best candidate' sample positions on the unit quad.
    • Method Detail

      • seed

        public BestCandidateSampling.Quad seed​(long seed)
        Set the seed to initialize the pseudo-random number generator with.
        Parameters:
        seed - the seed value
        Returns:
        this
      • numSamples

        public BestCandidateSampling.Quad numSamples​(int numSamples)
        Set the number of samples to generate.
        Parameters:
        numSamples - the number of samples
        Returns:
        this
      • numCandidates

        public BestCandidateSampling.Quad 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.Quad generate​(float[] xyzs)
        Generate 'best candidate' sample positions and store the coordinates of all generated samples into the given xyzs float array.

        This method performs heap allocations, so should be used sparingly.

        Parameters:
        xyzs - will hold the x, y and z coordinates of all samples in the order XYZXYZXYZ.... This array must have a length of at least numSamples
        Returns:
        this
      • generate

        public BestCandidateSampling.Quad generate​(Callback2d callback)
        Generate 'best candidate' sample positions and call the given callback for 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