|
|
|||||||||||||||||||||
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.NumberVector<V,N>
de.lmu.ifi.dbs.elki.data.RealVector<DoubleVector,Double>
de.lmu.ifi.dbs.elki.data.DoubleVector
public class DoubleVector
A DoubleVector is to store real values approximately as double values.
Field Summary | |
---|---|
private double[] |
values
Keeps the values of the real vector |
Fields inherited from class de.lmu.ifi.dbs.elki.data.NumberVector |
---|
ATTRIBUTE_SEPARATOR |
Constructor Summary | |
---|---|
DoubleVector(double[] values)
Provides a DoubleVector consisting of the given double values. |
|
DoubleVector(Double[] values)
Provides a DoubleVector consisting of the given double values. |
|
DoubleVector(List<Double> values)
Provides a feature vector consisting of double values according to the given Double values. |
|
DoubleVector(Matrix columnMatrix)
Expects a matrix of one column. |
Method Summary | |
---|---|
Vector |
getColumnVector()
Returns a Vector representing in one column and getDimensionality() rows the values of this FeatureVector 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 FeatureVector of V. |
Double |
getValue(int dimension)
Returns the value of the specified attribute. |
double[] |
getValues()
Get a copy of the raw double[] array. |
DoubleVector |
multiplicate(double k)
Returns a new FeatureVector of V that is the result of a scalar multiplication with the given scalar. |
DoubleVector |
negativeVector()
Returns the additive inverse to this FeatureVector of V. |
DoubleVector |
newInstance(double[] values)
Returns a new RealVector 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 |
nullVector()
Provides a null vector of the same Feature Vector Space as this FeatureVector of V (that is, of the same dimensionality). |
DoubleVector |
plus(DoubleVector fv)
Returns a new FeatureVector of V that is the sum of this FeatureVector of V and the given FeatureVector of V. |
DoubleVector |
randomInstance(Double min,
Double max,
Random random)
Returns a FeatureVector of V with random values between min and max. |
DoubleVector |
randomInstance(DoubleVector min,
DoubleVector max,
Random random)
Returns a FeatureVector of V with random values between min and max. |
DoubleVector |
randomInstance(Random random)
Returns a new DoubleVector with random values between 0 and 1. |
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.NumberVector |
---|
equals, getMax, getMin, getRange |
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 double[] values
Constructor Detail |
---|
public DoubleVector(List<Double> values)
values
- the values to be set as values of the real vectorpublic DoubleVector(double[] values)
values
- the values to be set as values of theDoubleVectorpublic DoubleVector(Double[] values)
values
- the values to be set as values of theDoubleVectorpublic DoubleVector(Matrix columnMatrix)
columnMatrix
- a matrix of one columnMethod Detail |
---|
public DoubleVector newInstance(Double[] values)
FeatureVector
values
- the values of the featureVector
public DoubleVector newInstance(double[] values)
RealVector
newInstance
in class RealVector<DoubleVector,Double>
values
- the values of the featureVector
public DoubleVector newInstance(List<Double> values)
FeatureVector
values
- the values of the featureVector
public DoubleVector randomInstance(Random random)
random
- a Random instance
public DoubleVector randomInstance(Double min, Double max, Random random)
FeatureVector
min
- minimum of random valuemax
- maximum of random valuerandom
- a random instance
public DoubleVector randomInstance(DoubleVector min, DoubleVector max, Random random)
FeatureVector
min
- minimum of random value for each axismax
- maximum of random value for each axisrandom
- a random instance
FeatureVector.randomInstance(de.lmu.ifi.dbs.elki.data.FeatureVector, de.lmu.ifi.dbs.elki.data.FeatureVector, java.util.Random)
public int getDimensionality()
FeatureVector
public Double getValue(int dimension)
dimension
- the selected attribute. Attributes are counted starting with 1.
IllegalArgumentException
- if the specified dimension is out of range of the possible attributespublic double[] getValues()
public Vector getColumnVector()
FeatureVector
getDimensionality()
rows the values of this FeatureVector of V.
getDimensionality()
rows the values of this
FeatureVector of Vpublic Matrix getRowVector()
FeatureVector
getDimensionality()
columns the values of this FeatureVector of V.
getDimensionality()
columns the values of this
FeatureVector of Vpublic DoubleVector plus(DoubleVector fv)
FeatureVector
fv
- a FeatureVector of V to be added to this FeatureVector of V
public DoubleVector nullVector()
FeatureVector
public DoubleVector negativeVector()
FeatureVector
public DoubleVector multiplicate(double k)
FeatureVector
k
- a scalar to multiply this FeatureVector of V with
public String toString()
FeatureVector
toString
in interface FeatureVector<DoubleVector,Double>
toString
in class Object
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |