|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.data.AbstractNumberVector<OneDimensionalDoubleVector,Double> de.lmu.ifi.dbs.elki.data.OneDimensionalDoubleVector
public class OneDimensionalDoubleVector
Specialized class implementing a one-dimensional double vector without using an array. Saves a little bit of memory, albeit we cannot avoid boxing as long as we want to implement the interface.
Field Summary | |
---|---|
(package private) double |
val
The actual data value |
Fields inherited from class de.lmu.ifi.dbs.elki.data.AbstractNumberVector |
---|
ATTRIBUTE_SEPARATOR |
Constructor Summary | |
---|---|
OneDimensionalDoubleVector(double val)
Constructor. |
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. |
Double |
getValue(int dimension)
Returns the value in the specified dimension. |
long |
longValue(int dimension)
Returns the value in the specified dimension as long. |
OneDimensionalDoubleVector |
minus(OneDimensionalDoubleVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the negativeVector() of given NumberVector of V. |
OneDimensionalDoubleVector |
multiplicate(double k)
Returns a new NumberVector of V that is the result of a scalar multiplication with the given scalar. |
OneDimensionalDoubleVector |
negativeVector()
Returns the additive inverse to this NumberVector of V. |
OneDimensionalDoubleVector |
newInstance(double[] values)
Returns a new NumberVector of N for the given values. |
OneDimensionalDoubleVector |
newInstance(Double[] values)
Returns a new FeatureVector of V for the given values. |
OneDimensionalDoubleVector |
newInstance(List<Double> values)
Returns a new FeatureVector of V for the given values. |
OneDimensionalDoubleVector |
newInstance(Vector values)
Returns a new NumberVector of N for the given values. |
OneDimensionalDoubleVector |
nullVector()
Provides a null vector of the same Vector Space as this NumberVector of V (that is, of the same dimensionality). |
OneDimensionalDoubleVector |
plus(OneDimensionalDoubleVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V and the given NumberVector of V. |
Double |
scalarProduct(OneDimensionalDoubleVector fv)
Provides the scalar product (inner product) of this NumberVector of V and the given NumberVector of V. |
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, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.data.FeatureVector |
---|
toString |
Field Detail |
---|
double val
Constructor Detail |
---|
public OneDimensionalDoubleVector(double val)
val
- ValueMethod Detail |
---|
public int getDimensionality()
FeatureVector
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 Double getValue(int dimension)
FeatureVector
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 OneDimensionalDoubleVector nullVector()
NumberVector
public OneDimensionalDoubleVector negativeVector()
NumberVector
public OneDimensionalDoubleVector plus(OneDimensionalDoubleVector fv)
NumberVector
fv
- a NumberVector of V to be added to this NumberVector of V
public OneDimensionalDoubleVector minus(OneDimensionalDoubleVector fv)
NumberVector
fv
- a NumberVector of V to be subtracted to this NumberVector of V
public Double scalarProduct(OneDimensionalDoubleVector fv)
NumberVector
fv
- the NumberVector of V to compute the scalar product for
public OneDimensionalDoubleVector multiplicate(double k)
NumberVector
k
- a scalar to multiply this NumberVector of V with
public OneDimensionalDoubleVector newInstance(double[] values)
NumberVector
values
- the values of the NumberVector
public OneDimensionalDoubleVector newInstance(Vector values)
NumberVector
values
- the values of the NumberVector
public OneDimensionalDoubleVector newInstance(Double[] values)
FeatureVector
values
- the values of the featureVector
public OneDimensionalDoubleVector newInstance(List<Double> values)
FeatureVector
values
- the values of the featureVector
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |