epfl.pdf
Class VectorPCATransform

java.lang.Object
  |
  +--epfl.pdf.VectorPCATransform
All Implemented Interfaces:
VectorReader

public class VectorPCATransform
extends java.lang.Object
implements VectorReader

A Principal component analysis transformation on a vector reader


Constructor Summary
VectorPCATransform(VectorReader in, int nComponent, double[][] eigenvectors, double[] eigenvalues)
          Creates a new PCA transformation for the underlying vector reader
 
Method Summary
 void close()
          Closes the stream
 int period()
          Returns the stream period
 double[] read()
          Reads a vector in stream
 int size()
          Returns the stream size (vector size)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorPCATransform

public VectorPCATransform(VectorReader in,
                          int nComponent,
                          double[][] eigenvectors,
                          double[] eigenvalues)
Creates a new PCA transformation for the underlying vector reader
Parameters:
in - the underlying vector reader
nComponent - the number of principal components.
eigenVectors - the eigen vectors
eigenValues - the eigen values associated
Method Detail

read

public double[] read()
              throws java.io.IOException
Reads a vector in stream
Specified by:
read in interface VectorReader
Throws:
java.io.IOException - if the stream is closed or if it is unable to read size doubles

size

public int size()
Returns the stream size (vector size)
Specified by:
size in interface VectorReader

period

public int period()
Returns the stream period
Specified by:
period in interface VectorReader
Returns:
0 if the stream is not periodic

close

public void close()
           throws java.io.IOException
Closes the stream
Specified by:
close in interface VectorReader
Throws:
java.io.IOException - an IO error occurs