add check for sparse vector initialization

check whether the indices is strictly increasing before the sparse vector is created