21 #include <basic/Tracer.hh>
23 #include <numeric/xyz.functions.hh>
24 #include <numeric/trig.functions.hh>
25 #include <numeric/deriv/distance_deriv.hh>
27 #include <utility/exit.hh>
33 #include <utility/vector1.hh>
37 namespace constraints {
39 static basic::Tracer
TR(
"core.io.constraints");
102 utility_exit_with_message(
"DistancePairConstraint::atom() bad argument" );
117 Size res1, res2, res3, res4;
118 std::string tempres1, tempres2, tempres3, tempres4;
135 TR.Debug <<
"read: " << name1 <<
" " << name2 <<
" "
136 << res1 <<
" " << res2 <<
" func: " << func_type
140 TR.Warning <<
"ignored constraint (no such atom in pose!)"
141 << name1 <<
" " << name2 <<
" "
142 << res1 <<
" " << res2 <<
" func: " << func_type
144 in.setstate( std::ios_base::failbit );
157 TR.Warning <<
"Error reading atoms: read in atom names("
158 << name1 <<
"," << name2 <<
"," << name3 <<
"," << name4 <<
"), "
161 in.setstate( std::ios_base::failbit );
166 func_->read_data( in );
168 while( in.good() && (in.get() !=
'\n') ) {}
170 if (
TR.Debug.visible() ) {
171 func_->show_definition( std::cout );
172 std::cout << std::endl;
208 TR.Debug <<
"difference of " << difference <<
" Angstroms" << std::endl;
209 return func(difference);
221 using namespace numeric::deriv;
231 Real const dE_dist(
dfunc( difference ) );
233 F1 += dE_dist * weights[ this->
score_type() ] * f1;
234 F2 += dE_dist * weights[ this->
score_type() ] * f2;
240 if( !dynamic_cast< DistancePairConstraint const * > ( &other_cst ) )
return false;
256 out <<
"DistancePairConstraint";
259 out <<
' ' <<
id.rsd() <<
' ' <<
id.atomno();
262 func_->show_definition(out);
272 if ( verbose_level > 80 ) {
273 out <<
"DistancePair ("
283 return func_->show_violations( out, 0.0, verbose_level, threshold );
289 return func_->func( theta );
294 return func_->dfunc( theta );