Don't blow up when asked to sample from an empty range of values.

master
Oliver Kennedy 2023-07-01 17:06:07 -04:00
parent 266258b79c
commit cff9918811
Signed by: okennedy
GPG Key ID: 3E5F9B3ABD3FDB60
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ static bool cdf_sample_var(pip_cset *set, pip_var *var, pip_sampler_state *state
return false;
}
//elog(NOTICE, "Solving CDF with bounds: %lf, %lf", (double)bounds[0], (double)bounds[1]);
elog(NOTICE, "Solving CDF with bounds: %lf, %lf", (double)bounds[0], (double)bounds[1]);
if(bounds[0] >= bounds[1]) return false;
for(; state->curr_sample < state->samples->sample_cnt; state->curr_sample++){
do {