#include <iostream>
#include <random>
#include <array>
int main()
{
using dist_type = std::piecewise_linear_distribution<>;
std::array<double, 3> intervals = {0.0, 0.5, 1.0};
std::array<double, 3> densities = {0.0, 0.5, 0.0};
dist_type dist(
intervals.begin(),
intervals.end(),
densities.begin()
);
// (1) パラメータを取得
{
dist_type::param_type param = dist.param();
}
// (2) パラメータを設定
{
std::array<double, 3> intervals2 = {0.0, 1.0, 2.0};
std::array<double, 3> densities2 = {0.0, 1.0, 1.0};
dist_type::param_type param(
intervals2.begin(),
intervals2.end(),
densities2.begin()
);
dist.param(param);
}
}