Change matrix traversal order.