|
|
|||||||||
| 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<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(Vector columnMatrix)
Expects a matrix of one column. |
| Method Summary | |
|---|---|
double |
doubleValue(int dimension)
Returns the value in the specified dimension as double. |
FloatVector |
fromByteBuffer(ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk) |
int |
getByteSize(FloatVector 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. |
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. |
Float |
scalarProduct(FloatVector f)
Provides the scalar product (inner product) of this and the given FloatVector. |
void |
toByteBuffer(ByteBuffer buffer,
FloatVector 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 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(Vector columnMatrix)
columnMatrix - a matrix of one column| Method Detail |
|---|
public int getDimensionality()
FeatureVector
getDimensionality in interface FeatureVector<FloatVector,Float>getDimensionality in interface SpatialComparablepublic Float getValue(int dimension)
FeatureVector
getValue in interface FeatureVector<FloatVector,Float>dimension - the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
public double doubleValue(int dimension)
NumberVectorgetValue(dim).doubleValue(), but usually this is much more
efficient due to boxing/unboxing cost.
doubleValue in interface NumberVector<FloatVector,Float>dimension - the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
public long longValue(int dimension)
NumberVectorgetValue(dim).longValue(), but usually this is much more efficient
due to boxing/unboxing cost.
longValue in interface NumberVector<FloatVector,Float>dimension - the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
public Vector getColumnVector()
NumberVectorgetDimensionality() rows the values of this NumberVector of V.
getColumnVector in interface NumberVector<FloatVector,Float>getDimensionality() rows the values of this
NumberVector of Vpublic Matrix getRowVector()
NumberVectorgetDimensionality() columns the values of this NumberVector of
V.
getRowVector in interface NumberVector<FloatVector,Float>getDimensionality() columns the values of this
NumberVector of Vpublic FloatVector plus(FloatVector fv)
NumberVector
plus in interface NumberVector<FloatVector,Float>fv - a NumberVector of V to be added to this NumberVector of V
public FloatVector minus(FloatVector fv)
NumberVector
minus in interface NumberVector<FloatVector,Float>fv - a NumberVector of V to be subtracted to this NumberVector of V
public Float scalarProduct(FloatVector f)
scalarProduct in interface NumberVector<FloatVector,Float>f - the FloatVector to compute the scalar product for
public FloatVector nullVector()
NumberVector
nullVector in interface NumberVector<FloatVector,Float>public FloatVector negativeVector()
NumberVector
negativeVector in interface NumberVector<FloatVector,Float>public FloatVector multiplicate(double k)
NumberVector
multiplicate in interface NumberVector<FloatVector,Float>k - a scalar to multiply this NumberVector of V with
public String toString()
FeatureVector
toString in interface FeatureVector<FloatVector,Float>toString in class Objectpublic FloatVector newInstance(Vector values)
NumberVector
newInstance in interface NumberVector<FloatVector,Float>values - the values of the NumberVector
public FloatVector newInstance(double[] values)
NumberVector
newInstance in interface NumberVector<FloatVector,Float>values - the values of the NumberVector
public FloatVector newInstance(Float[] values)
FeatureVector
newInstance in interface FeatureVector<FloatVector,Float>values - the values of the featureVector
public FloatVector newInstance(List<Float> values)
FeatureVector
newInstance in interface FeatureVector<FloatVector,Float>values - the values of the featureVector
public FloatVector fromByteBuffer(ByteBuffer buffer)
throws IOException
ByteBufferSerializer
fromByteBuffer in interface ByteBufferSerializer<FloatVector>buffer - Data array to process
IOException
public void toByteBuffer(ByteBuffer buffer,
FloatVector vec)
throws IOException
ByteBufferSerializer
toByteBuffer in interface ByteBufferSerializer<FloatVector>buffer - Buffer to serialize tovec - Object to serialize
IOExceptionpublic int getByteSize(FloatVector vec)
ByteBufferSerializer
getByteSize in interface ByteBufferSerializer<FloatVector>vec - Object to serialize
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||