'Calculate the energies of all the population members at the same time.
Puts the best member in first place. Useful if the population has just
been initialised.'

def _calculate_population_energies(self):

    for (index, candidate) in enumerate(self.population):
        if (self._nfev > self.maxfun):
            break
        parameters = self._scale_parameters(candidate)
        self.population_energies[index] = self.func(parameters, *self.args)
        self._nfev += 1
    minval = np.argmin(self.population_energies)
    lowest_energy = self.population_energies[minval]
    self.population_energies[minval] = self.population_energies[0]
    self.population_energies[0] = lowest_energy
    self.population[[0, minval], :] = self.population[[minval, 0], :]
