11 #ifndef IMPKINEMATICS_DOF_VALUES_H
12 #define IMPKINEMATICS_DOF_VALUES_H
17 IMPKINEMATICS_BEGIN_NAMESPACE
22 class IMPKINEMATICSEXPORT DOFValues :
public std::vector<double> {
25 DOFValues(
const DOFs& dofs) {
27 for (
unsigned int i = 0; i < dofs.size(); i++)
28 push_back(dofs[i]->get_value());
36 double get_distance2(
const DOFValues& other_dof_values)
const {
38 for(
unsigned int i=0; i<size(); i++) {
39 double diff1 = ((*this)[i] - other_dof_values[i]);
42 double diff = std::min(std::fabs(diff1), std::min(diff2, diff3));
48 double get_distance2(
const DOFValues& other_dof_values,
49 const std::vector<bool>& active_dofs)
const {
51 unsigned int asize = 0;
52 for(
unsigned int i=0; i<size(); i++) {
53 if(active_dofs.size() == 0 || active_dofs[i]) {
54 double diff1 = ((*this)[i] - other_dof_values[i]);
57 double diff = std::min(std::fabs(diff1), std::min(diff2, diff3));
65 double get_distance(
const DOFValues& other_dof_values)
const {
66 return sqrt(get_distance2(other_dof_values));
70 const std::vector<bool>& active_dofs)
const {
71 return sqrt(get_distance2(other_dof_values, active_dofs));
80 for (
unsigned int i = 1; i < size(); i++) {
81 out <<
"," << operator[](i);
89 IMPKINEMATICS_END_NAMESPACE
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
static const double PI
the constant pi
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
double get_distance(const Plane3D &pln, const Vector3D &p)
Return the distance between a plane and a point in 3D.
Various useful constants.
IMP::base::Vector< IMP::base::Pointer< DOF > > DOFs