de.lmu.ifi.dbs.elki.data
Class ParameterizationFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.AbstractNumberVector<DoubleVector,Double>
      extended by de.lmu.ifi.dbs.elki.data.DoubleVector
          extended by de.lmu.ifi.dbs.elki.data.ParameterizationFunction
All Implemented Interfaces:
FeatureVector<DoubleVector,Double>, NumberVector<DoubleVector,Double>, SpatialComparable, ByteBufferSerializer<DoubleVector>, TextWriteable

public class ParameterizationFunction
extends DoubleVector
implements TextWriteable

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.


Nested Class Summary
static class ParameterizationFunction.ExtremumType
          Available types for the global extremum.
 
Field Summary
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.
 
Fields inherited from class de.lmu.ifi.dbs.elki.data.AbstractNumberVector
ATTRIBUTE_SEPARATOR
 
Constructor Summary
ParameterizationFunction(double[] values)
          Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.
ParameterizationFunction(Double[] values)
          Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.
ParameterizationFunction(List<Double> values)
          Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.
ParameterizationFunction(Vector columnMatrix)
          Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.
 
Method Summary
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 at alpha.
 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,...
 DoubleVector newInstance(double[] values)
          Returns a new NumberVector of N for the given values.
 DoubleVector newInstance(Double[] values)
          Returns a new FeatureVector of V for the given values.
 DoubleVector newInstance(List<Double> values)
          Returns a new FeatureVector of V for the given values.
 DoubleVector newInstance(Vector values)
          Returns a new NumberVector of N for the given values.
private  double sinusProduct(int start, int end, double[] alpha)
          Computes the product of all sinus values of the specified angles from start to end index.
 String toString()
          Returns a string representation of the object.
 String toString(int offset)
          Returns a string representation of the object with the specified offset.
 void writeToText(TextWriterStream out, String label)
          Write self to the given TextWriterStream
 
Methods inherited from class de.lmu.ifi.dbs.elki.data.DoubleVector
doubleValue, fromByteBuffer, getByteSize, getColumnVector, getDimensionality, getRowVector, getValue, getValues, longValue, minus, multiplicate, negativeVector, nullVector, plus, scalarProduct, toByteBuffer
 
Methods inherited from class de.lmu.ifi.dbs.elki.data.AbstractNumberVector
byteValue, equals, floatValue, getMax, getMin, hashCode, intValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.

Constructor Detail

ParameterizationFunction

public ParameterizationFunction(double[] values)
Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.

Parameters:
values - the values of the point p

ParameterizationFunction

public ParameterizationFunction(Double[] values)
Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.

Parameters:
values - the values of the point p

ParameterizationFunction

public ParameterizationFunction(List<Double> values)
Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.

Parameters:
values - the values of the point p

ParameterizationFunction

public ParameterizationFunction(Vector columnMatrix)
Provides a new parameterization function describing all lines in a d-dimensional feature space intersecting in one point p.

Parameters:
columnMatrix - the values of the point p
Method Detail

function

public double function(double[] alpha)
Computes the function value at alpha.

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 computed
alpha_extreme - the already computed alpha values
interval - 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 determined
alpha_min - the already computed alpha values
interval - 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 determined
alpha_max - the already computed alpha values
interval - 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 String toString()
Returns a string representation of the object.

Specified by:
toString in interface FeatureVector<DoubleVector,Double>
Overrides:
toString in class DoubleVector
Returns:
a string representation of the object.

toString

public 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

private 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 start
end - the index to end
alpha - 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 angle
alpha - the already determined alpha_values for the extremum
Returns:
the value for alpha_n where this function has a (local) extremum

writeToText

public void writeToText(TextWriterStream out,
                        String label)
Description copied from interface: TextWriteable
Write self to the given TextWriterStream

Specified by:
writeToText in interface TextWriteable
Parameters:
out - Output writer
label - Label

newInstance

public DoubleVector newInstance(double[] values)
Description copied from interface: NumberVector
Returns a new NumberVector of N for the given values.

Specified by:
newInstance in interface NumberVector<DoubleVector,Double>
Overrides:
newInstance in class DoubleVector
Parameters:
values - the values of the NumberVector
Returns:
a new NumberVector of N for the given values

newInstance

public DoubleVector newInstance(Vector values)
Description copied from interface: NumberVector
Returns a new NumberVector of N for the given values.

Specified by:
newInstance in interface NumberVector<DoubleVector,Double>
Overrides:
newInstance in class DoubleVector
Parameters:
values - the values of the NumberVector
Returns:
a new NumberVector of N for the given values

newInstance

public DoubleVector newInstance(Double[] values)
Description copied from interface: FeatureVector
Returns a new FeatureVector of V for the given values.

Specified by:
newInstance in interface FeatureVector<DoubleVector,Double>
Overrides:
newInstance in class DoubleVector
Parameters:
values - the values of the featureVector
Returns:
a new FeatureVector of V for the given values

newInstance

public DoubleVector newInstance(List<Double> values)
Description copied from interface: FeatureVector
Returns a new FeatureVector of V for the given values.

Specified by:
newInstance in interface FeatureVector<DoubleVector,Double>
Overrides:
newInstance in class DoubleVector
Parameters:
values - the values of the featureVector
Returns:
a new FeatureVector of V for the given values

Release 0.4.0 (2011-09-20_1324)