Sdílet prostřednictvím


piecewise_constant_distribution::piecewise_constant_distribution

Vytvoří distribuce.

 // default constructor piecewise_constant_distribution();  // constructs using a range of intervals, [firstI, lastI), with // matching weights starting at firstW template<class InputIteratorI, class InputIteratorW> piecewise_constant_distribution(InputIteratorI firstI, InputIteratorI lastI, InputIteratorW firstW);  // constructs using an initializer list for range of intervals, // with weights generated by function weightfunc template<class UnaryOperation> piecewise_constant_distribution(initializer_list<RealType> intervals, UnaryOperation weightfunc);  // constructs using an initializer list for range of count intervals, // distributed uniformly over [xmin,xmax] with weights generated by function weightfunc template<class UnaryOperation> piecewise_constant_distribution(size_t count, RealType xmin, RealType xmax, UnaryOperation weightfunc);  // constructs from an existing param_type structure explicit piecewise_constant_distribution(const param_type& parm); 

Parametry

  • firstI
    Vstupní iterace prvního prvku v rozsahu distribuce.

  • lastI
    Vstupní iterace posledním prvkem v rozsahu distribuce.

  • firstW
    Vstupní iterace prvního prvku v rozsahu váhy.

  • intervals
    Initializer_list intervaly rozdělení.

  • count
    Počet prvků v rozsahu distribuce.

  • xmin
    Nejnižší hodnota v rozsahu distribuce.

  • xmax
    Nejvyšší hodnota v rozsahu distribuce.Musí být větší než xmin.

  • weightfunc
    Objekt, který představuje funkci pravděpodobnost rozdělení.Parametr a vrácené hodnoty musí být převeditelný double.

  • parm
    Struktura parametr používá pro konstrukci distribuce.

Poznámky

Výchozí konstruktor nastaví uložené parametry, aby jeden interval, 0 na 1, s hustotou pravděpodobnost 1.

Konstruktor iterační rozsahu

template<class InputIteratorI, class InputIteratorW>
piecewise_constant_distribution(InputIteratorI firstI, InputIteratorI lastI,
        InputIteratorW firstW);

Vytvoří objekt distribuce s itnervals z iterátory nad sekvenci [firstI, lastI) a odpovídající hmotnost počínaje sekvence firstW.

Konstruktor inicializátoru seznamu

template<class UnaryOperation>
piecewise_constant_distribution(initializer_list<RealType> intervals, 
        UnaryOperation weightfunc);

sestaví objekt distribuce intervaly ze seznamu intializer intervals a váhy generované z funkce weightfunc.

Konstruktor definován jako

template<class UnaryOperation>
piecewise_constant_distribution(size_t count, RealType xmin, RealType xmax,
        UnaryOperation weightfunc);

Vytvoří objekt distribuce s count intervalech distribuované rovnoměrně přes [xmin,xmax], přiřazení každém intervalu provede podle funkce weightfunc, a weightfunc musíte přijmout jeden parametr a návratovou hodnotu, oboje je převést na double.**Precondition:**xmin < xmax

Konstruktor definován jako

explicit piecewise_constant_distribution(const param_type& parm);

Vytvoří objekt distribuce pomocí parm jako strukturu uložené parametru.

Požadavky

Záhlaví: < náhodné >

Obor názvů: std

Viz také

Referenční dokumentace

<random>

piecewise_constant_distribution – třída