8 #ifndef IMPCORE_BOUNDING_BOX_3DSINGLETON_SCORE_H
9 #define IMPCORE_BOUNDING_BOX_3DSINGLETON_SCORE_H
11 #include <IMP/core/core_config.h>
18 #include "internal/evaluate_distance_pair_score.h"
19 #include <boost/lambda/lambda.hpp>
21 IMPCORE_BEGIN_NAMESPACE
32 IMP::OwnerPointer<UF> f_;
41 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
47 "The unary function should return "
48 " 0 when passed a value of 0. Not " << f_->evaluate(0));
51 double GenericBoundingBox3DSingletonScore<UF>::evaluate(
Particle *p,
57 for (
unsigned int i=0; i< 3; ++i) {
58 if (bb_.get_corner(0)[i] > d.get_coordinate(i)) {
59 cp[i]=bb_.get_corner(0)[i];
61 }
else if (bb_.get_corner(1)[i] < d.get_coordinate(i)) {
62 cp[i]=bb_.get_corner(1)[i];
65 cp[i]= d.get_coordinate(i);
70 << d <<
" of " << bb_ << std::endl);
72 double v= internal::compute_distance_pair_score(d.get_coordinates()-cp,
76 d.add_to_derivatives(deriv, *da);
84 void GenericBoundingBox3DSingletonScore<UF>::do_show(std::ostream &out)
const {
85 out <<
"box is " << bb_ << std::endl;
92 IMP_GENERIC_OBJECT(BoundingBox3DSingletonScore, bounding_box_3d_singleton_score,
94 const algebra::BoundingBoxD<3> &bb),