23 #include <utility/excn/Exceptions.hh>
24 #include <basic/prof.hh>
29 #include <utility/vector1.hh>
30 #include <numeric/xyzVector.hh>
35 namespace constraints {
73 if ( cst_in_casted ) cum_invdist6 += cst_in_casted->inv_dist6( xyz_func );
74 if ( !cst_in_casted ) {
77 if ( cst_in_casted ) {
78 Real dist = cst_in_casted->dist( xyz_func );
80 Real inv_dist2 = inv_dist*inv_dist;
81 cum_invdist6 += inv_dist2*inv_dist2*inv_dist2;
83 runtime_assert( 0 == 1 );
88 Real eff_dist = pow( cum_invdist6, -1.0/6 );
106 PROF_START( basic::NOESY_ASSIGN_DIST_CST_CAST );
108 PROF_STOP( basic::NOESY_ASSIGN_DIST_CST_CAST );
109 if ( cst_in_casted ) cum_invdist6 += cst_in_casted->inv_dist6( xyz );
110 if ( !cst_in_casted ) {
112 PROF_START( basic::NOESY_ASSIGN_DIST_CST_CAST );
114 PROF_STOP( basic::NOESY_ASSIGN_DIST_CST_CAST );
115 if ( cst_in_casted ) {
116 Real dist = cst_in_casted->dist( xyz );
118 Real inv_dist2 = inv_dist*inv_dist;
119 cum_invdist6 += inv_dist2*inv_dist2*inv_dist2;
121 runtime_assert( 0 == 1 );
126 Real eff_dist = pow( cum_invdist6, -1.0/6 );
135 ConstraintOP new_cst = (*cst_it)->remap_resid( seqmap );
136 if( new_cst ) new_csts.push_back( new_cst );
138 if( new_csts.size() > 0 ){
158 Real in_deriv = -1.0/6.0 * pow( eff_dist, 7.0 );
167 (*member_it)->fill_f1_f2( atom, xyz, f1, f2, weights );
168 core::Real member_cst_is_scaled_by = weights[ (*member_it)->score_type() ] * (*member_it)->get_func().dfunc( eff_dist
171 core::Real scale_i = -6.0*pow((*member_it)->dist( xyz ),-7.0);
173 if (std::fabs(member_cst_is_scaled_by) > 1e-14) scale_i /= member_cst_is_scaled_by;
175 F1 += 1.0 * scale_i * out_wderiv * in_deriv * f1;
176 F2 += 1.0 * scale_i * out_wderiv * in_deriv * f2;
212 func_->read_data( data );
216 while( data.good() && (data.get() !=
'\n') ) {}
217 if ( !data.good() ) data.setstate( std::ios_base::eofbit );
223 out <<
type() <<
" ";
225 else out << std::endl;
227 (*cst_it)->show_def( out, pose );
230 out <<
"End_"<<
type() << std::endl;
237 bool passed(
false );
239 Size viol = (*cst_it)->show_violations( out, pose, verbose_level, threshold);
240 if ( viol == 0 && verbose_level > 70 ) {
243 out <<
"\nResiduePairConstraints (" << pos_list[1] <<
", " << pos_list[pos_list.size()] <<
" ) . of total: 1 0 violated" << std::endl;
247 if ( !passed && verbose_level > 70 ) {
250 out <<
"\nResiduePairConstraints (" << pos_list[1] <<
", " << pos_list[pos_list.size()] <<
" ) + of total: 1 1 violated" << std::endl;
253 return func_->show_violations( out,
dist( pose ), verbose_level, threshold );
261 if ( !cst_in_casted ) {
264 if ( !cst_in_casted ) {
265 throw utility::excn::EXCN_BadInput(
"failed attempt to add " + cst_in->type() +
" to AmbiguousNMRConstraint. Can only add AmbiguousNMRDistanceConstraint and AtomPairConstraint");