Can I change a distribution parameters?

后端 未结 2 913
一整个雨季
一整个雨季 2021-01-04 11:30

There is uniform_int_distribution in < random > When I creating that I define an interval. Can I change this interval after the creation?

for example

<         


        
2条回答
  •  爱一瞬间的悲伤
    2021-01-04 11:52

    You can through the param() function.

    std::uniform_int_distribution distr(0, 10);
    std::uniform_int_distribution::param_type d2(2, 10);
    distr.param(d2);
    

提交回复
热议问题