std::subtract_with_carry_engine<UIntType,w,s,r>:: seed
From cppreference.net
<
cpp
|
numeric
|
random
|
subtract with carry engine
C++
Numerics library
| Common mathematical functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical special functions (C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Mathematical constants (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Basic linear algebra algorithms (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Data-parallel types (SIMD) (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Floating-point environment (C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric array (
valarray
)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bit manipulation (C++20) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Saturation arithmetic (C++26) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pseudo-random number generation
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::subtract_with_carry_engine
| Member functions | ||||
|
subtract_with_carry_engine::seed
|
||||
| Generation | ||||
| Characteristics | ||||
| Non-member functions | ||||
|
(C++11)
(C++11)
(until C++20)
|
||||
|
(C++11)
(C++11)
|
|
void
seed
(
result_type value
=
0u
)
;
|
(1) | (desde C++11) |
|
template
<
class
SeedSeq
>
void seed ( SeedSeq & seq ) ; |
(2) | (desde C++11) |
Establece el estado del motor de números aleatorios.
1)
Inmediatamente después de establecer el estado,
*
this
==
std::
subtract_with_carry_engine
(
value
)
es
true
.
2)
Inmediatamente después de establecer el estado,
*
this
==
std::
subtract_with_carry_engine
(
seq
)
es
true
.
Contenidos |
Parámetros
| value | - | valor de semilla a utilizar para establecer el estado |
| seq | - | secuencia de semilla a utilizar para establecer el estado |
Excepciones
Complejidad
1)
Igual que
std::
subtract_with_carry_engine
(
value
)
.
2)
Igual que
std::
subtract_with_carry_engine
(
seq
)
.
Informes de defectos
Los siguientes informes de defectos que modifican el comportamiento se aplicaron retroactivamente a los estándares de C++ publicados anteriormente.
| DR | Aplicado a | Comportamiento publicado | Comportamiento correcto |
|---|---|---|---|
| LWG 2181 | C++11 |
la sobrecarga
(
2
)
no lanzaría excepción incluso si la llamada
seq.generate
lanza
|
propaga la excepción |
| LWG 3809 | C++11 | el argumento por defecto de value era default_seed | cambiado a 0u |
Véase también
|
construye el motor
(función miembro pública) |