update the sparse vector