Subclause | Header | ||
Requirements | |||
Floating-point environment | <cfenv> | ||
Complex numbers | <complex> | ||
Bit manipulation | <bit> | ||
Random number generation | <random> | ||
Numeric arrays | <valarray> | ||
Mathematical functions for floating-point types | <cmath>, <cstdlib> | ||
Numbers | <numbers> |
template<class T> constexpr complex(const T& re = T(), const T& im = T());
constexpr T real() const;
constexpr void real(T val);
constexpr T imag() const;
constexpr void imag(T val);
constexpr complex& operator+=(const T& rhs);
constexpr complex& operator-=(const T& rhs);
constexpr complex& operator*=(const T& rhs);
constexpr complex& operator/=(const T& rhs);
template<class X> constexpr complex& operator+=(const complex<X>& rhs);
template<class X> constexpr complex& operator-=(const complex<X>& rhs);
template<class X> constexpr complex& operator*=(const complex<X>& rhs);
template<class X> constexpr complex& operator/=(const complex<X>& rhs);
template<class T> constexpr complex<T> operator+(const complex<T>& lhs);
template<class T> constexpr complex<T> operator+(const complex<T>& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator+(const complex<T>& lhs, const T& rhs);
template<class T> constexpr complex<T> operator+(const T& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator-(const complex<T>& lhs);
template<class T> constexpr complex<T> operator-(const complex<T>& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator-(const complex<T>& lhs, const T& rhs);
template<class T> constexpr complex<T> operator-(const T& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator*(const complex<T>& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator*(const complex<T>& lhs, const T& rhs);
template<class T> constexpr complex<T> operator*(const T& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator/(const complex<T>& lhs, const complex<T>& rhs);
template<class T> constexpr complex<T> operator/(const complex<T>& lhs, const T& rhs);
template<class T> constexpr complex<T> operator/(const T& lhs, const complex<T>& rhs);
template<class T> constexpr bool operator==(const complex<T>& lhs, const complex<T>& rhs);
template<class T> constexpr bool operator==(const complex<T>& lhs, const T& rhs);
template<class T, class charT, class traits>
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, complex<T>& x);
template<class T, class charT, class traits>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& o, const complex<T>& x);
template<class T> constexpr T real(const complex<T>& x);
template<class T> constexpr T imag(const complex<T>& x);
template<class T> T abs(const complex<T>& x);
template<class T> T arg(const complex<T>& x);
template<class T> constexpr T norm(const complex<T>& x);
template<class T> constexpr complex<T> conj(const complex<T>& x);
template<class T> complex<T> proj(const complex<T>& x);
template<class T> complex<T> polar(const T& rho, const T& theta = T());
template<class T> complex<T> acos(const complex<T>& x);
template<class T> complex<T> asin(const complex<T>& x);
template<class T> complex<T> atan(const complex<T>& x);
template<class T> complex<T> acosh(const complex<T>& x);
template<class T> complex<T> asinh(const complex<T>& x);
template<class T> complex<T> atanh(const complex<T>& x);
template<class T> complex<T> cos(const complex<T>& x);
template<class T> complex<T> cosh(const complex<T>& x);
template<class T> complex<T> exp(const complex<T>& x);
template<class T> complex<T> log(const complex<T>& x);
template<class T> complex<T> log10(const complex<T>& x);
template<class T> complex<T> pow(const complex<T>& x, const complex<T>& y);
template<class T> complex<T> pow(const complex<T>& x, const T& y);
template<class T> complex<T> pow(const T& x, const complex<T>& y);
template<class T> complex<T> sin(const complex<T>& x);
template<class T> complex<T> sinh(const complex<T>& x);
template<class T> complex<T> sqrt(const complex<T>& x);
template<class T> complex<T> tan(const complex<T>& x);
template<class T> complex<T> tanh(const complex<T>& x);
constexpr complex<long double> operator""il(long double d);
constexpr complex<long double> operator""il(unsigned long long d);
constexpr complex<double> operator""i(long double d);
constexpr complex<double> operator""i(unsigned long long d);
constexpr complex<float> operator""if(long double d);
constexpr complex<float> operator""if(unsigned long long d);
template<class To, class From>
constexpr To bit_cast(const From& from) noexcept;
template<class T>
constexpr bool has_single_bit(T x) noexcept;
template<class T>
constexpr T bit_ceil(T x);
template<class T>
constexpr T bit_floor(T x) noexcept;
template<class T>
constexpr T bit_width(T x) noexcept;
template<class T>
[[nodiscard]] constexpr T rotl(T x, int s) noexcept;
template<class T>
[[nodiscard]] constexpr T rotr(T x, int s) noexcept;
template<class T>
constexpr int countl_zero(T x) noexcept;
template<class T>
constexpr int countl_one(T x) noexcept;
template<class T>
constexpr int countr_zero(T x) noexcept;
template<class T>
constexpr int countr_one(T x) noexcept;
template<class T>
constexpr int popcount(T x) noexcept;
enum class endian {
little = see below,
big = see below,
native = see below
};
Expression | Return type | Pre/post-condition | Complexity | |
T | compile-time | |||
Creates a seed sequence
with the same initial state as all other default-constructed seed sequences
of type S. | constant | |||
Creates a seed sequence
having internal state
that depends on some or all of the bits
of the supplied sequence . | ||||
Same as S(il.begin(), il.end()). | same as S(il.begin(), il.end()) | |||
void | ||||
size_t | The number of 32-bit units
that would be copied
by a call to r.param. | constant | ||
void | Copies to the given destination
a sequence of 32-bit units
that can be provided
to the constructor of a second object of type S,
and that would reproduce in that second object
a state indistinguishable
from the state of the first object. |
Expression | Return type | Pre/post-condition | Complexity | |
Creates an engine
with the same initial state
as all other default-constructed engines
of type E. | ||||
Creates an engine
that compares equal to x. | ||||
Creates an engine
with initial state determined by s. | ||||
Creates an engine
with an initial state
that depends on a sequence
produced by one call
to q.generate. | same as complexity of q.generate
called on a sequence
whose length is size of state | |||
void | Postconditions: e == E(). | same as E() | ||
void | Postconditions: e == E(s). | same as E(s) | ||
void | Postconditions: e == E(q). | same as E(q) | ||
T | per [rand.req.urng] | |||
void | no worse than the complexity
of z consecutive calls e() | |||
bool | ||||
bool | !(x == y). | |||
reference to the type of os | With os.fmtflags set to
ios_base::dec|ios_base::left
and the fill character set to the space character,
writes to os
the textual representation
of x's current state. In the output,
adjacent numbers are separated
by one or more space characters. Postconditions: The os.fmtflags and fill character are unchanged. | |||
reference to the type of is | With is.fmtflags
set to ios_base::dec,
sets v's state
as determined by reading its textual representation from is. If bad input is encountered,
ensures that v's state is unchanged by the operation
and
calls is.setstate(ios_base::failbit)
(which may throw ios_base::failure ([iostate.flags])). If a textual representation written via os << x
was subsequently read via is >> v,
then x == v
provided that there have been no intervening invocations
of x or of v. Preconditions: is provides a textual representation
that was previously written
using an output stream
whose imbued locale
was the same as that of is,
and whose type's template specialization arguments
charT and traits
were respectively the same as those of is. Postconditions: The is.fmtflags are unchanged. |
A::A();
bool operator==(const A& a1, const A& a2);
A::A(result_type s);
template<class Sseq> A::A(Sseq& q);
void seed();
void seed(result_type s);
template<class Sseq> void seed(Sseq& q);
Expression | Return type | Pre/post-condition | Complexity | |
T | compile-time | |||
P | compile-time | |||
Creates a distribution whose behavior is indistinguishable
from that of any other newly default-constructed distribution
of type D. | constant | |||
Creates a distribution whose behavior is indistinguishable
from that of a distribution
newly constructed directly from the values used to construct p. | same as p's construction | |||
void | constant | |||
P | no worse than the complexity of D(p) | |||
void | Postconditions: d.param() == p. | no worse than the complexity of D(p) | ||
T | With ,
the sequence of numbers
returned by successive invocations
with the same object g
is randomly distributed
according to the associated
p(z |{p})
or
function. | amortized constant number of invocations of g | ||
T | The sequence of numbers
returned by successive invocations
with the same objects g and p
is randomly distributed
according to the associated
p(z |{p})
or
function. | amortized constant number of invocations of g | ||
T | Returns glb. | constant | ||
T | Returns lub. | constant | ||
bool | constant | |||
bool | !(x == y). | same as x == y. | ||
reference to the type of os | Postconditions: The os.fmtflags and fill character are unchanged. | |||
reference to the type of is | If bad input is encountered,
ensures that d is unchanged by the operation
and
calls is.setstate(ios_base::failbit)
(which may throw ios_base::failure ([iostate.flags])). Preconditions: is provides a textual representation
that was previously written
using an os whose imbued locale
and whose type's template specialization arguments
charT and traits
were the same as those of is. Postconditions: The is.fmtflags are unchanged. |
explicit linear_congruential_engine(result_type s);
template<class Sseq> explicit linear_congruential_engine(Sseq& q);
explicit mersenne_twister_engine(result_type value);
template<class Sseq> explicit mersenne_twister_engine(Sseq& q);
explicit subtract_with_carry_engine(result_type value);
template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
using minstd_rand0 =
linear_congruential_engine<uint_fast32_t, 16'807, 0, 2'147'483'647>;
using minstd_rand =
linear_congruential_engine<uint_fast32_t, 48'271, 0, 2'147'483'647>;
using mt19937 =
mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31,
0x9908'b0df, 11, 0xffff'ffff, 7, 0x9d2c'5680, 15, 0xefc6'0000, 18, 1'812'433'253>;
using mt19937_64 =
mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
0xb502'6f5a'a966'19e9, 29, 0x5555'5555'5555'5555, 17,
0x71d6'7fff'eda6'0000, 37, 0xfff7'eee0'0000'0000, 43, 6'364'136'223'846'793'005>;
using ranlux24_base =
subtract_with_carry_engine<uint_fast32_t, 24, 10, 24>;
using ranlux48_base =
subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>;
using ranlux24 = discard_block_engine<ranlux24_base, 223, 23>;
using ranlux48 = discard_block_engine<ranlux48_base, 389, 11>;
using knuth_b = shuffle_order_engine<minstd_rand0,256>;
explicit random_device(const string& token);
double entropy() const noexcept;
result_type operator()();
seed_seq();
template<class T>
seed_seq(initializer_list<T> il);
template<class InputIterator>
seed_seq(InputIterator begin, InputIterator end);
template<class RandomAccessIterator>
void generate(RandomAccessIterator begin, RandomAccessIterator end);
size_t size() const noexcept;
template<class OutputIterator>
void param(OutputIterator dest) const;
template<class RealType, size_t bits, class URBG>
RealType generate_canonical(URBG& g);
explicit uniform_int_distribution(IntType a, IntType b = numeric_limits<IntType>::max());
result_type a() const;
result_type b() const;
explicit uniform_real_distribution(RealType a, RealType b = 1.0);
result_type a() const;
result_type b() const;
explicit bernoulli_distribution(double p);
double p() const;
explicit binomial_distribution(IntType t, double p = 0.5);
IntType t() const;
double p() const;
explicit geometric_distribution(double p);
double p() const;
explicit negative_binomial_distribution(IntType k, double p = 0.5);
IntType k() const;
double p() const;
explicit poisson_distribution(double mean);
double mean() const;
explicit exponential_distribution(RealType lambda);
RealType lambda() const;
explicit gamma_distribution(RealType alpha, RealType beta = 1.0);
RealType alpha() const;
RealType beta() const;
explicit weibull_distribution(RealType a, RealType b = 1.0);
RealType a() const;
RealType b() const;
explicit extreme_value_distribution(RealType a, RealType b = 1.0);
RealType a() const;
RealType b() const;
explicit normal_distribution(RealType mean, RealType stddev = 1.0);
RealType mean() const;
RealType stddev() const;
explicit lognormal_distribution(RealType m, RealType s = 1.0);
RealType m() const;
RealType s() const;