|
|
|||||||||||||||||||||
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<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.AbstractNumberVector |
---|
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. |
private |
DoubleVector(double[] values,
boolean nocopy)
Private constructor. |
|
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 | |
---|---|
double |
doubleValue(int dimension)
Returns the value of the specified attribute. |
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. |
Double |
getValue(int dimension)
Returns the value of the specified attribute. |
double[] |
getValues()
Get a copy of the raw double[] array. |
long |
longValue(int dimension)
Returns the value of the specified attribute as long. |
DoubleVector |
minus(DoubleVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the negativeVector() of given NumberVector of V. |
DoubleVector |
multiplicate(double k)
Returns a new NumberVector of V that is the result of a scalar multiplication with the given scalar. |
DoubleVector |
negativeVector()
Returns the additive inverse to this NumberVector of V. |
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. |
DoubleVector |
nullVector()
Provides a null vector of the same Vector Space as this NumberVector of V (that is, of the same dimensionality). |
DoubleVector |
plus(DoubleVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the given NumberVector of V. |
DoubleVector |
randomInstance(Double min,
Double max,
Random random)
Returns a NumberVector of V with random values between min and max. |
DoubleVector |
randomInstance(DoubleVector min,
DoubleVector max,
Random random)
Returns a NumberVector of V with random values between min and max. |
DoubleVector |
randomInstance(Random random)
Returns a new DoubleVector with random values between 0 and 1. |
Double |
scalarProduct(DoubleVector d)
Provides the scalar product (inner product) of this and the given DoubleVector. |
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 double[] values
Constructor Detail |
---|
private DoubleVector(double[] values, boolean nocopy)
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(Vector values)
NumberVector
values
- the values of the NumberVector
public DoubleVector newInstance(Double[] values)
FeatureVector
values
- the values of the featureVector
public DoubleVector newInstance(double[] values)
NumberVector
values
- the values of the NumberVector
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)
NumberVector
min
- minimum of random valuemax
- maximum of random valuerandom
- a random instance
public DoubleVector randomInstance(DoubleVector min, DoubleVector 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 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 doubleValue(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 long longValue(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()
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 DoubleVector plus(DoubleVector fv)
NumberVector
fv
- a NumberVector of V to be added to this NumberVector of V
public DoubleVector minus(DoubleVector fv)
NumberVector
fv
- a NumberVector of V to be subtracted to this NumberVector of V
public DoubleVector nullVector()
NumberVector
public DoubleVector negativeVector()
NumberVector
public DoubleVector multiplicate(double k)
NumberVector
k
- a scalar to multiply this NumberVector of V with
public Double scalarProduct(DoubleVector d)
d
- the DoubleVector to compute the scalar product for
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 |