31 #include <basic/Tracer.hh>
41 #include <utility/vector1.hh>
45 static basic::Tracer
tr(
"core.io.constraints");
49 namespace constraints {
63 AtomID const & fixed_atom_in,
64 Vector const & xyz_target_in,
70 fixed_atom_( fixed_atom_in ),
71 xyz_target_( xyz_target_in ),
79 return "CoordinateConstraint";
90 out <<
"CoordinateConstraint ("
100 func_->show_definition( out );
111 if ( verbose_level > 80 ) {
112 out <<
"CoordConstraint ("
116 return func_->show_violations( out,
dist( pose ), verbose_level, threshold );
170 if ( atom !=
atom_ )
return;
174 Vector const f2( xyz1 - xyz2 );
176 if ( deriv != 0.0 &&
dist != 0.0 ) {
177 Vector const f1( xyz1.cross( xyz2 ) );
205 utility_exit_with_message(
"CoordinateConstraint::atom() bad argument" );
262 tr.Debug <<
"read: " << name1 <<
" " << name2 <<
" " << res1 <<
" " << res2 <<
" func: " << func_type << std::endl;
264 tr.Warning <<
"ignored constraint (no such atom in pose!)"
265 << name1 <<
" " << name2 <<
" " << res1 <<
" " << res2 << std::endl;
266 data.setstate( std::ios_base::failbit );
273 tr.Warning <<
"Error reading atoms: read in atom names("
274 << name1 <<
"," << name2 <<
"), "
275 <<
"and found AtomIDs (" <<
atom_ <<
"," <<
fixed_atom_ <<
")" << std::endl;
276 data.setstate( std::ios_base::failbit );
281 func_->read_data( data );
285 while( data.good() && (data.get() !=
'\n') ) {}
286 if ( !data.good() ) data.setstate( std::ios_base::eofbit );
289 if (
tr.Debug.visible() ) {
290 func_->show_definition( std::cout );
291 std::cout << std::endl;
298 if( !dynamic_cast< CoordinateConstraint const * > ( &other_cst ) )
return false;
316 return func_->func( theta );
323 return func_->dfunc( theta );