From 9b20e35b8f1b4162691408d7c1b6e608164d82aa Mon Sep 17 00:00:00 2001 From: Francisco Date: Wed, 20 Jan 2021 17:49:23 +0000 Subject: [PATCH] add comment regarding implementation of false position method in the scheduler --- .../src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index cc862e95a..c2b8fcd4f 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -143,6 +143,22 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) * TBS/MCS derivation ************************************************************/ +/** + * Implementation of false position method to iteratively find zero of given monotonic discrete function + * @tparam YType type of y axis + * @tparam Callable callable with interface "YType function(int)" + * @tparam ErrorDetect callable with interface "bool function(YType)" + * @param x1 min x value of input interval + * @param x2 max x value of input interval + * @param y0 target y value + * @param f monotonic function "YType f(int)" that crosses zero within [x1, x2] + * @param is_error returns true if an error has been detected + * @return solution of false position. It contains the interval when "f(x)" crossed y0. In case, + * - f(x2) <= y0 -> return is tuple(x2, y2, x2, y2) + * - f(x1) >= y0 -> return is tuple(x1, x1, x1, x1) + * - x' in ]x1, x2[, such that f(x') < y0 and f(x'+1) > y0 -> return is tuple(x', f(x'), x'+1, f(x'+1)) + * - x' in ]x1, x2[, such that f(x') == y0 -> return is tuple(x', f(x'), x', f(x')) + */ template std::tuple false_position_method(int x1, int x2, YType y0, const Callable& f, const ErrorDetect& is_error)