org.encog.util.arrayutil
Class WindowDouble
- java.lang.Object
-
- org.encog.util.arrayutil.WindowDouble
-
public class WindowDouble extends java.lang.ObjectThis class implements a simple sliding window. Arrays of doubles can be added to the window. The sliding window will fill up to the specified size. Additional entries will cause the oldest entries to fall off.
-
-
Constructor Summary
Constructors Constructor and Description WindowDouble(int theSize)Construct the window.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(double[] a)Add an array to the window.doublecalculateMax(int index, int starting)Calculate the max value, for the specified index, over all of the data in the window.doublecalculateMin(int index, int starting)Calculate the max value, for the specified index, over all of the data in the window.voidclear()Clear the contents of the window.double[]getLast()Get the last value from the window.booleanisFull()
-
-
-
Constructor Detail
-
WindowDouble
public WindowDouble(int theSize)
Construct the window.- Parameters:
theSize- The size of the window.
-
-
Method Detail
-
add
public void add(double[] a)
Add an array to the window.- Parameters:
a- The array.
-
clear
public void clear()
Clear the contents of the window.
-
isFull
public boolean isFull()
- Returns:
- True, if the window is full.
-
calculateMax
public double calculateMax(int index, int starting)Calculate the max value, for the specified index, over all of the data in the window.- Parameters:
index- The index of the value to compare.starting- The starting position, inside the window to compare at.- Returns:
- THe max value.
-
calculateMin
public double calculateMin(int index, int starting)Calculate the max value, for the specified index, over all of the data in the window.- Parameters:
index- The index of the value to compare.starting- The starting position, inside the window to compare at.- Returns:
- THe max value.
-
getLast
public double[] getLast()
Get the last value from the window. This is the most recent item added.- Returns:
- The last value from the window.
-
-
DMelt 3.0 © DataMelt by jWork.ORG