11 #include <IMP/core/core_config.h>
13 #include "internal/dihedral_helpers.h"
21 IMPCORE_BEGIN_NAMESPACE
36 static FloatKey get_coordinate_key(
unsigned int i) {
38 return IMP::internal::xyzr_keys[i];
62 return setup_particle(p->get_model(),
72 get_model()->get_sphere(get_particle_index())[i]=v;
76 get_model()->get_sphere(get_particle_index())[0]=v[0];
77 get_model()->get_sphere(get_particle_index())[1]=v[1];
78 get_model()->get_sphere(get_particle_index())[2]=v[2];
83 return get_model()->get_sphere(get_particle_index())[i];
87 return get_derivatives()[i];
90 void add_to_derivative(
int i,
Float v,
92 get_particle()->add_to_derivative(get_coordinate_key(i), v, d);
97 get_model()->add_to_coordinate_derivatives(get_particle_index(),
104 return get_particle()->get_is_optimized(get_coordinate_key(0))
105 &&
get_particle()->get_is_optimized(get_coordinate_key(1))
106 &&
get_particle()->get_is_optimized(get_coordinate_key(2));
110 get_particle()->set_is_optimized(get_coordinate_key(0), tf);
111 get_particle()->set_is_optimized(get_coordinate_key(1), tf);
112 get_particle()->set_is_optimized(get_coordinate_key(2), tf);
124 return get_model()->get_sphere(get_particle_index()).get_center();
131 return get_model()->get_coordinate_derivatives(get_particle_index());
136 && p->has_attribute(get_coordinate_key(0))
137 && p->has_attribute(get_coordinate_key(1)))
138 || (!p->has_attribute(get_coordinate_key(2))
139 && !p->has_attribute(get_coordinate_key(0))
140 && !p->has_attribute(get_coordinate_key(1))),
141 "Particle expected to either have all of x,y,z or none.");
142 return p->has_attribute(get_coordinate_key(2));
146 return m->get_has_attribute(get_coordinate_key(2), pi);
168 return internal::dihedral(a, b, c, d,
nullptr,
nullptr,
nullptr,
nullptr);
189 IMPCORE_END_NAMESPACE
196 IMPKERNEL_BEGIN_NAMESPACE
206 IMPKERNEL_END_NAMESPACE