Class UnitSphereSampler

    • Method Detail

      • sample

        public double[] sample()
        Description copied from interface: ObjectSampler
        Create an object sample.
        Specified by:
        sample in interface ObjectSampler<double[]>
        Returns:
        a random normalized Cartesian vector.
        Since:
        1.4
      • of

        public static UnitSphereSampler of​(org.apache.commons.rng.UniformRandomProvider rng,
                                           int dimension)
        Create a unit sphere sampler for the given dimension.
        Parameters:
        rng - Generator for the individual components of the vectors. A shallow copy will be stored in the sampler.
        dimension - Space dimension.
        Returns:
        the sampler
        Throws:
        IllegalArgumentException - If dimension <= 0
        Since:
        1.4