Improving the ensemble-optimization method through covariance-matrix adaptation