Nengo.ca

ca.nengo.util.impl
Class RandomHypersphereVG

java.lang.Object
  extended by 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

See Also:
Serialized Form

Constructor Summary
RandomHypersphereVG()
          Uses default settings (on surface; radius 1; no axis cluster)
RandomHypersphereVG(boolean surface, float radius, float axisClusterFactor)
           
 
Method Summary
 float[][] genVectors(int number, int dimension)
          The vector distribution is decided by implementing classes.
 float getAxisClusterFactor()
           
 boolean getOnSurface()
           
 float getRadius()
           
 void setAxisClusterFactor(float axisClusterFactor)
           
 void setOnSurface(boolean onSurface)
           
 void setRadius(float radius)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 hypersphere
radius - Radius of hypersphere
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.

RandomHypersphereVG

public RandomHypersphereVG()
Uses default settings (on surface; radius 1; no axis cluster)

Method Detail

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 returned
dimension - Dimension of the vectors to be returned
Returns:
A List of float[] vectors
See Also:
VectorGenerator.genVectors(int, int)

Nengo.ca