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.
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.
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 nonzeros in the first 16 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. Note that 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 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.