Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.data
Interface NumberVector<V extends NumberVector<V,N>,N extends Number>

Type Parameters:
V - the type of NumberVector implemented by a subclass
N - the type of the attribute values
All Superinterfaces:
DatabaseObject, FeatureVector<V,N>, SpatialComparable, SpatialObject
All Known Implementing Classes:
AbstractNumberVector, BitVector, DoubleVector, FloatVector, ParameterizationFunction, SparseFloatVector

public interface NumberVector<V extends NumberVector<V,N>,N extends Number>
extends FeatureVector<V,N>, SpatialObject

Interface NumberVector defines the methods that should be implemented by any Object that is element of a real vector space of type N.

Author:
Arthur Zimek

Method Summary
 byte byteValue(int dimension)
          Returns the value in the specified dimension as byte.
 double doubleValue(int dimension)
          Returns the value in the specified dimension as double.
 float floatValue(int dimension)
          Returns the value in the specified dimension as float.
 Vector getColumnVector()
          Returns a Vector representing in one column and getDimensionality() rows the values of this NumberVector of V.
 Matrix getRowVector()
          Returns a Matrix representing in one row and getDimensionality() columns the values of this NumberVector of V.
 int intValue(int dimension)
          Returns the value in the specified dimension as int.
 long longValue(int dimension)
          Returns the value in the specified dimension as long.
 V minus(V fv)
          Returns a new NumberVector of V that is the sum of this NumberVector of V and the negativeVector() of given NumberVector of V.
 V multiplicate(double k)
          Returns a new NumberVector of V that is the result of a scalar multiplication with the given scalar.
 V negativeVector()
          Returns the additive inverse to this NumberVector of V.
 V newInstance(double[] values)
          Returns a new NumberVector of N for the given values.
 V newInstance(Vector values)
          Returns a new NumberVector of N for the given values.
 V nullVector()
          Provides a null vector of the same Vector Space as this NumberVector of V (that is, of the same dimensionality).
 V plus(V fv)
          Returns a new NumberVector of V that is the sum of this NumberVector of V and the given NumberVector of V.
 V randomInstance(N min, N max, Random random)
          Returns a NumberVector of V with random values between min and max.
 V randomInstance(Random random)
          Returns a NumberVector of V with uniformly distributed (0-1) random values.
 V randomInstance(V min, V max, Random random)
          Returns a NumberVector of V with random values between min and max.
 N scalarProduct(V fv)
          Provides the scalar product (inner product) of this NumberVector of V and the given NumberVector of V.
 short shortValue(int dimension)
          Returns the value in the specified dimension as short.
 
Methods inherited from interface de.lmu.ifi.dbs.elki.data.FeatureVector
getDimensionality, getValue, newInstance, newInstance, toString
 
Methods inherited from interface de.lmu.ifi.dbs.elki.data.DatabaseObject
equals, getID, setID
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialObject
getID
 
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialComparable
getDimensionality, getMax, getMin
 

Method Detail

randomInstance

V randomInstance(Random random)
Returns a NumberVector of V with uniformly distributed (0-1) random values.

Parameters:
random - a Random instance
Returns:
a NumberVector of V with random values

randomInstance

V randomInstance(N min,
                 N max,
                 Random random)
Returns a NumberVector of V with random values between min and max.

Parameters:
min - minimum of random value
max - maximum of random value
random - a random instance
Returns:
a NumberVector of V with random values between min and max

randomInstance

V randomInstance(V min,
                 V max,
                 Random random)
Returns a NumberVector of V with random values between min and max.

Parameters:
min - minimum of random value for each axis
max - maximum of random value for each axis
random - a random instance
Returns:
a NumberVector of V with random values between min and max

getColumnVector

Vector getColumnVector()
Returns a Vector representing in one column and getDimensionality() rows the values of this NumberVector of V.

Returns:
a Matrix representing in one column and getDimensionality() rows the values of this NumberVector of V

getRowVector

Matrix getRowVector()
Returns a Matrix representing in one row and getDimensionality() columns the values of this NumberVector of V.

Returns:
a Matrix representing in one row and getDimensionality() columns the values of this NumberVector of V

plus

V plus(V fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the given NumberVector of V.

Parameters:
fv - a NumberVector of V to be added to this NumberVector of V
Returns:
a new NumberVector of V that is the sum of this NumberVector of V and the given NumberVector of V

minus

V minus(V fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the negativeVector() of given NumberVector of V.

Parameters:
fv - a NumberVector of V to be subtracted to this NumberVector of V
Returns:
a new NumberVector of V that is the sum of this NumberVector of V and the negative of given NumberVector of V

scalarProduct

N scalarProduct(V fv)
Provides the scalar product (inner product) of this NumberVector of V and the given NumberVector of V.

Parameters:
fv - the NumberVector of V to compute the scalar product for
Returns:
the scalar product (inner product) of this and the given NumberVector of V

nullVector

V nullVector()
Provides a null vector of the same Vector Space as this NumberVector of V (that is, of the same dimensionality).

Returns:
a null vector of the same Vector Space as this NumberVector of V (that is, of the same dimensionality)

negativeVector

V negativeVector()
Returns the additive inverse to this NumberVector of V.

Returns:
the additive inverse to this NumberVector of V

multiplicate

V multiplicate(double k)
Returns a new NumberVector of V that is the result of a scalar multiplication with the given scalar.

Parameters:
k - a scalar to multiply this NumberVector of V with
Returns:
a new NumberVector of V that is the result of a scalar multiplication with the given scalar

newInstance

V newInstance(double[] values)
Returns a new NumberVector of N for the given values.

Parameters:
values - the values of the NumberVector
Returns:
a new NumberVector of N for the given values

newInstance

V newInstance(Vector values)
Returns a new NumberVector of N for the given values.

Parameters:
values - the values of the NumberVector
Returns:
a new NumberVector of N for the given values

doubleValue

double doubleValue(int dimension)
Returns the value in the specified dimension as double. Note: this might seem redundant with respect to getValue(dim).doubleValue(), but usually this is much more efficient due to boxing/unboxing cost.

Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

floatValue

float floatValue(int dimension)
Returns the value in the specified dimension as float. Note: this might seem redundant with respect to getValue(dim).floatValue(), but usually this is much more efficient due to boxing/unboxing cost.

Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

intValue

int intValue(int dimension)
Returns the value in the specified dimension as int. Note: this might seem redundant with respect to getValue(dim).intValue(), but usually this is much more efficient due to boxing/unboxing cost.

Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

longValue

long longValue(int dimension)
Returns the value in the specified dimension as long. Note: this might seem redundant with respect to getValue(dim).longValue(), but usually this is much more efficient due to boxing/unboxing cost.

Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

shortValue

short shortValue(int dimension)
Returns the value in the specified dimension as short. Note: this might seem redundant with respect to getValue(dim).shortValue(), but usually this is much more efficient due to boxing/unboxing cost.

Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

byteValue

byte byteValue(int dimension)
Returns the value in the specified dimension as byte. Note: this might seem redundant with respect to getValue(dim).byteValue(), but usually this is much more efficient due to boxing/unboxing cost.

Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

Release 0.3 (2010-03-31_1612)