src/ecckd/find_g_points.cpp
Real
calc_median_sorting_variable(const Vector& sorting_variable,
			     const Vector& planck,
			     int i1, int i2) {
  Real half_planck = 0.5 * sum(planck(range(i1,i2)));
  Real cum_planck = 0.0;
  int iind = i1;
  for ( ; iind < i2; ++iind) {
    cum_planck += planck(iind);
    if (cum_planck >= half_planck) {
      break;
    }
  }
  return sorting_variable(iind);
}
// Return the Planck-weighted-median of the sorting variable indexed
// by "index", where "rank" provides the ordering of sorting_variable
Return the Planck-weighted-median of the sorting variable indexed
by "index", where "rank" provides the ordering of sorting_variable
Return the Planck - weighted - median of the sorting variable indexed by " index " where " rank " provides the ordering of sorting_variable
Real
calc_median_sorting_variable(const Vector& sorting_variable,
			     const Vector& planck,
			     int i1, int i2) {
  Real half_planck = 0.5 * sum(planck(range(i1,i2)));
  Real cum_planck = 0.0;
  int iind = i1;
  for ( ; iind < i2; ++iind) {
    cum_planck += planck(iind);
    if (cum_planck >= half_planck) {
      break;
    }
  }
  return sorting_variable(iind);
}
Real calc_median_sorting_variable ( const Vector & sorting_variable , const Vector & planck , int i1 , int i2 ) { Real half_planck = 0.5 * sum ( planck ( range ( i1 , i2 ) ) ) ; Real cum_planck = 0.0 ; int iind = i1 ; for ( ; iind < i2 ; ++ iind ) { cum_planck += planck ( iind ) ; if ( cum_planck >= half_planck ) { break ; } } return sorting_variable ( iind ) ; }
Return the Planck-weighted-median of the sorting variable indexed
by "index", where "rank" provides the ordering of sorting_variable
Return the Planck - weighted - median of the sorting variable indexed by " index " where " rank " provides the ordering of sorting_variable