Package smile.data.vector
Interface DoubleVector
- All Superinterfaces:
BaseVector<Double,,Double, DoubleStream> Serializable
An immutable double vector.
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]array()Returns the array that backs this vector.voidfillna(double value) Fills NaN/Inf values using the specified value.get(int... index) Returns a new vector with selected entries.default booleangetBoolean(int i) Returns the boolean value at position i.default bytegetByte(int i) Returns the byte value at position i.default chargetChar(int i) Returns the character value at position i.default floatgetFloat(int i) Returns the float value at position i.default intgetInt(int i) Returns the integer value at position i.default longgetLong(int i) Returns the long value at position i.default shortgetShort(int i) Returns the short value at position i.static DoubleVectorCreates a named double vector.static DoubleVectorof(String name, DoubleStream stream) Creates a named double vector.static DoubleVectorof(StructField field, double[] vector) Creates a named double vector.static DoubleVectorof(StructField field, DoubleStream stream) Creates a named double vector.default StringtoString(int n) Returns the string representation of vector.default DataTypetype()Returns the data type of elements.Methods inherited from interface smile.data.vector.BaseVector
apply, apply, field, get, getDouble, measure, name, size, stream, toDoubleArray, toDoubleArray, toIntArray, toIntArray, toStringArray, toStringArray
-
Method Details
-
type
Description copied from interface:BaseVectorReturns the data type of elements.- Specified by:
typein interfaceBaseVector<Double,Double, DoubleStream> - Returns:
- the data type of elements.
-
array
double[] array()Description copied from interface:BaseVectorReturns the array that backs this vector. This is mostly for smile internal use for high performance. The application developers should not use this method.- Specified by:
arrayin interfaceBaseVector<Double,Double, DoubleStream> - Returns:
- the array that backs this vector.
-
get
Description copied from interface:BaseVectorReturns a new vector with selected entries.- Specified by:
getin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
index- the index of selected entries.- Returns:
- the new vector of selected entries.
-
getBoolean
default boolean getBoolean(int i) Description copied from interface:BaseVectorReturns the boolean value at position i.- Specified by:
getBooleanin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
getChar
default char getChar(int i) Description copied from interface:BaseVectorReturns the character value at position i.- Specified by:
getCharin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
getByte
default byte getByte(int i) Description copied from interface:BaseVectorReturns the byte value at position i.- Specified by:
getBytein interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
getShort
default short getShort(int i) Description copied from interface:BaseVectorReturns the short value at position i.- Specified by:
getShortin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
getInt
default int getInt(int i) Description copied from interface:BaseVectorReturns the integer value at position i.- Specified by:
getIntin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
getLong
default long getLong(int i) Description copied from interface:BaseVectorReturns the long value at position i.- Specified by:
getLongin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
getFloat
default float getFloat(int i) Description copied from interface:BaseVectorReturns the float value at position i.- Specified by:
getFloatin interfaceBaseVector<Double,Double, DoubleStream> - Parameters:
i- the index.- Returns:
- the value.
-
toString
Returns the string representation of vector.- Parameters:
n- the number of elements to show.- Returns:
- the string representation of vector.
-
fillna
void fillna(double value) Fills NaN/Inf values using the specified value.- Parameters:
value- the value to replace NAs.
-
of
Creates a named double vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a named double vector.- Parameters:
name- the name of vector.stream- the data stream of vector.- Returns:
- the vector.
-
of
Creates a named double vector.- Parameters:
field- the struct field of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a named double vector.- Parameters:
field- the struct field of vector.stream- the data stream of vector.- Returns:
- the vector.
-