
public class IntegerVector extends AbstractNumberVector<IntegerVector,Integer> implements ByteBufferSerializer<IntegerVector>
| Modifier and Type | Field and Description |
|---|---|
private int[] |
values
Keeps the values of the real vector
|
ATTRIBUTE_SEPARATOR| Modifier | Constructor and Description |
|---|---|
|
IntegerVector(double[] values)
Provides an IntegerVector consisting of the given double values.
|
|
IntegerVector(int[] values)
Provides an IntegerVector consisting of the given integer values.
|
private |
IntegerVector(int[] values,
boolean nocopy)
Private constructor.
|
|
IntegerVector(Integer[] values)
Provides an IntegerVector consisting of the given integer values.
|
|
IntegerVector(List<Integer> values)
Provides a feature vector consisting of int values according to the
given Integer values.
|
|
IntegerVector(Vector values)
Provides an IntegerVector consisting of the given double vectors values.
|
| Modifier and Type | Method and Description |
|---|---|
double |
doubleValue(int dimension)
Returns the value of the specified attribute.
|
IntegerVector |
fromByteBuffer(ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk)
|
int |
getByteSize(IntegerVector 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. |
Integer |
getValue(int dimension)
Returns the value of the specified attribute.
|
int[] |
getValues()
Get a copy of the raw int[] array.
|
long |
longValue(int dimension)
Returns the value of the specified attribute as long.
|
IntegerVector |
minus(IntegerVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V
and the negativeVector() of given NumberVector of V.
|
IntegerVector |
multiplicate(double k)
Returns a new NumberVector of V that is the result of a scalar
multiplication with the given scalar.
|
IntegerVector |
negativeVector()
Returns the additive inverse to this NumberVector of V.
|
IntegerVector |
newInstance(double[] values)
Returns a new NumberVector of N for the given values.
|
IntegerVector |
newInstance(Integer[] values)
Returns a new FeatureVector of V for the given values.
|
IntegerVector |
newInstance(List<Integer> values)
Returns a new FeatureVector of V for the given values.
|
IntegerVector |
newInstance(Vector values)
Returns a new NumberVector of N for the given values.
|
IntegerVector |
nullVector()
Provides a null vector of the same Vector Space as this NumberVector of V
(that is, of the same dimensionality).
|
IntegerVector |
plus(IntegerVector fv)
Returns a new NumberVector of V that is the sum of this NumberVector of V
and the given NumberVector of V.
|
Integer |
scalarProduct(IntegerVector d)
Provides the scalar product (inner product) of this and the given
IntegerVector.
|
void |
toByteBuffer(ByteBuffer buffer,
IntegerVector 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.
|
byteValue, equals, floatValue, getMax, getMin, hashCode, intValue, shortValueprivate IntegerVector(int[] values,
boolean nocopy)
public IntegerVector(List<Integer> values)
values - the values to be set as values of the integer vectorpublic IntegerVector(int[] values)
values - the values to be set as values of the IntegerVectorpublic IntegerVector(Integer[] values)
values - the values to be set as values of the IntegerVectorpublic IntegerVector(double[] values)
values - the values to be set as values of the IntegerVectorpublic IntegerVector(Vector values)
values - the values to be set as values of the IntegerVectorpublic int getDimensionality()
FeatureVectorgetDimensionality in interface FeatureVector<IntegerVector,Integer>getDimensionality in interface SpatialComparablepublic Integer getValue(int dimension)
getValue in interface FeatureVector<IntegerVector,Integer>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<IntegerVector,Integer>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<IntegerVector,Integer>dimension - the selected attribute. Attributes are counted starting
with 1.IllegalArgumentException - if the specified dimension is out of range
of the possible attributespublic int[] getValues()
public Vector getColumnVector()
NumberVectorgetDimensionality() rows the values of this NumberVector of V.getColumnVector in interface NumberVector<IntegerVector,Integer>getDimensionality() rows the values of this
NumberVector of Vpublic Matrix getRowVector()
NumberVectorgetDimensionality() columns the values of this NumberVector of
V.getRowVector in interface NumberVector<IntegerVector,Integer>getDimensionality() columns the values of this
NumberVector of Vpublic IntegerVector plus(IntegerVector fv)
NumberVectorplus in interface NumberVector<IntegerVector,Integer>fv - a NumberVector of V to be added to this NumberVector of Vpublic IntegerVector minus(IntegerVector fv)
NumberVectorminus in interface NumberVector<IntegerVector,Integer>fv - a NumberVector of V to be subtracted to this NumberVector of Vpublic IntegerVector nullVector()
NumberVectornullVector in interface NumberVector<IntegerVector,Integer>public IntegerVector negativeVector()
NumberVectornegativeVector in interface NumberVector<IntegerVector,Integer>public IntegerVector multiplicate(double k)
NumberVectormultiplicate in interface NumberVector<IntegerVector,Integer>k - a scalar to multiply this NumberVector of V withpublic Integer scalarProduct(IntegerVector d)
scalarProduct in interface NumberVector<IntegerVector,Integer>d - the IntegerVector to compute the scalar product forpublic String toString()
FeatureVectortoString in interface FeatureVector<IntegerVector,Integer>toString in class Objectpublic IntegerVector newInstance(Vector values)
NumberVectornewInstance in interface NumberVector<IntegerVector,Integer>values - the values of the NumberVectorpublic IntegerVector newInstance(Integer[] values)
FeatureVectornewInstance in interface FeatureVector<IntegerVector,Integer>values - the values of the featureVectorpublic IntegerVector newInstance(double[] values)
NumberVectornewInstance in interface NumberVector<IntegerVector,Integer>values - the values of the NumberVectorpublic IntegerVector newInstance(List<Integer> values)
FeatureVectornewInstance in interface FeatureVector<IntegerVector,Integer>values - the values of the featureVectorpublic IntegerVector fromByteBuffer(ByteBuffer buffer) throws IOException
ByteBufferSerializerfromByteBuffer in interface ByteBufferSerializer<IntegerVector>buffer - Data array to processIOExceptionpublic void toByteBuffer(ByteBuffer buffer, IntegerVector vec) throws IOException
ByteBufferSerializertoByteBuffer in interface ByteBufferSerializer<IntegerVector>buffer - Buffer to serialize tovec - Object to serializeIOExceptionpublic int getByteSize(IntegerVector vec)
ByteBufferSerializergetByteSize in interface ByteBufferSerializer<IntegerVector>vec - Object to serialize