You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// how does brent algorithm work for functions with multiple minima??
71
-
std::pair<real_t, real_t> init_distr_max; // [ln(position of distribution's maximum), -function value at maximum]
72
-
boost::uintmax_t n_iter = config.n_iter;
73
-
init_distr_max = boost::math::tools::brent_find_minima(detail::eval_and_mul<real_t>(n_of_lnrd_stp, -1), log(config.rd_min_init), log(config.rd_max_init), 200, n_iter); // bits = 200 to make algorithm choose max precision available
elseif (opts_init.rd_min < 0 && opts_init.rd_max < 0) // automatic detection of bin edges
90
+
{
91
+
// TODO: add same sanity check as above
92
+
// how does brent algorithm work for functions with multiple minima??
93
+
std::pair<real_t, real_t> init_distr_max; // [ln(position of distribution's maximum), -function value at maximum]
94
+
boost::uintmax_t n_iter = config.n_iter;
95
+
init_distr_max = boost::math::tools::brent_find_minima(detail::eval_and_mul<real_t>(n_of_lnrd_stp, -1), log(config.rd_min_init), log(config.rd_max_init), 200, n_iter); // bits = 200 to make algorithm choose max precision available
74
96
75
-
real_t init_dist_bound_value = -init_distr_max.second / config.threshold; // value of the distribution at which we bind it
76
-
n_iter = config.n_iter;
77
-
// TODO: it could be written more clearly by creating an object detail::eval_and_oper<real_t>(*n_of_lnrd_stp, -init_dist_bound_value, 1), but for some reason it doesnt give the correct values
real_t init_dist_bound_value = -init_distr_max.second / config.threshold; // value of the distribution at which we bind it
98
+
n_iter = config.n_iter;
99
+
// TODO: it could be written more clearly by creating an object detail::eval_and_oper<real_t>(*n_of_lnrd_stp, -init_dist_bound_value, 1), but for some reason it doesnt give the correct values
0 commit comments