Transfer sorting functions from SGVector to CMath