最終更新日時(UTC):
が更新

履歴 編集

function
<random>

std::negative_binomial_distribution::param(C++11)

param_type param() const;           // (1)
void param(const param_type& parm); // (2)

概要

  • (1) : 分布のパラメータを取得する
  • (2) : 分布のパラメータを設定する

#include <iostream>
#include <random>

int main()
{
  using dist_type = std::negative_binomial_distribution<>;

  dist_type dist(3, 0.5);

  // (1) パラメータを取得
  {
    dist_type::param_type param = dist.param();
  }

  // (2) パラメータを設定
  {
    dist_type::param_type param(3, 0.5);
    dist.param(param);
  }
}

出力

バージョン

言語

  • C++11

処理系

参照