00001 00009 #ifndef BS_MAIN_LOOP_CALC_APPLY_WEFAC_H_ 00010 #define BS_MAIN_LOOP_CALC_APPLY_WEFAC_H_ 00011 00012 namespace blue_sky 00013 { 00014 00021 template <typename item_t, typename wefac_t> 00022 inline item_t 00023 apply_wefac (item_t item, wefac_t wefac) 00024 { 00025 return wefac > 0. ? (item_t)(wefac * item) : (item); 00026 } 00027 00028 } // namespace blue_sky 00029 00030 00031 #endif // #ifndef BS_MAIN_LOOP_CALC_APPLY_WEFAC_H_