Nengo.ca

ca.nengo.math.impl
Class Polynomial

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

public class Polynomial
extends AbstractFunction
implements Function

A one-dimensional polynomial Function. It is defined by a series of coefficients that must be given in the constructor.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.nengo.math.impl.AbstractFunction
DIMENSION_PROPERTY
 
Constructor Summary
Polynomial(float[] coefficients)
           
 
Method Summary
 Function clone()
           
 float[] getCoefficients()
           
 int getOrder()
           
 float map(float[] from)
           
 void setCoefficients(float[] coefficients)
           
 void setOrder(int order)
           
 
Methods inherited from class ca.nengo.math.impl.AbstractFunction
getCode, getDimension, getName, multiMap, setCode, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.nengo.math.Function
getDimension, multiMap
 

Constructor Detail

Polynomial

public Polynomial(float[] coefficients)
Parameters:
coefficients - Coefficients [a0 a1 a2 ...] in polynomial y = a0 + a1x + a2x^2 + ...
Method Detail

getOrder

public int getOrder()
Returns:
Polynomial order

setOrder

public void setOrder(int order)
Parameters:
order - Polynomial order

getCoefficients

public float[] getCoefficients()
Returns:
Coefficients [a0 a1 a2 ...] in polynomial y = a0 + a1x + a2x^2 + ...

setCoefficients

public void setCoefficients(float[] coefficients)
Parameters:
coefficients - Coefficients [a0 a1 a2 ...] in polynomial y = a0 + a1x + a2x^2 + ...

map

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

clone

public Function clone()
               throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Function
Overrides:
clone in class AbstractFunction
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - is super does not support clone

Nengo.ca