All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.functions.pace.DiscreteFunction

java.lang.Object
    |
    +----weka.classifiers.functions.pace.DiscreteFunction

public class DiscreteFunction
extends java.lang.Object
Class for handling discrete functions.

A discrete function here is one that takes non-zero values over a finite set of points.

Version:
$Revision: 1.1 $
Author:
Yong Wang (yongwang@cs.waikato.ac.nz)

Constructor Index

 o DiscreteFunction()
Constructs an empty discrete function
 o DiscreteFunction(DoubleVector)
Constructs a discrete function with the point values provides and the function values are all 1/n.
 o DiscreteFunction(DoubleVector, DoubleVector)
Constructs a discrete function with both the point values and function values provided.

Method Index

 o clone()
Clones the discrete function
 o getFunctionValue(int)
Gets a particular function value
 o getPointValue(int)
Gets a particular point value
 o isEmpty()
Returns true if it is empty.
 o main(String[])
 
 o normalize()
Normalizes the function values with L1-norm.
 o plus(DiscreteFunction)
Returns the combined of two discrete functions
 o plusEquals(DiscreteFunction)
Returns the combined of two discrete functions.
 o setFunctionValue(int, double)
Sets a particular function value
 o setPointValue(int, double)
Sets a particular point value
 o size()
Returns the size of the point set.
 o sort()
Sorts the point values of the discrete function.
 o timesEquals(double)
All function values are multiplied by a double
 o toString()
Converts the discrete function to string.
 o unique()
Makes each individual point value unique

Constructor Detail

 o DiscreteFunction
public DiscreteFunction()
          Constructs an empty discrete function
 o DiscreteFunction
public DiscreteFunction(DoubleVector p)
          Constructs a discrete function with the point values provides and the function values are all 1/n.
Parameters:
p - the point values
 o DiscreteFunction
public DiscreteFunction(DoubleVector p,
                        DoubleVector v)
          Constructs a discrete function with both the point values and function values provided.
Parameters:
p - the point values
v - the function values

Method Detail

 o normalize
public DiscreteFunction normalize()
          Normalizes the function values with L1-norm.
 o sort
public void sort()
          Sorts the point values of the discrete function.
 o clone
public java.lang.Object clone()
          Clones the discrete function
 o unique
public DiscreteFunction unique()
          Makes each individual point value unique
 o size
public int size()
          Returns the size of the point set.
 o getPointValue
public double getPointValue(int i)
          Gets a particular point value
Parameters:
i - the index
 o getFunctionValue
public double getFunctionValue(int i)
          Gets a particular function value
Parameters:
i - the index
 o setPointValue
public void setPointValue(int i,
                          double p)
          Sets a particular point value
Parameters:
i - the index
 o setFunctionValue
public void setFunctionValue(int i,
                             double v)
          Sets a particular function value
Parameters:
i - the index
 o isEmpty
public boolean isEmpty()
          Returns true if it is empty.
 o plus
public DiscreteFunction plus(DiscreteFunction d)
          Returns the combined of two discrete functions
Parameters:
d - the second discrete function
Returns:
the combined discrte function
 o plusEquals
public DiscreteFunction plusEquals(DiscreteFunction d)
          Returns the combined of two discrete functions. The first function is replaced with the new one.
Parameters:
d - the second discrete function
Returns:
the combined discrte function
 o timesEquals
public DiscreteFunction timesEquals(double x)
          All function values are multiplied by a double
Parameters:
x - the multiplier
 o toString
public java.lang.String toString()
          Converts the discrete function to string.
Overrides:
toString in class java.lang.Object
 o main
public static void main(java.lang.String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home