fixed halfsize calculation in sparse_vector