Skip to content

Commit 000cd8f

Browse files
committed
philox_engineのサンプル : ループ内でオブジェクトを作るよう修正
1 parent da031c5 commit 000cd8f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

reference/random/philox_engine.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,12 @@ struct Vector {
213213
int main()
214214
{
215215
std::uint32_t seed = 12345;
216-
std::philox4x32 engine;
217216

218217
// 2x2x2個のランダムなベクトルを生成する
219218
for (std::uint32_t x = 0; x < 2; ++x) {
220219
for (std::uint32_t y = 0; y < 2; ++y) {
221220
for (std::uint32_t z = 0; z < 2; ++z) {
222-
engine.seed(seed);
221+
std::philox4x32 engine{seed};
223222
engine.set_counter({x, y, z, 0});
224223

225224
std::uniform_real_distribution<float> dist{0, 1.0};
@@ -236,7 +235,6 @@ int main()
236235
}
237236
```
238237
* std::philox4x32[link philox4x32.md]
239-
* engine.seed[link philox_engine/seed.md]
240238
* engine.set_counter[link philox_engine/set_counter.md]
241239
* uniform_real_distribution[link /reference/random/uniform_real_distribution.md]
242240
* std::uint32_t[link /reference/cstdint/uint32_t.md]

0 commit comments

Comments
 (0)