Namespaces
Variants
Actions

std::philox_engine<UIntType,w,n,r,consts>::set_counter

From cppreference.com
< cpp‎ | numeric‎ | random‎ | philox engine
 
C++
 
Numerics library
 
Pseudo-random number generation
 
std::philox_engine
Member functions
philox_engine::set_counter
Generation
Characteristics
Non-member functions
(C++26)
(C++26)(C++26)
 
void set_counter( const std::array<result_type, n>& c );
(since C++26)

Sets the counter of the random-number engine.

  • For each integer k in [0n), sets Xk to cn-1-k mod 2w
    .
  • The value of j is set to n - 1.[1]
  1. As j is being set to n - 1, the next state transition always generates new random values.

[edit] Parameters

c - counter sequence to use to set the counter

[edit] Complexity

O(n).

[edit] See also

constructs the engine
(public member function) [edit]
sets the current state of the engine
(public member function) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant