ca.nengo.util.impl
Class RandomHypersphereVG
java.lang.Object
ca.nengo.util.impl.RandomHypersphereVG
- All Implemented Interfaces:
- VectorGenerator, java.io.Serializable
public class RandomHypersphereVG
- extends java.lang.Object
- implements VectorGenerator, java.io.Serializable
Generates random vectors distributed on or in a hypersphere.
TODO: Reference Deak, Muller
- Author:
- Bryan Tripp
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomHypersphereVG
public RandomHypersphereVG(boolean surface,
float radius,
float axisClusterFactor)
- Parameters:
surface
- If true, vectors are generated on surface of hypersphere; if false, throughout
volume of hypersphereradius
- Radius of hypersphereaxisClusterFactor
- Value between 0 and 1, with higher values indicating greater clustering
of vectors around axes. 0 means even distribution; 1 means all vectors on axes.
RandomHypersphereVG
public RandomHypersphereVG()
- Uses default settings (on surface; radius 1; no axis cluster)
getOnSurface
public boolean getOnSurface()
- Returns:
- True if generated vectors are on surface of hypersphere
setOnSurface
public void setOnSurface(boolean onSurface)
- Parameters:
onSurface
- True if generated vectors are on surface of hypersphere
getRadius
public float getRadius()
- Returns:
- Radius of hypersphere
setRadius
public void setRadius(float radius)
- Parameters:
radius
- Radius of hypersphere
getAxisClusterFactor
public float getAxisClusterFactor()
- Returns:
- Value between 0 and 1, with higher values indicating greater clustering
of vectors around axes. 0 means even distribution; 1 means all vectors on axes.
setAxisClusterFactor
public void setAxisClusterFactor(float axisClusterFactor)
- Parameters:
axisClusterFactor
- Value between 0 and 1, with higher values indicating greater clustering
of vectors around axes. 0 means even distribution; 1 means all vectors on axes.
genVectors
public float[][] genVectors(int number,
int dimension)
- Description copied from interface:
VectorGenerator
- The vector distribution is decided by implementing classes.
- Specified by:
genVectors
in interface VectorGenerator
- Parameters:
number
- Number of vectors to be returneddimension
- Dimension of the vectors to be returned
- Returns:
- A List of float[] vectors
- See Also:
VectorGenerator.genVectors(int, int)