28 #include <utility/pointer/access_ptr.hh>
29 #include <utility/pointer/owning_ptr.hh>
30 #include <utility/pointer/ReferenceCount.hh>
31 #include <basic/Tracer.hh>
40 #include <utility/vector1.hh>
51 static basic::Tracer
TR(
"core.scoring.mm.MMLJEnergyTable");
56 bins_per_angstrom_squared_(20),
57 linear_switch_point(0.6)
60 using namespace chemical;
64 Size natomtypes( mm_atom_set->n_atomtypes() );
66 TR <<
"Initializing MM LJ Energy Tables with " << natomtypes <<
" atom types" << std::endl;
78 for (
Size i = 1; i <= natomtypes; ++i ) {
90 TR <<
"Precomputing >=4 bond energy values" << std::endl;
91 for (
Size i = 1; i <= natomtypes; ++i ) {
92 for (
Size j = 1; j <= natomtypes; ++j ) {
109 Real switch_dist_squared( switch_dist * switch_dist );
112 Real switch_intercept( -1 * switch_dist * switch_slope + switch_ener );
115 Real prev_score( switch_intercept );
117 Real temp_score(0), temp_deriv(0);
118 if( k <= switch_dist_squared ){
119 temp_score = switch_slope * sqrt(k) + switch_intercept;
120 temp_deriv = switch_slope;
125 if ( temp_score <= prev_score ) {
136 prev_score = temp_score;
149 TR <<
"Precomputing 3 bond energy values" << std::endl;
150 for (
Size i = 1; i <= natomtypes; ++i ) {
151 for (
Size j = 1; j <= natomtypes; ++j ) {
168 Real switch_dist_squared( switch_dist * switch_dist );
171 Real switch_intercept( -1 * switch_dist * switch_slope + switch_ener );
174 Real prev_score( switch_intercept );
176 Real temp_score(0), temp_deriv(0);
177 if( k <= switch_dist_squared ){
178 temp_score = switch_slope * sqrt(k) + switch_intercept;
179 temp_deriv = switch_slope;
184 if ( temp_score <= prev_score ) {
195 prev_score = temp_score;
218 Size l_bin( static_cast< Size >( bin ) + 1 );
219 Size u_bin( l_bin + 1 );
220 Real frac( bin - ( l_bin - 1 ) );
227 rep = rep_vec[l_bin] + frac * ( rep_vec[u_bin] - rep_vec[l_bin] );
228 atr = atr_vec[l_bin] + frac * ( atr_vec[u_bin] - atr_vec[l_bin] );
242 Size l_bin( static_cast< Size >( bin ) + 1 );
243 Size u_bin( l_bin + 1 );
244 Real frac( bin - ( l_bin - 1 ) );
251 drep = drep_vec[l_bin] + frac * ( drep_vec[u_bin] - drep_vec[l_bin] );
252 datr = datr_vec[l_bin] + frac * ( datr_vec[u_bin] - datr_vec[l_bin] );