exponential#

指数分布の乱数を生成します。

説明#

exponential クラス・オブジェクトは、変位 \(a\) とスケール係数 \(\beta\) を持つ指数分布の乱数を提供するために、generate 関数で使用されます。ここで \(a, \beta \in R ; \beta > 0\) です。

確率密度関数は次のように表されます。

\[\begin{split}f_{a, \beta}(x) = \begin{cases} \frac{1}{\beta} \exp (-\frac{(x-a)}{\beta}), & x \geq a \\ 0, & x < a \end{cases}, - \infty < x < + \infty\end{split}\]

累積分布関数は次のようになります。

\[\begin{split}F_{a, \beta}(x) = \begin{cases} 1 - \exp (-\frac{(x-a)}{\beta}), & x \geq a \\ 0, & x < a \end{cases}, - \infty < x < + \infty\end{split}\]

API#

構文#

namespace oneapi::mkl::rng::device { 
  template<typename RealType, typename Method> 
  class exponential { 
  public: 
    using method_type = Method; 
    using result_type = RealType; 

    exponential(): exponential((RealType)0.0, (RealType)1.0){} 
    explicit exponential(RealType a, RealType beta); 
    explicit exponential(const param_type& pt); 

    RealType a() const; 
    RealType beta() const; 
    param_type param() const; 
    void param(const param_type& pt); 
  }; 
}

インクルード・ファイル#

  • oneapi/mkl/rng/device.hpp

テンプレート・パラメーター#

typename Type

生成された値のタイプ。固有の値は次のとおりです:

  • float

  • double

typename Method

生成メソッド。固有の値は次のとおりです:

  • oneapi::mkl::rng::device::exponential_method::by_default

  • oneapi::mkl::rng::device::exponential_method::icdf

  • oneapi::mkl::rng::device::exponential_method::icdf_accurate

配布テンプレート・パラメーター・メソッドの説明を参照してください。

: ベクトル数学関数に基づく追加の最適化を有効にするには、MKL_RNG_USE_BINARY_CODE マクロを定義し、インテル® oneAPI マス・カーネル・ライブラリー・リンクラインのアドバイザー (英語) で生成された出力に従って oneMKL 静的ライブラリーをリンクします。一部のハードウェアではパフォーマンスが向上する可能性があります。

入力パラメーター#

名前

タイプ

説明

a

RealType (float, double)

変位 a

beta

RealType (float, double)

スケール係数 \(\beta\)