Пространства имён
Варианты
Действия

Концепции C++: RandomNumberDistribution

Материал из cppreference.com
< cpp‎ | concept

 
 
 
RandomNumberDistribution является функцией объекта возвращение случайных чисел в соответствии с функция плотности вероятностиp(x) или дискретное распределение вероятностейP(x
i
)
.
Оригинал:
A RandomNumberDistribution is a function object returning random numbers according to a функция плотности вероятностиp(x) or a дискретное распределение вероятностейP(x
i
)
.
Текст был переведён автоматически используя Переводчик Google.
Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.

[править]Требования

  • D в классе удовлетворении требований RandomNumberDistribution. Он должен также удовлетворять CopyConstructible и CopyAssignable требованиям.
    Оригинал:
    D is a class meeting the RandomNumberDistribution requirements. It shall also satisfy the CopyConstructible and CopyAssignable requirements.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • T является ассоциированным result_type.
    Оригинал:
    T is the associated result_type.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • P является ассоциированным param_type. Она должна удовлетворять CopyConstructible, CopyAssignable, а также требования EqualityComparable.
    Оригинал:
    P is the associated param_type. It shall satisfy the CopyConstructible, CopyAssignable, and EqualityComparable requirements.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • d является объектом D и x, y потенциально являются постоянными объектами из D.
    Оригинал:
    d is an object of D and x,y are potentially const objects of D.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • p это возможно постоянное значение P.
    Оригинал:
    p is a possibly constant value of P.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • g, g1, g2 которые lvalues ​​удовлетворении UniformRandomNumberGenerator концепции.
    Оригинал:
    g,g1,g2 are lvalues meeting the UniformRandomNumberGenerator concept.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • os является именующее из std::basic_ostream.
    Оригинал:
    os is an lvalue of std::basic_ostream.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
  • is является именующее из std::basic_istream.
    Оригинал:
    is is an lvalue of std::basic_istream.
    Текст был переведён автоматически используя Переводчик Google.
    Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
ExpressionTypeNotesComplexity
D::result_typeT An arithmetic type compile-time
D::param_typeP compile-time
D() constant
D(p) Same as p's construction
d.reset()void Resets the internal state of the distribution object. After a call to this function, the next call to operator() on the distribution object will not be dependent on previous calls to operator(). constant
x.param()P No worse than D(p)
d.param(p)void No worse than D(p)
d(g)Td(g, d.param()) Same as d(g, d.param())
d(g,p)T When called with the same g and p parameter it returns a sequence of numbers distributed according to p(x;p) or P(x
i
;p)
Amortized constant number of incovations of g
x.min()T The greatest lower bound returned by operator() constant
x.max()T The least upper bound returned by operator() constant
x == ybool constant
y != ybool!(x == y) constant
os << x Reference to the type of os Writes a textual representation of the distribution parameters and internal state to os as textual representation. The formatting flags and fill character of os are unchanged.
is >> d Reference to the type of is Restores the distribution parameters and internal state with data read from is. The formatting flags of is are unchanged. The data must have been written using a stream with the same locale, CharT and Traits template parameters, otherwise the behavior is undefined. If bad input is encountered, is.setstate(std::ios::failbit) is called, which may throw std::ios_base::failure. d is unchanged in that case.
close