Skip to content

Commit

Permalink
Fix bulk_solvent::k_mask_and_k_overall_grid_search
Browse files Browse the repository at this point in the history
Closes cctbx#654
  • Loading branch information
sizmailov committed Dec 1, 2021
1 parent cfd0495 commit 2967db1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mmtbx/bulk_solvent/bulk_solvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ template <typename FloatType, typename ComplexType>
MMTBX_ASSERT(f_obs.size() == f_calc.size());
MMTBX_ASSERT(f_obs.size() == selection.size());
FloatType k_mask_best = 0.0;
FloatType k_overall_best = 1.0;
FloatType r_best = r_factor(f_obs, f_calc);
FloatType k_overall_best = scale(f_obs, f_calc, selection);
FloatType r_best = r_factor(f_obs, f_calc, selection, k_overall_best);
af::shared<ComplexType> f_model(f_obs.size());
for(std::size_t i=0; i < k_mask_range.size(); i++) {
FloatType k_mask = k_mask_range[i];
Expand All @@ -1157,7 +1157,7 @@ template <typename FloatType, typename ComplexType>
f_model[j] = f_calc[j] + k_mask * f_mask[j];
}
}
FloatType k_overall = scale(f_obs, f_model.const_ref());
FloatType k_overall = scale(f_obs, f_model.const_ref(), selection);
FloatType r = r_factor(f_obs, f_model.const_ref(), selection, k_overall);
if(r < r_best) {
k_mask_best = k_mask;
Expand Down

0 comments on commit 2967db1

Please sign in to comment.