9 #ifndef IMPKERNEL_PARTICLE_H
10 #define IMPKERNEL_PARTICLE_H
12 #include <IMP/kernel/kernel_config.h>
17 IMPKERNEL_BEGIN_NAMESPACE
20 inline bool Particle::get_is_active()
const {
22 return get_is_part_of_model();
30 IMP_PARTICLE_ATTRIBUTE_TYPE_DEF(
Float,
float,
Float);
31 IMP_PARTICLE_ATTRIBUTE_TYPE_DEF(
Int,
int,
Int);
33 IMP_PARTICLE_ATTRIBUTE_TYPE_DEF(Object,
object, base::Object*);
34 IMP_PARTICLE_ATTRIBUTE_TYPE_DEF(WeakObject, weak_object, base::Object*);
37 inline void Particle::add_attribute(
FloatKey name,
38 const Float initial_value,
bool optimized){
40 get_model()->add_attribute(name, id_, initial_value);
41 get_model()->set_is_optimized(name, id_, optimized);
43 inline void Particle::add_to_derivative(
FloatKey key,
Float value,
46 get_model()->add_to_derivative(key, id_, value, da);
48 inline void Particle::set_is_optimized(
FloatKey k,
bool tf) {
50 return get_model()->set_is_optimized(k, id_, tf);
52 inline bool Particle::get_is_optimized(
FloatKey k)
const {
54 return get_model()->get_is_optimized(k, id_);
58 return get_model()->get_derivative(name, id_);
62 get_model()->add_attribute(k, id_, v->get_index());
66 return get_model()->get_has_attribute(k, id_);
70 get_model()->set_attribute(k, id_, v->get_index());
74 return get_model()->get_particle(get_model()->get_attribute(k, id_));
78 get_model()->remove_attribute(k, id_);
82 return get_model()->internal::ParticleAttributeTable::get_attribute_keys(id_);
86 IMPKERNEL_END_NAMESPACE