9#ifndef IMPKERNEL_PARTICLE_INDEX_H
10#define IMPKERNEL_PARTICLE_INDEX_H
12#include <IMP/kernel_config.h>
16IMPKERNEL_BEGIN_NAMESPACE
25IMPKERNELEXPORT ParticlesTemp
32class IMPKERNELEXPORT ParticleIndexAdaptor
43#if !defined(SWIG) && !defined(IMP_DOXYGEN) && !defined(IMP_SWIG_WRAPPER)
50class IMPKERNELEXPORT ParticleIndexesAdaptor :
public InputAdaptor {
51 std::shared_ptr<ParticleIndexes> tmp_;
57 ParticleIndexesAdaptor(
const PS &ps)
59 for (
unsigned int i = 0; i < ps.size(); ++i) {
60 (*tmp_)[i] = ps[i].get_particle_index();
63 ParticleIndexesAdaptor(
const Particles &ps);
65 ParticleIndexesAdaptor(
const ParticlesTemp &ps);
68 ParticleIndexesAdaptor() : tmp_(
new ParticleIndexes()), val_(tmp_.get()) {}
70 typedef ParticleIndexes::value_type value_type;
71 typedef ParticleIndexes::const_reference reference;
72 typedef ParticleIndexes::const_pointer pointer;
73 typedef ParticleIndexes::size_type size_type;
74 typedef ParticleIndexes::const_reference const_reference;
75 typedef ParticleIndexes::const_pointer const_pointer;
77 ParticleIndex operator[](
unsigned int i)
const {
return (*val_)[i]; }
78 unsigned int size()
const {
return val_->size(); }
79 typedef ParticleIndexes::const_iterator const_iterator;
80 typedef ParticleIndexes::const_iterator iterator;
81 const_iterator begin()
const {
return val_->begin(); }
82 const_iterator end()
const {
return val_->end(); }
87class IMPKERNELEXPORT ParticleIndexPairsAdaptor
97 ParticleIndexPairsAdaptor(
const PS &ps) {
99 for (
unsigned int i = 0; i < ps.size(); ++i) {
101 ps[i][1].get_particle_index());
108 ParticleIndexPairsAdaptor() {}
111IMPKERNEL_END_NAMESPACE
Interface to specialized Particle types (e.g. atoms).
Class for storing model, its restraints, constraints, and particles.
Class to handle individual particles of a Model object.
Index< ParticleIndexTag > ParticleIndex
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
Vector< Pointer< Particle > > Particles
A list of reference-counted Particle objects.
IMP::Vector< ParticleIndexPair, std::allocator< ParticleIndexPair > > ParticleIndexPairs
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
IMP::Vector< ParticlePair > ParticlePairsTemp
ParticleIndexes get_indexes(const ParticlesTemp &ps)
Get the indexes from a list of particles.
A smart pointer to a reference counted object.
Smart pointer to Object-derived classes that does not refcount.