org.encog.util.arrayutil
Class WindowDouble

java.lang.Object
  extended by org.encog.util.arrayutil.WindowDouble

public class WindowDouble
extends Object

This 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
WindowDouble(int theSize)
          Construct the window.
 
Method Summary
 void add(double[] a)
          Add an array to the window.
 double calculateMax(int index, int starting)
          Calculate the max value, for the specified index, over all of the data in the window.
 double calculateMin(int index, int starting)
          Calculate the max value, for the specified index, over all of the data in the window.
 void clear()
          Clear the contents of the window.
 double[] getLast()
          Get the last value from the window.
 boolean isFull()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


Copyright © 2014. All Rights Reserved.