Class UnitSphereSampler

java.lang.Object
org.apache.commons.rng.sampling.UnitSphereSampler

public class UnitSphereSampler
extends java.lang.Object
Since:
1.1
  • Constructor Summary

    Constructors 
    Constructor Description
    UnitSphereSampler​(int dimension, UniformRandomProvider rng)  
  • Method Summary

    Modifier and Type Method Description
    double[] nextVector()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UnitSphereSampler

      public UnitSphereSampler​(int dimension, UniformRandomProvider rng)
      Parameters:
      dimension - Space dimension.
      rng - Generator for the individual components of the vectors. A shallow copy will be stored in this instance.
      Throws:
      java.lang.IllegalArgumentException - If dimension <= 0
  • Method Details

    • nextVector

      public double[] nextVector()
      Returns:
      a random normalized Cartesian vector.