Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 1.1 KB

File metadata and controls

64 lines (48 loc) · 1.1 KB

min

  • random[meta header]
  • std[meta namespace]
  • piecewise_constant_distribution[meta class]
  • function[meta id-type]
  • cpp11[meta cpp]
result_type min() const;

概要

値の範囲の下限を取得する。

戻り値

生成する値の範囲の下限を返す。

#include <iostream>
#include <random>
#include <array>

int main()
{
  std::array<double, 3> intervals = {0.0, 0.5, 1.0};
  std::array<double, 2> densities = {0.3, 0.5};

  std::piecewise_constant_distribution<> dist(
    intervals.begin(),
    intervals.end(),
    densities.begin()
  );

  double min_value = dist.min();
  std::cout << min_value << std::endl;
}
  • min()[color ff0000]
  • intervals.begin()[link /reference/array/array/begin.md]
  • intervals.end()[link /reference/array/array/end.md]
  • densities.begin()[link /reference/array/array/begin.md]

出力

0

バージョン

言語

  • C++11

処理系

参照