Consider different cases of SparseVector and DenseVector.