vec for sparse matrices & sparsevec from matrices