Class AlgorithmPF

java.lang.Object
  extended by Algorithm
      extended by AlgorithmPF
All Implemented Interfaces:
java.lang.Runnable

public class AlgorithmPF
extends Algorithm


Constructor Summary
AlgorithmPF()
           
 
Method Summary
 boolean checkdata_PF(java.util.Vector<MyPoint> pf)
          Validates the class entered by user for Partical Filtering
 void drawGaussian(double mean_x_a, double mean_y_a, int set_index_a)
          Draws Gaussian points around each data point
 boolean initialize()
          Implements the initialize() method in the base class.
 void interpol(java.util.Vector<MyPoint> v, java.util.Vector<MyPoint> iset)
          Calculates the interpolated points for the data inputs
 double mean(java.util.Vector<MyPoint> v, java.util.Vector<MyPoint> mv)
          Calculates the mean and the zero-mean data points
 void run()
          Implementation of the run function from the Runnable interface.
 void spline(double[] x, double[] y, double[] y2, int size)
          Actually interpolates the points
 void splint(MyPoint u1, MyPoint u2, MyPoint r, double[] y2, int i)
          Interpolates for a point between the two known points using Cubic Interpolation
 java.util.Vector<MyPoint> transformPCA(int point_index_a, int set_index_a)
          Transforms a given set of points to a new space using the class independent principal component analysis algorithm
 
Methods inherited from class Algorithm
computeMeans, disableControl, enableControl, nextStep, prevStep, scaleToFitData, setDataPoints, setOutputPanel, setProcessBox
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmPF

public AlgorithmPF()
Method Detail

initialize

public boolean initialize()
Implements the initialize() method in the base class. Initializes member data and prepares for execution of first step. This method "resets" the algorithm.

Specified by:
initialize in class Algorithm
Returns:
returns true if sets of data are valid

checkdata_PF

public boolean checkdata_PF(java.util.Vector<MyPoint> pf)
Validates the class entered by user for Partical Filtering

Parameters:
pf -
Returns:
true if data is Vector pf is valid. It is invalid if the size of pf is 1 or any element is larger than the the previous element

run

public void run()
Implementation of the run function from the Runnable interface. Determines what the current step is and calls the appropriate method.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class Algorithm

interpol

public void interpol(java.util.Vector<MyPoint> v,
                     java.util.Vector<MyPoint> iset)
Calculates the interpolated points for the data inputs

Parameters:
v - input data points
iset - interpolated data points

spline

public void spline(double[] x,
                   double[] y,
                   double[] y2,
                   int size)
Actually interpolates the points

Parameters:
x - array containing the x coordinates of datapoints
y - array containing the y coordinates of datapoints
y2 - array containing the interpolated y coordinates
size - the size of the array to be interpolated

splint

public void splint(MyPoint u1,
                   MyPoint u2,
                   MyPoint r,
                   double[] y2,
                   int i)
Interpolates for a point between the two known points using Cubic Interpolation

Parameters:
u1 - start point for the interpolation
u2 - end point for the interpolation
r - returning point, basically the interpolated point
y2 - array used for reassigning of r
i - the sample number

mean

public double mean(java.util.Vector<MyPoint> v,
                   java.util.Vector<MyPoint> mv)
Calculates the mean and the zero-mean data points

Parameters:
v - orginal datapoints
mv - zero mean datapoints
Returns:
The average in a double

drawGaussian

public void drawGaussian(double mean_x_a,
                         double mean_y_a,
                         int set_index_a)
Draws Gaussian points around each data point

Parameters:
mean_x_a - double x value of mean point
mean_y_a - double y value of mean point
set_index_a - which data set of points to draw gaussian

transformPCA

public java.util.Vector<MyPoint> transformPCA(int point_index_a,
                                              int set_index_a)
Transforms a given set of points to a new space using the class independent principal component analysis algorithm

Parameters:
point_index_a - the index in the data vector to use
set_index_a - the set to use
Returns:
a vector of points in a circle