34template <
class Kernel>
35auto create_transform_range(
ParticleRange const &particles, Kernel kernel) {
36 auto transform_iterator_begin =
37 boost::make_transform_iterator(particles.begin(), kernel);
38 auto transform_iterator_end =
39 boost::make_transform_iterator(particles.end(), kernel);
40 return boost::make_iterator_range<decltype(transform_iterator_begin)>(
41 transform_iterator_begin, transform_iterator_end);
47 auto return_unfolded_pos = [&box](
Particle &p) {
48 return ::detail::unfolded_position(p.pos(), p.image_box(), box.
length());
50 return detail::create_transform_range(particles, return_unfolded_pos);
55 return detail::create_transform_range(particles, return_pos);
59 auto return_charge = [](
Particle &p) ->
double & {
return p.q(); };
60 return detail::create_transform_range(particles, return_charge);
67 return detail::create_transform_range(particles, return_force);
auto charge_range(ParticleRange const &particles)
auto pos_range(ParticleRange const &particles)
auto force_range(ParticleRange const &particles)
auto unfolded_pos_range(ParticleRange const &particles, BoxGeometry const &box)
Struct holding all information for one particle.