Gets the value of the ith element.
Gets the value of the ith element.
index
Find the index of a maximal element.
Find the index of a maximal element. Returns the first maximal element in case of a tie. Returns -1 if vector has length 0.
Convert this vector to the new mllib-local representation.
Convert this vector to the new mllib-local representation. This does NOT copy the data; it copies references.
Returns a vector in either dense or sparse format, whichever uses less storage.
Returns a vector in either dense or sparse format, whichever uses less storage.
Makes a deep copy of this vector.
Makes a deep copy of this vector.
Applies a function f
to all the active elements of dense and sparse vector.
Applies a function f
to all the active elements of dense and sparse vector.
the function takes two parameters where the first parameter is the index of
the vector with type Int
, and the second parameter is the corresponding value
with type Double
.
Returns a hash code value for the vector.
Returns a hash code value for the vector. The hash code is based on its size and its first 128
nonzero entries, using a hash algorithm similar to java.util.Arrays.hashCode
.
Number of active entries.
Number of active entries. An "active entry" is an element which is explicitly stored, regardless of its value.
Inactive entries have value 0.
Number of nonzero elements.
Number of nonzero elements. This scans all active values and count nonzeros.
Size of the vector.
Size of the vector.
Converts the instance to a double array.
Converts the instance to a double array.
Converts this vector to a dense vector.
Converts this vector to a dense vector.
Converts the vector to a JSON string.
Converts the vector to a JSON string.
Converts this vector to a sparse vector with all explicit zeros removed.
Converts this vector to a sparse vector with all explicit zeros removed.
A dense vector represented by a value array.