org.encog.ml.data.buffer.codec
Class ArrayDataCODEC

java.lang.Object
  extended by org.encog.ml.data.buffer.codec.ArrayDataCODEC
All Implemented Interfaces:
DataSetCODEC

public class ArrayDataCODEC
extends Object
implements DataSetCODEC

A CODEC used for arrays.


Constructor Summary
ArrayDataCODEC()
          Default constructor.
ArrayDataCODEC(double[][] theInput, double[][] theIdeal)
          Construct an array CODEC.
 
Method Summary
 void close()
          Close any open files.
 double[][] getIdeal()
           
 int getIdealSize()
          
 double[][] getInput()
           
 int getInputSize()
          
 void prepareRead()
          Prepare to read from an external data source.
 void prepareWrite(int recordCount, int theInputSize, int theIdealSize)
          Prepare to write to an external data destination.
 boolean read(double[] theInput, double[] theIdeal)
          Read one record of data from an external source.
 void write(double[] theInput, double[] theIdeal)
          Write one record of data to an external destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayDataCODEC

public ArrayDataCODEC(double[][] theInput,
                      double[][] theIdeal)
Construct an array CODEC.

Parameters:
theInput - The input array.
theIdeal - The ideal array.

ArrayDataCODEC

public ArrayDataCODEC()
Default constructor.

Method Detail

getInputSize

public final int getInputSize()

Specified by:
getInputSize in interface DataSetCODEC
Returns:
The size of the input data.

getIdealSize

public final int getIdealSize()

Specified by:
getIdealSize in interface DataSetCODEC
Returns:
The size of the ideal data.

read

public final boolean read(double[] theInput,
                          double[] theIdeal)
Read one record of data from an external source.

Specified by:
read in interface DataSetCODEC
Parameters:
theInput - The input data array.
theIdeal - The ideal data array.
Returns:
True, if there is more data to be read.

write

public final void write(double[] theInput,
                        double[] theIdeal)
Write one record of data to an external destination.

Specified by:
write in interface DataSetCODEC
Parameters:
theInput - The input data array.
theIdeal - The ideal data array.

prepareWrite

public final void prepareWrite(int recordCount,
                               int theInputSize,
                               int theIdealSize)
Prepare to write to an external data destination.

Specified by:
prepareWrite in interface DataSetCODEC
Parameters:
recordCount - The total record count, that will be written.
theInputSize - The input size.
theIdealSize - The ideal size.

getInput

public final double[][] getInput()
Returns:
The input array.

getIdeal

public final double[][] getIdeal()
Returns:
The ideal array.

prepareRead

public void prepareRead()
Prepare to read from an external data source.

Specified by:
prepareRead in interface DataSetCODEC

close

public void close()
Close any open files.

Specified by:
close in interface DataSetCODEC


Copyright © 2011. All Rights Reserved.