|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.data.AbstractDatabaseObject
de.lmu.ifi.dbs.elki.data.AbstractNumberVector<FloatVector,Float>
de.lmu.ifi.dbs.elki.data.FloatVector
public class FloatVector
A FloatVector is to store real values approximately as float values.
Field Summary | |
---|---|
private float[] |
values
Keeps the values of the float vector |
Fields inherited from class de.lmu.ifi.dbs.elki.data.AbstractNumberVector |
---|
ATTRIBUTE_SEPARATOR |
Constructor Summary | |
---|---|
|
FloatVector(float[] values)
Provides a FloatVector consisting of the given float values. |
|
FloatVector(Float[] values)
Provides a FloatVector consisting of the given float values. |
private |
FloatVector(float[] values,
boolean nocopy)
Private constructor. |
|
FloatVector(List<Float> values)
Provides a FloatVector consisting of float values according to the given Float values. |
|
FloatVector(Matrix columnMatrix)
Expects a matrix of one column. |
Method Summary | |
---|---|
double |
doubleValue(int dimension)
Returns the value in the specified dimension as double. |
Vector |
getColumnVector()
Returns a Vector representing in one column and getDimensionality() rows the values of this NumberVector of V. |
int |
getDimensionality()
The dimensionality of the vector space where of this FeatureVector of V is an element. |
Matrix |
getRowVector()
Returns a Matrix representing in one row and getDimensionality() columns the values of this NumberVector of V. |
Float |
getValue(int dimension)
Returns the value in the specified dimension. |
long |
longValue(int dimension)
Returns the value in the specified dimension as long. |
FloatVector |
minus(FloatVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the negativeVector() of given NumberVector of V. |
FloatVector |
multiplicate(double k)
Returns a new NumberVector of V that is the result of a scalar multiplication with the given scalar. |
FloatVector |
negativeVector()
Returns the additive inverse to this NumberVector of V. |
FloatVector |
newInstance(double[] values)
Returns a new NumberVector of N for the given values. |
FloatVector |
newInstance(Float[] values)
Returns a new FeatureVector of V for the given values. |
FloatVector |
newInstance(List<Float> values)
Returns a new FeatureVector of V for the given values. |
FloatVector |
newInstance(Vector values)
Returns a new NumberVector of N for the given values. |
FloatVector |
nullVector()
Provides a null vector of the same Vector Space as this NumberVector of V (that is, of the same dimensionality). |
FloatVector |
plus(FloatVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the given NumberVector of V. |
FloatVector |
randomInstance(Float min,
Float max,
Random random)
Returns a NumberVector of V with random values between min and max. |
FloatVector |
randomInstance(FloatVector min,
FloatVector max,
Random random)
Returns a NumberVector of V with random values between min and max. |
FloatVector |
randomInstance(Random random)
Returns a NumberVector of V with uniformly distributed (0-1) random values. |
Float |
scalarProduct(FloatVector f)
Provides the scalar product (inner product) of this and the given FloatVector. |
String |
toString()
Returns a String representation of the FeatureVector of V as a line that is suitable to be printed in a sequential file. |
Methods inherited from class de.lmu.ifi.dbs.elki.data.AbstractNumberVector |
---|
byteValue, equals, floatValue, getMax, getMin, intValue, shortValue |
Methods inherited from class de.lmu.ifi.dbs.elki.data.AbstractDatabaseObject |
---|
getID, setID |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.data.DatabaseObject |
---|
getID, setID |
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialObject |
---|
getID |
Field Detail |
---|
private float[] values
Constructor Detail |
---|
private FloatVector(float[] values, boolean nocopy)
public FloatVector(List<Float> values)
values
- the values to be set as values of the float vectorpublic FloatVector(float[] values)
values
- the values to be set as values of the float vectorpublic FloatVector(Float[] values)
values
- the values to be set as values of the float vectorpublic FloatVector(Matrix columnMatrix)
columnMatrix
- a matrix of one columnMethod Detail |
---|
public FloatVector newInstance(Vector values)
NumberVector
values
- the values of the NumberVector
public FloatVector newInstance(double[] values)
NumberVector
values
- the values of the NumberVector
public FloatVector newInstance(Float[] values)
FeatureVector
values
- the values of the featureVector
public FloatVector newInstance(List<Float> values)
FeatureVector
values
- the values of the featureVector
public FloatVector randomInstance(Random random)
NumberVector
random
- a Random instance
public FloatVector randomInstance(Float min, Float max, Random random)
NumberVector
min
- minimum of random valuemax
- maximum of random valuerandom
- a random instance
public FloatVector randomInstance(FloatVector min, FloatVector max, Random random)
NumberVector
min
- minimum of random value for each axismax
- maximum of random value for each axisrandom
- a random instance
NumberVector.randomInstance(de.lmu.ifi.dbs.elki.data.NumberVector,
de.lmu.ifi.dbs.elki.data.NumberVector, java.util.Random)
public int getDimensionality()
FeatureVector
public Float getValue(int dimension)
FeatureVector
dimension
- the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
public double doubleValue(int dimension)
NumberVector
getValue(dim).doubleValue()
, but
usually this is much more efficient due to boxing/unboxing cost.
dimension
- the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
public long longValue(int dimension)
NumberVector
getValue(dim).longValue()
, but
usually this is much more efficient due to boxing/unboxing cost.
dimension
- the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
public Vector getColumnVector()
NumberVector
getDimensionality()
rows the values of this NumberVector of V.
getDimensionality()
rows the values of this
NumberVector of Vpublic Matrix getRowVector()
NumberVector
getDimensionality()
columns the values of this NumberVector of V.
getDimensionality()
columns the values of this
NumberVector of Vpublic FloatVector plus(FloatVector fv)
NumberVector
fv
- a NumberVector of V to be added to this NumberVector of V
public FloatVector minus(FloatVector fv)
NumberVector
fv
- a NumberVector of V to be subtracted to this NumberVector of V
public Float scalarProduct(FloatVector f)
f
- the FloatVector to compute the scalar product for
public FloatVector nullVector()
NumberVector
public FloatVector negativeVector()
NumberVector
public FloatVector multiplicate(double k)
NumberVector
k
- a scalar to multiply this NumberVector of V with
public String toString()
FeatureVector
toString
in interface FeatureVector<FloatVector,Float>
toString
in class Object
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |