add swap to matrix_vector