Package elki.clustering.correlation.cash
Class ParameterizationFunction
- java.lang.Object
-
- elki.clustering.correlation.cash.ParameterizationFunction
-
public class ParameterizationFunction extends java.lang.Object
A parameterization function describes all lines in a d-dimensional feature space intersecting in one point p. A single line in d-dimensional space is uniquely determined by a translation vector p and (d-1) angles alpha_i belonging to the normal vector n.- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParameterizationFunction.ExtremumType
Available types for the global extremum.
-
Field Summary
Fields Modifier and Type Field Description private double[]
alphaExtremum
Holds the alpha values of the global extremum.static double
DELTA
A small number to handle numbers near 0 as 0.private ParameterizationFunction.ExtremumType
extremumType
Holds the type of the global extremum.private NumberVector
vec
The actual vector.
-
Constructor Summary
Constructors Constructor Description ParameterizationFunction(NumberVector vec)
Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
determineAlphaMax(int n, double[] alpha_max, HyperBoundingBox interval)
Determines the n-th alpha value where this function has a maximum in the specified interval.private double
determineAlphaMin(int n, double[] alpha_min, HyperBoundingBox interval)
Determines the n-th alpha value where this function has a minimum in the specified interval.HyperBoundingBox
determineAlphaMinMax(HyperBoundingBox interval)
Determines the alpha values where this function has a minumum and maximum value in the given interval.private void
determineGlobalExtremum()
Determines the global extremum of this parameterization function.private void
determineGlobalExtremumType()
Determines the type of the global extremum.private double
extremum_alpha_n(int n, double[] alpha)
Determines the value for alpha_n where this function has a (local) extremum.private ParameterizationFunction.ExtremumType
extremumType(int n, double[] alpha_extreme, HyperBoundingBox interval)
Returns the type of the extremum at the specified alpha values.double
function(double[] alpha)
Computes the function value atalpha
.double[]
getColumnVector()
Get the actual vector used (as copy).int
getDimensionality()
Get the vector dimensionality.double[]
getGlobalAlphaExtremum()
Returns the alpha values of the extremum point in interval [(0,...,0), (Pi,...double
getGlobalExtremum()
Returns the global extremum of this function in interval [0,...ParameterizationFunction.ExtremumType
getGlobalExtremumType()
Returns the type of the global extremum in interval [0,...static double
sinusProduct(int start, int end, double[] alpha)
Computes the product of all sinus values of the specified angles from start to end index.java.lang.String
toString()
Returns a string representation of the object.java.lang.String
toString(int offset)
Returns a string representation of the object with the specified offset.
-
-
-
Field Detail
-
DELTA
public static final double DELTA
A small number to handle numbers near 0 as 0.- See Also:
- Constant Field Values
-
alphaExtremum
private double[] alphaExtremum
Holds the alpha values of the global extremum.
-
extremumType
private ParameterizationFunction.ExtremumType extremumType
Holds the type of the global extremum.
-
vec
private NumberVector vec
The actual vector.
-
-
Constructor Detail
-
ParameterizationFunction
public ParameterizationFunction(NumberVector vec)
Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.- Parameters:
vec
- Existing vector
-
-
Method Detail
-
function
public double function(double[] alpha)
Computes the function value atalpha
.- Parameters:
alpha
- the values of the d-1 angles- Returns:
- the function value at alpha
-
determineAlphaMinMax
public HyperBoundingBox determineAlphaMinMax(HyperBoundingBox interval)
Determines the alpha values where this function has a minumum and maximum value in the given interval.- Parameters:
interval
- the hyper bounding box defining the interval- Returns:
- he alpha values where this function has a minumum and maximum value in the given interval
-
extremumType
private ParameterizationFunction.ExtremumType extremumType(int n, double[] alpha_extreme, HyperBoundingBox interval)
Returns the type of the extremum at the specified alpha values.- Parameters:
n
- the index until the alpha values are computedalpha_extreme
- the already computed alpha valuesinterval
- the hyper bounding box defining the interval in which the extremum occurs- Returns:
- the type of the extremum at the specified alpha_values
-
determineAlphaMin
private double determineAlphaMin(int n, double[] alpha_min, HyperBoundingBox interval)
Determines the n-th alpha value where this function has a minimum in the specified interval.- Parameters:
n
- the index of the alpha value to be determinedalpha_min
- the already computed alpha valuesinterval
- the hyper bounding box defining the interval- Returns:
- the n-th alpha value where this function has a minimum in the specified interval
-
determineAlphaMax
private double determineAlphaMax(int n, double[] alpha_max, HyperBoundingBox interval)
Determines the n-th alpha value where this function has a maximum in the specified interval.- Parameters:
n
- the index of the alpha value to be determinedalpha_max
- the already computed alpha valuesinterval
- the hyper bounding box defining the interval- Returns:
- the n-th alpha value where this function has a minimum in the specified interval
-
getGlobalAlphaExtremum
public double[] getGlobalAlphaExtremum()
Returns the alpha values of the extremum point in interval [(0,...,0), (Pi,...,Pi)].- Returns:
- the alpha values of the extremum
-
getGlobalExtremum
public double getGlobalExtremum()
Returns the global extremum of this function in interval [0,...,Pi)^d-1.- Returns:
- the global extremum
-
getGlobalExtremumType
public ParameterizationFunction.ExtremumType getGlobalExtremumType()
Returns the type of the global extremum in interval [0,...,Pi)^d-1.- Returns:
- the type of the global extremum
-
toString
public java.lang.String toString()
Returns a string representation of the object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of the object.
-
toString
public java.lang.String toString(int offset)
Returns a string representation of the object with the specified offset.- Parameters:
offset
- the offset of the string representation- Returns:
- a string representation of the object.
-
sinusProduct
public static double sinusProduct(int start, int end, double[] alpha)
Computes the product of all sinus values of the specified angles from start to end index.- Parameters:
start
- the index to startend
- the index to endalpha
- the array of angles- Returns:
- the product of all sinus values of the specified angles from start to end index
-
determineGlobalExtremum
private void determineGlobalExtremum()
Determines the global extremum of this parameterization function.
-
determineGlobalExtremumType
private void determineGlobalExtremumType()
Determines the type of the global extremum.
-
extremum_alpha_n
private double extremum_alpha_n(int n, double[] alpha)
Determines the value for alpha_n where this function has a (local) extremum.- Parameters:
n
- the index of the anglealpha
- the already determined alpha_values for the extremum- Returns:
- the value for alpha_n where this function has a (local) extremum
-
getColumnVector
public double[] getColumnVector()
Get the actual vector used (as copy).- Returns:
- Vector, for projection
-
getDimensionality
public int getDimensionality()
Get the vector dimensionality.- Returns:
- Vector dimensionality
-
-