38 #include <utility/vector1.hh>
74 ljatr_(etable_in.ljatr()),
75 ljrep_(etable_in.ljrep()),
76 dljatr_( etable_in.dljatr() ),
77 dljrep_( etable_in.dljrep() ),
78 safe_max_dis2_( etable_in.get_safe_max_dis2() ),
79 get_bins_per_A2_( etable_in.get_bins_per_A2()),
100 ljatr_( src.ljatr_ ),
101 ljrep_( src.ljrep_ ),
102 dljatr_( src.dljatr_ ),
103 dljrep_( src.dljrep_ ),
104 safe_max_dis2_( src.safe_max_dis2_ ),
105 get_bins_per_A2_( src.get_bins_per_A2_ ),
106 verbose_( src.verbose_ )
130 if (!rsd1.
is_RNA())
return ;
131 if (!rsd2.
is_RNA())
return ;
133 Real fa_atr_score( 0.0 ), fa_rep_score( 0.0 );
135 using namespace etable::count_pair;
137 CountPairFactory::create_count_pair_function( rsd1, rsd2,
CP_CROSSOVER_4 );
143 Vector const heavy_atom_i( rsd1.
xyz( i ) );
147 Real cp_weight = 1.0;
149 if ( cpfxn->count( i, j, cp_weight, path_dist ) ) {
151 Vector const heavy_atom_j( rsd2.
xyz( j ) );
153 Vector const d_ij = heavy_atom_j - heavy_atom_i;
154 Real const d2 = d_ij.length_squared();
159 Real dummy_deriv( 0.0 );
161 Real temp_atr_score( 0.0 ), temp_rep_score( 0.0 );
164 temp_atr_score, temp_rep_score,
165 dummy_deriv, dummy_deriv);
167 fa_atr_score += cp_weight * temp_atr_score;
168 fa_rep_score += cp_weight * temp_rep_score;
211 bool const eval_deriv(
true );
216 int disbin =
static_cast< int >( d2_bin ) + 1;
217 Real frac = d2_bin - ( disbin - 1 );
225 int const l2 = l1 + 1;
226 fa_atr_score = ( (1.-frac)*
ljatr_[ l1 ] + frac *
ljatr_[ l2 ]);
228 deriv_atr = (
ljatr_[
l2 ] -
ljatr_[
l1 ] ) * get_bins_per_A2_ * std::sqrt( d2 ) * 2;
235 int const l2 = l1 + 1;
236 fa_rep_score = ( (1.-frac)*
ljrep_[ l1 ] + frac *
ljrep_[ l2 ]);
238 deriv_rep = (
ljrep_[
l2 ] -
ljrep_[
l1 ] ) * get_bins_per_A2_ * std::sqrt( d2 ) * 2;
264 if ( !rsd1.is_RNA() )
return;
265 if ( m > rsd1.nheavyatoms() )
return;
266 if ( m < rsd1.first_sidechain_atom()+1 )
return;
268 Vector const heavy_atom_i( rsd1.xyz( m ) );
270 bool const pos1_fixed( domain_map( i ) != 0 );
276 EnergyGraph const & energy_graph( energies.energy_graph() );
281 iter = energy_graph.get_node( i )->const_edge_list_begin(),
283 iter != itere; ++iter ) {
285 Size const j( (*iter)->get_other_ind( i ) );
287 if ( pos1_fixed && domain_map(i) == domain_map(j) )
continue;
291 using namespace etable::count_pair;
293 CountPairFactory::create_count_pair_function( rsd1, rsd2,
CP_CROSSOVER_4 );
295 for (
Size n = rsd2.first_sidechain_atom()+1; n <= rsd2.nheavyatoms(); ++n ) {
297 Real cp_weight = 1.0;
299 if ( cpfxn->count(m, n, cp_weight,path_dist ) ) {
301 Vector const heavy_atom_j( rsd2.xyz( n ) );
302 Vector const d_ij = heavy_atom_j - heavy_atom_i;
303 Real const d2 = d_ij.length_squared();
305 Vector const d_ij_norm = d_ij.normalized();
309 Real dummy( 0.0 ), fa_atr_deriv( 0.0 ), fa_rep_deriv( 0.0 );
310 eval_lj( rsd1.atom(m), rsd2.atom(n), d2, dummy, dummy, fa_atr_deriv, fa_rep_deriv );
314 Vector const f1_fwd = 1.0 * cross( f2_fwd, heavy_atom_j );
346 if ( !rsd1.is_RNA() )
return score;
347 if ( m > rsd1.nheavyatoms() )
return score;
348 if ( m < rsd1.first_sidechain_atom()+1 )
return score;
350 Vector const heavy_atom_i( rsd1.xyz( m ) );
354 if ( i == j )
continue;
357 if ( !rsd2.is_RNA() )
continue;
359 using namespace etable::count_pair;
361 CountPairFactory::create_count_pair_function( rsd1, rsd2,
CP_CROSSOVER_4 );
363 for (
Size n = rsd2.first_sidechain_atom()+1; n <= rsd2.nheavyatoms(); ++n ) {
365 Real cp_weight = 1.0;
367 if ( cpfxn->count(m, n, cp_weight, path_dist ) ) {
369 Vector const heavy_atom_j( rsd2.xyz( n ) );
370 Vector const d_ij = heavy_atom_j - heavy_atom_i;
371 Real const d2 = d_ij.length_squared();
373 Vector const d_ij_norm = d_ij.normalized();
382 score += cp_weight * ( fa_atr +
fa_rep );
407 if (
verbose_) std::cout <<
"DONE SCORING" << std::endl;