|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.functions.pace.DiscreteFunction
public class DiscreteFunction
Class for handling discrete functions.
A discrete function here is one that takes non-zero values over a finite set of points.
| Constructor Summary | |
|---|---|
DiscreteFunction()
Constructs an empty discrete function |
|
DiscreteFunction(DoubleVector p)
Constructs a discrete function with the point values provides and the function values are all 1/n. |
|
DiscreteFunction(DoubleVector p,
DoubleVector v)
Constructs a discrete function with both the point values and function values provided. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones the discrete function |
double |
getFunctionValue(int i)
Gets a particular function value |
double |
getPointValue(int i)
Gets a particular point value |
java.lang.String |
getRevision()
Returns the revision string. |
boolean |
isEmpty()
Returns true if it is empty. |
static void |
main(java.lang.String[] args)
|
DiscreteFunction |
normalize()
Normalizes the function values with L1-norm. |
DiscreteFunction |
plus(DiscreteFunction d)
Returns the combined of two discrete functions |
DiscreteFunction |
plusEquals(DiscreteFunction d)
Returns the combined of two discrete functions. |
void |
setFunctionValue(int i,
double v)
Sets a particular function value |
void |
setPointValue(int i,
double p)
Sets a particular point value |
int |
size()
Returns the size of the point set. |
void |
sort()
Sorts the point values of the discrete function. |
DiscreteFunction |
timesEquals(double x)
All function values are multiplied by a double |
java.lang.String |
toString()
Converts the discrete function to string. |
DiscreteFunction |
unique()
Makes each individual point value unique |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DiscreteFunction()
public DiscreteFunction(DoubleVector p)
p - the point values
public DiscreteFunction(DoubleVector p,
DoubleVector v)
p - the point valuesv - the function values| Method Detail |
|---|
public DiscreteFunction normalize()
public void sort()
public java.lang.Object clone()
clone in class java.lang.Objectpublic DiscreteFunction unique()
public int size()
public double getPointValue(int i)
i - the indexpublic double getFunctionValue(int i)
i - the index
public void setPointValue(int i,
double p)
i - the index
public void setFunctionValue(int i,
double v)
i - the indexpublic boolean isEmpty()
public DiscreteFunction plus(DiscreteFunction d)
d - the second discrete function
public DiscreteFunction plusEquals(DiscreteFunction d)
d - the second discrete function
public DiscreteFunction timesEquals(double x)
x - the multiplierpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlerpublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||