|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.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(Vector columnMatrix)
Expects a matrix of one column. |
| Method Summary | |
|---|---|
double |
doubleValue(int dimension)
Returns the value of the specified attribute. |
DoubleVector |
fromByteBuffer(ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk) |
int |
getByteSize(DoubleVector vec)
Get the size of the object in bytes. |
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. |
Double |
scalarProduct(DoubleVector d)
Provides the scalar product (inner product) of this and the given DoubleVector. |
void |
toByteBuffer(ByteBuffer buffer,
DoubleVector vec)
Serialize the object to a byte array (e.g. disk) |
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, hashCode, intValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| 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 the DoubleVectorpublic DoubleVector(Double[] values)
values - the values to be set as values of the DoubleVectorpublic DoubleVector(Vector columnMatrix)
columnMatrix - a matrix of one column| Method Detail |
|---|
public int getDimensionality()
FeatureVector
getDimensionality in interface FeatureVector<DoubleVector,Double>getDimensionality in interface SpatialComparablepublic Double getValue(int dimension)
getValue in interface FeatureVector<DoubleVector,Double>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)
doubleValue in interface NumberVector<DoubleVector,Double>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)
longValue in interface NumberVector<DoubleVector,Double>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()
NumberVectorgetDimensionality() rows the values of this NumberVector of V.
getColumnVector in interface NumberVector<DoubleVector,Double>getDimensionality() rows the values of this
NumberVector of Vpublic Matrix getRowVector()
NumberVectorgetDimensionality() columns the values of this NumberVector of
V.
getRowVector in interface NumberVector<DoubleVector,Double>getDimensionality() columns the values of this
NumberVector of Vpublic DoubleVector plus(DoubleVector fv)
NumberVector
plus in interface NumberVector<DoubleVector,Double>fv - a NumberVector of V to be added to this NumberVector of V
public DoubleVector minus(DoubleVector fv)
NumberVector
minus in interface NumberVector<DoubleVector,Double>fv - a NumberVector of V to be subtracted to this NumberVector of V
public DoubleVector nullVector()
NumberVector
nullVector in interface NumberVector<DoubleVector,Double>public DoubleVector negativeVector()
NumberVector
negativeVector in interface NumberVector<DoubleVector,Double>public DoubleVector multiplicate(double k)
NumberVector
multiplicate in interface NumberVector<DoubleVector,Double>k - a scalar to multiply this NumberVector of V with
public Double scalarProduct(DoubleVector d)
scalarProduct in interface NumberVector<DoubleVector,Double>d - the DoubleVector to compute the scalar product for
public String toString()
FeatureVector
toString in interface FeatureVector<DoubleVector,Double>toString in class Objectpublic DoubleVector newInstance(Vector values)
NumberVector
newInstance in interface NumberVector<DoubleVector,Double>values - the values of the NumberVector
public DoubleVector newInstance(Double[] values)
FeatureVector
newInstance in interface FeatureVector<DoubleVector,Double>values - the values of the featureVector
public DoubleVector newInstance(double[] values)
NumberVector
newInstance in interface NumberVector<DoubleVector,Double>values - the values of the NumberVector
public DoubleVector newInstance(List<Double> values)
FeatureVector
newInstance in interface FeatureVector<DoubleVector,Double>values - the values of the featureVector
public DoubleVector fromByteBuffer(ByteBuffer buffer)
throws IOException
ByteBufferSerializer
fromByteBuffer in interface ByteBufferSerializer<DoubleVector>buffer - Data array to process
IOException
public void toByteBuffer(ByteBuffer buffer,
DoubleVector vec)
throws IOException
ByteBufferSerializer
toByteBuffer in interface ByteBufferSerializer<DoubleVector>buffer - Buffer to serialize tovec - Object to serialize
IOExceptionpublic int getByteSize(DoubleVector vec)
ByteBufferSerializer
getByteSize in interface ByteBufferSerializer<DoubleVector>vec - Object to serialize
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||