39 #include <basic/Tracer.hh>
42 #include <utility/exit.hh>
45 #include <numeric/constants.hh>
52 #include <utility/vector1.hh>
65 utility_exit_with_message(
"You shouldn't call the empty constructor for class TensorsOptimizerFix");
99 core::Real PCS_calc, PCS_exp, score, score_la;;
105 if(n_la != (vars.size()) / 5){
106 TR_TensorsOptimizerFix <<
"n_la: " << n_la <<
" (vars.size()) / 5):" << (vars.size()) / 5 <<
" vars.size(): " << vars.size() <<std::endl;
107 utility_exit_with_message(
"The number of lanthanides is inconsistent with the derivatives size of vars");
119 if(n_la != pcs_d_l_vec.size()){
120 utility_exit_with_message(
"The number of lanthanides is inconsistent");
123 for (i = 1; i <= n_la; i++){
140 for (j = 1; j <= n_pcs; j++){
149 PCS_calc = A_all[idx][1]*Xxx + A_all[idx][2]*Xxy + A_all[idx][3]*Xxz + A_all[idx][4]*Xyy + A_all[idx][5]*Xyz;
159 PCS_exp = cstyle_b[j];
160 score_la += (PCS_calc-PCS_exp) * (PCS_calc-PCS_exp);
178 for(i = 1; i <= vars.size(); i++){
181 vars_bis_pd[i] += delta;
182 vars_bis_md[i] -= delta;
185 dE_dvars[i] = value_pd - value_md;
234 if(n_la != (dE_dvars.size()) / 5){
235 utility_exit_with_message(
"The number of lanthanides is inconsistent with the derivativessize of dE_dvars");
239 for (i = 1; i <= dE_dvars.size(); i++){
244 vec_temp.resize(dE_dvars.size(), 0);
256 if(n_la != pcs_d_l_vec.size()){
257 utility_exit_with_message(
"The number of lanthanides is inconsistent");
262 for (i = 1; i <= n_la; i++){
264 for (p = 1; p <= vec_temp.size(); p++){
284 for (j = 1; j <= n_pcs; j++){
293 PCS_calc = A_all[idx][1]*Xxx + A_all[idx][2]*Xxy + A_all[idx][3]*Xxz + A_all[idx][4]*Xyy + A_all[idx][5]*Xyz;
303 PCS_exp = cstyle_b[j];
307 square_sum += deviation * deviation;
311 for (k = 1; k <= 5; k++){
313 vec_temp[5*(i-1) + k] += deviation * A_all[idx][k];
325 core::Real one_over_RMSD(1.0/sqrt(square_sum));
327 for (k = 1; k <= 5; k++){
328 dE_dvars[5*(i-1) + k] += vec_temp[5*(i-1) + k] * common_temp;