void cubiclinear_histomorph::add_morph_terms(HT & t, const ParValues & values) const{
    const size_t n_sys = hplus_diff.size();
    for (size_t isys = 0; isys < n_sys; isys++) {
        const double delta = values.get(vid[isys]) * parameter_factors[isys];
        if(delta==0.0) continue;
        //linear extrpolation beyond 1 sigma:
        if(fabs(delta) > 1){
            const Histogram1D & t_sys = delta > 0 ? hplus_diff[isys] : hminus_diff[isys];
            t.add_with_coeff(fabs(delta), t_sys);
        }
        else{
            //cubic interpolation:
            diff_total = diff[isys];
            diff_total *= 0.5 * delta;
            diff_total.add_with_coeff(delta * delta - 0.5 * pow(fabs(delta), 3), sum[isys]);
            t += diff_total;
        }
    }
    double h_sum = 0.0;
    for(size_t i=0; i < t.get_nbins(); ++i){
        double val = t.get(i);
        if(val < 0.0){
            t.set(i, 0.0);
        }
        else{
            h_sum += val;
        }
    }
    if(normalize_to_nominal && h_sum > 0.0){
       t *= h0_sum / h_sum;
    }
}
Пример #2
0
bool testHashTableFullCoverage(const HT &hashTable,
                               const hyrise::storage::atable_ptr_t &table,
                               const field_list_t &columns) {
  bool result = true;
  for (pos_t row = 0; row < table->size(); ++row) {
    pos_list_t positions = hashTable.get(table, columns, row);
    if (positions.empty()) {
      result = false;
      break;
    }
  }
  return result;
}