ca.nengo.util.impl
Class StatefulIndexFinder
java.lang.Object
ca.nengo.util.impl.StatefulIndexFinder
- All Implemented Interfaces:
- IndexFinder, java.lang.Cloneable
public class StatefulIndexFinder
- extends java.lang.Object
- implements IndexFinder
An IndexFinder that searches linearly, starting where the last answer was. This is
a good choice if many interpolations will be made on the same series, and adjacent
requests will be close to each other.
TODO: test
- Author:
- Bryan Tripp
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StatefulIndexFinder
public StatefulIndexFinder(float[] values)
- Parameters:
values
- Must be monotonically increasing.
findIndexBelow
public int findIndexBelow(float value)
- Specified by:
findIndexBelow
in interface IndexFinder
- Parameters:
value
- A floating-point value that the list is expected to span
- Returns:
- The index of the largest value in the list which is smaller than
the 'value' arg
areMonotonicallyIncreasing
public static boolean areMonotonicallyIncreasing(float[] values)
- Parameters:
values
- A list of values
- Returns:
- True if list values increases monotonically, false otherwise
clone
public StatefulIndexFinder clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface IndexFinder
- Overrides:
clone
in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException