|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMathUtil
public class MathUtil
class that round off floating point numbers to the specified number of decimal places givem
Field Summary | |
---|---|
static long |
RAND_SEED
|
static java.util.Random |
random
|
Constructor Summary | |
---|---|
MathUtil()
Default constructor. |
Method Summary | |
---|---|
static boolean |
almostEqual(double val1,
double val2)
method sees if input doubles are "almost" equal |
static boolean |
almostEqual(java.util.Vector vec1,
double val2)
method sees if input vectors are "almost" equal |
static boolean |
almostEqual(java.util.Vector vec1,
java.util.Vector vec2)
method sees if input vectors are "almost" equal |
static void |
betweenClass(DataPoints d,
Matrix M,
double rx_a,
double ry_a)
this method determines the between class scatter matrix for the class independent linear discrimination algorithm |
static MyPoint |
computeClusterMean(java.util.Vector vec)
methods computes and returns the mean of the given cluster |
static MyPoint |
computeMyPointMean(java.util.Vector vec)
methods computes and returns the mean of the given cluster |
static MyPoint |
computePointMean(java.util.Vector vec)
methods computes and returns the mean of the given cluster |
static void |
copyVector(java.util.Vector<java.lang.Double> vec1_a,
java.util.Vector<java.lang.Double> vec2_a,
int length_a,
int index1_a,
int index2_a)
Copies vector given specific parameters |
static double |
distance(double x1,
double y1,
double x2,
double y2)
calculate the euclidean distance between the two points |
static double |
doubleValue(java.util.Vector<java.lang.Double> vec_a,
int index_a)
gets the double value of the input vector at the index passed |
static double |
grand(double mean,
double stddev)
method generates a random distribution centered about the mean with a variance that is specified by the standard deviation. |
static void |
initDoubleVector(java.util.Vector<java.lang.Double> vec_a,
double value_a)
initializes components of vector to double value passed |
static double |
linearKernel(java.util.Vector point1,
java.util.Vector point2)
this method evaluates the linear Kernel on the input vectors K(x,y) = (x . |
static double |
polynomialKernel(java.util.Vector points1,
java.util.Vector points2)
this method evaluates the second degree polynomial Kernel on the input vectors K(x,y) = (x . |
static double |
rbfKernel(java.util.Vector point1,
java.util.Vector point2)
this method evaluates the redial basis function Kernel on the input vectors with standard deviation sigma K(x,y) = exp(-gamma * ((a.a)-2*(a.b)+(b.b))) |
static double |
rbfKernel(java.util.Vector point1,
java.util.Vector point2,
double gamma_a)
this method evaluates the redial basis function Kernel on the input vectors with standard deviation sigma K(x,y) = exp(-gamma * ((a.a)-2*(a.b)+(b.b))) |
static double |
setDecimal(double doubleNumber,
int decimalPlaces)
method takes in a decimal number and rounds to the given number of decimal places passed |
static double |
SetDecimal(double doubleNumber,
int decimalPlaces)
method to round off floating point numbers to the specified number of decimal places given |
static double |
vectorProduct(java.util.Vector vec1,
java.util.Vector vec2)
this method evaluates the vector dot product |
static void |
withinClass(DataPoints data_a,
double rx_a,
double ry_a)
Within Class |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long RAND_SEED
public static final java.util.Random random
Constructor Detail |
---|
public MathUtil()
Method Detail |
---|
public static double grand(double mean, double stddev)
mean
- mean of the distributionstddev
- standard deviation of the distribution
public static double SetDecimal(double doubleNumber, int decimalPlaces)
doubleNumber
- input numberdecimalPlaces
- number of decimal places to roundpublic static double distance(double x1, double y1, double x2, double y2)
x1
- x-coordinate of the first pointy1
- y-coordinate of the first pointx2
- x-coordinate of the second pointy2
- y-coordinate of the second point
public static MyPoint computeClusterMean(java.util.Vector vec)
vec
- Vector of points from the cluster
public static MyPoint computePointMean(java.util.Vector vec)
vec
- Vector of points from the cluster
public static MyPoint computeMyPointMean(java.util.Vector vec)
vec
- point from the cluster
public static double setDecimal(double doubleNumber, int decimalPlaces)
doubleNumber
- input numberdecimalPlaces
- number of significant decimal places
public static double linearKernel(java.util.Vector point1, java.util.Vector point2)
point1
- First vector of pointspoint2
- Second vector of points
public static double rbfKernel(java.util.Vector point1, java.util.Vector point2)
point1
- First vector of pointspoint2
- Second vector of points
public static double rbfKernel(java.util.Vector point1, java.util.Vector point2, double gamma_a)
point1
- First vector of pointspoint2
- Second vector of pointsgamma_a
- Double value of gamma
public static double polynomialKernel(java.util.Vector points1, java.util.Vector points2)
points1
- First vector of pointspoints2
- Second vector of points
public static double vectorProduct(java.util.Vector vec1, java.util.Vector vec2)
vec1
- First vector of pointsvec2
- Second vector of points
public static boolean almostEqual(java.util.Vector vec1, java.util.Vector vec2)
vec1
- First vector of pointsvec2
- Second vector of points
public static boolean almostEqual(java.util.Vector vec1, double val2)
vec1
- First vector of pointsval2
- Value to compare to
public static boolean almostEqual(double val1, double val2)
val1
- First double valueval2
- Second double value
public static void initDoubleVector(java.util.Vector<java.lang.Double> vec_a, double value_a)
vec_a
- point from the clustervalue_a
- value to set to vectorpublic static double doubleValue(java.util.Vector<java.lang.Double> vec_a, int index_a)
vec_a
- point from the clusterindex_a
-
public static void copyVector(java.util.Vector<java.lang.Double> vec1_a, java.util.Vector<java.lang.Double> vec2_a, int length_a, int index1_a, int index2_a)
vec1_a
- vector to be overwritten/copyied tovec2_a
- vector to be copied fromlength_a
- number of elements to be copyiedindex1_a
- index to start copying to first vectorindex2_a
- index to start copying from second vectorpublic static void withinClass(DataPoints data_a, double rx_a, double ry_a)
data_a
- input data pointsrx_a
- double input of xry_a
- double input of ypublic static void betweenClass(DataPoints d, Matrix M, double rx_a, double ry_a)
d
- input data pointsM
- between class scatter matrixrx_a
- double input of xry_a
- double input of y
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |