35 #include <basic/Tracer.hh>
36 #include <basic/prof.hh>
38 #include <utility/vector1.hh>
44 namespace constraints {
76 static basic::Tracer
tr(
"core.scoring.ConstraintsEnergy");
99 return pose.
constraint_set()->residue_pair_constraint_exists( res1, res2 );
114 pose.
constraint_set()->residue_pair_energy( rsd1, rsd2, pose, sfxn, emap );
138 if (!res_cst)
return;
140 res_cst->constraints().residue_pair_energy( rsd1, rsd2, sfxn.
weights(), emap );
147 bool res_moving_wrt_eachother
150 return res_moving_wrt_eachother;
163 pose.
constraint_set()->setup_for_minimizing_for_residue( rsd, pose, sfxn, minmap, res_data_cache );
180 rsd1, rsd2, pose, sfxn, minmap,
181 res1_data_cache, res2_data_cache, respair_data_cache );
202 if (!res_cst)
return;
204 res_cst->constraints().setup_for_scoring(
ResiduePairXYZ( rsd1, rsd2 ), sfxn );
226 if (!res_cst)
return;
228 res_cst->constraints().setup_for_derivatives(
ResiduePairXYZ( rsd1, rsd2 ), sfxn );
267 if (!res_cst)
return;
269 for (
Size ii = 1; ii <= rsd1.
natoms(); ++ii ) {
270 res_cst->constraints().eval_respair_atom_derivative(
271 id::AtomID( ii, rsd1.
seqpos() ), rsd1, rsd2, weights, r1_atom_derivs[ ii ].f1(), r1_atom_derivs[ ii ].f2() );
273 for (
Size ii = 1; ii <= rsd2.
natoms(); ++ii ) {
274 res_cst->constraints().eval_respair_atom_derivative(
275 id::AtomID( ii, rsd2.
seqpos() ), rsd2, rsd1, weights, r2_atom_derivs[ ii ].f1(), r2_atom_derivs[ ii ].f2() );
307 pose.
constraint_set()->eval_intrares_energy( rsd, pose, sfxn, emap );
330 if (!res_cst)
return;
331 res_cst->constraints().intra_residue_energy( rsd, sfxn.
weights(), emap );
351 if (!res_cst)
return;
352 res_cst->constraints().setup_for_scoring(
ResidueXYZ( rsd ), sfxn );
373 if (!res_cst)
return;
374 res_cst->constraints().setup_for_derivatives(
ResidueXYZ( rsd ), sfxn );
407 if (!res_cst)
return;
408 for (
Size ii = 1; ii <= rsd.
natoms(); ++ii ) {
409 res_cst->constraints().eval_intrares_atom_derivative(
411 atom_derivs[ ii ].f1(), atom_derivs[ ii ].f2() );
456 using namespace methods;
464 bool create_new_cstcontainer(
false );
466 create_new_cstcontainer =
true;
471 create_new_cstcontainer =
true;
475 if ( create_new_cstcontainer ) {
528 pose.
constraint_set()->eval_non_residue_pair_energy( pose, sfxn, totals );
550 pose.
constraint_set()->eval_multibody_atom_derivative(
id, pose, sfxn, weights, F1, F2 );