ca.nengo.math.impl
Class IndicatorPDF

java.lang.Object
  extended by ca.nengo.math.impl.IndicatorPDF
All Implemented Interfaces:
Function, PDF, java.io.Serializable, java.lang.Cloneable

public class IndicatorPDF
extends java.lang.Object
implements PDF

Uniform probability between upper and lower limits, zero elsewhere.

Author:
Bryan Tripp
See Also:
Serialized Form

Constructor Summary
IndicatorPDF(float exact)
           
IndicatorPDF(float low, float high)
           
 
Method Summary
 PDF clone()
           
 float getDensity()
           
 int getDimension()
           
 float getHigh()
           
 float getLow()
           
 float map(float[] from)
           
 float[] multiMap(float[][] from)
           
 float[] sample()
           
 void setHigh(float high)
           
 void setLow(float low)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndicatorPDF

public IndicatorPDF(float low,
                    float high)
Parameters:
low - Lower limit of range of possible values
high - Upper limit of range of possible values

IndicatorPDF

public IndicatorPDF(float exact)
Parameters:
exact - A value at which the PDF is infinity (zero at other values)
Method Detail

setLow

public void setLow(float low)
Parameters:
low - Lower limit of range of possible values

setHigh

public void setHigh(float high)
Parameters:
high - Upper limit of range of possible values

getLow

public float getLow()
Returns:
Lower limit of range of possible values

getHigh

public float getHigh()
Returns:
Upper limit of range of possible values

getDensity

public float getDensity()
Returns:
Probability density between low and high limits

sample

public float[] sample()
Specified by:
sample in interface PDF
Returns:
A random sample from this density
See Also:
PDF.sample()

getDimension

public int getDimension()
Specified by:
getDimension in interface Function
Returns:
1
See Also:
Function.getDimension()

map

public float map(float[] from)
Specified by:
map in interface Function
Parameters:
from - Must have same length as getDimension()
Returns:
result of function operation on arg
See Also:
Function.map(float[])

multiMap

public float[] multiMap(float[][] from)
Specified by:
multiMap in interface Function
Parameters:
from - An array of arguments; each element must have length getDimension().
Returns:
Array of results of function operation on each arg
See Also:
Function.multiMap(float[][])

clone

public PDF clone()
          throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Function
Specified by:
clone in interface PDF
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException