Skip to content

Commit 9d02fd6

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 810b471 commit 9d02fd6

File tree

3 files changed

+49
-36
lines changed

3 files changed

+49
-36
lines changed

reference/random/philox_engine.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
</head>
8686
<body>
87-
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;random&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;id-type&#34;: [&#34;class template&#34;], &#34;cpp&#34;: [&#34;cpp26&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;4c843ff20f072fdb9b2d3035d50c8020c19530ad&#34;, &#34;source&#34;: &#34;#include &lt;iostream&gt;\n#include &lt;random&gt;\n\nint main()\n{\n std::random_device seed_gen;\n\n // philox_engine\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u8a2d\u5b9a\u6e08\u307f\u5225\u540d\u3067\u3042\u308bphilox4x32\u3092\u4f7f\u7528\u3059\u308b\u3002\n // \u30e9\u30f3\u30c0\u30e0\u306a\u30b7\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u521d\u671f\u5316\n std::philox4x32 engine{seed_gen()};\n\n for (int i = 0; i &lt; 10; ++i) {\n // \u4e71\u6570\u3092\u751f\u6210\n std::uint32_t result = engine();\n std::cout &lt;&lt; result &lt;&lt; std::endl;\n }\n}\n&#34;}, {&#34;id&#34;: &#34;901ac7709c2f1194791f2fb0dcb917e5939bd9dd&#34;, &#34;source&#34;: &#34;#include &lt;print&gt;\n#include &lt;random&gt;\n\nstruct Vector {\n float x, y, z;\n};\n\nint main()\n{\n std::uint32_t seed = 12345;\n std::philox4x32 engine;\n\n // 2x2x2\u500b\u306e\u30e9\u30f3\u30c0\u30e0\u306a\u30d9\u30af\u30c8\u30eb\u3092\u751f\u6210\u3059\u308b\n for (std::uint32_t x = 0; x &lt; 2; ++x) {\n for (std::uint32_t y = 0; y &lt; 2; ++y) {\n for (std::uint32_t z = 0; z &lt; 2; ++z) {\n engine.seed(seed);\n engine.set_counter({x, y, z, 0});\n\n std::uniform_real_distribution&lt;float&gt; dist{0, 1.0};\n\n Vector vec {\n dist(engine),\n dist(engine),\n dist(engine)\n };\n std::println(\&#34;{},{},{}\&#34;, vec.x, vec.y, vec.z);\n }\n }\n }\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;random&#34;, &#34;philox_engine&#34;]}">
87+
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;random&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;id-type&#34;: [&#34;class template&#34;], &#34;cpp&#34;: [&#34;cpp26&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;4c843ff20f072fdb9b2d3035d50c8020c19530ad&#34;, &#34;source&#34;: &#34;#include &lt;iostream&gt;\n#include &lt;random&gt;\n\nint main()\n{\n std::random_device seed_gen;\n\n // philox_engine\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u8a2d\u5b9a\u6e08\u307f\u5225\u540d\u3067\u3042\u308bphilox4x32\u3092\u4f7f\u7528\u3059\u308b\u3002\n // \u30e9\u30f3\u30c0\u30e0\u306a\u30b7\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u521d\u671f\u5316\n std::philox4x32 engine{seed_gen()};\n\n for (int i = 0; i &lt; 10; ++i) {\n // \u4e71\u6570\u3092\u751f\u6210\n std::uint32_t result = engine();\n std::cout &lt;&lt; result &lt;&lt; std::endl;\n }\n}\n&#34;}, {&#34;id&#34;: &#34;d6955fb49fc2bd213a2e67d8003c5b71e9e76aa4&#34;, &#34;source&#34;: &#34;#include &lt;print&gt;\n#include &lt;random&gt;\n\nstruct Vector {\n float x, y, z;\n};\n\nint main()\n{\n std::uint32_t seed = 12345;\n\n // 2x2x2\u500b\u306e\u30e9\u30f3\u30c0\u30e0\u306a\u30d9\u30af\u30c8\u30eb\u3092\u751f\u6210\u3059\u308b\n for (std::uint32_t x = 0; x &lt; 2; ++x) {\n for (std::uint32_t y = 0; y &lt; 2; ++y) {\n for (std::uint32_t z = 0; z &lt; 2; ++z) {\n std::philox4x32 engine{seed};\n engine.set_counter({x, y, z, 0});\n\n std::uniform_real_distribution&lt;float&gt; dist{0, 1.0};\n\n Vector vec {\n dist(engine),\n dist(engine),\n dist(engine)\n };\n std::println(\&#34;{},{},{}\&#34;, vec.x, vec.y, vec.z);\n }\n }\n }\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;random&#34;, &#34;philox_engine&#34;]}">
8888
<nav class="navbar navbar-default" role="navigation">
8989
<div class="container-fluid">
9090
<div class="navbar-header">
@@ -204,8 +204,8 @@
204204

205205
<p class="text-right"><small>
206206
最終更新日時(UTC):
207-
<span itemprop="datePublished" content="2024-12-19T13:00:57">
208-
2024年12月19日 13時00分57秒
207+
<span itemprop="datePublished" content="2024-12-19T13:18:14">
208+
2024年12月19日 13時18分14秒
209209
</span>
210210
<br/>
211211
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -646,7 +646,7 @@ <h4>出力例</h4>
646646
859307553
647647
</code></pre></p>
648648
<h3>多次元の乱数を生成する例</h3>
649-
<p><div class="yata" id="901ac7709c2f1194791f2fb0dcb917e5939bd9dd"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../print.html">&lt;print&gt;</a></span><span class="cp"></span>
649+
<p><div class="yata" id="d6955fb49fc2bd213a2e67d8003c5b71e9e76aa4"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../print.html">&lt;print&gt;</a></span><span class="cp"></span>
650650
<span class="cp">#include</span> <span class="cpf"><a href="../random.html">&lt;random&gt;</a></span><span class="cp"></span>
651651

652652
<span class="k">struct</span> <span class="n">Vector</span> <span class="p">{</span>
@@ -656,13 +656,12 @@ <h3>多次元の乱数を生成する例</h3>
656656
<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
657657
<span class="p">{</span>
658658
<span class="n"><a href="../cstdint/uint32_t.html">std::uint32_t</a></span> <span class="n">seed</span> <span class="o">=</span> <span class="mi">12345</span><span class="p">;</span>
659-
<span class="n"><a href="philox4x32.html">std::philox4x32</a></span> <span class="n">engine</span><span class="p">;</span>
660659

661660
<span class="c1">// 2x2x2個のランダムなベクトルを生成する</span>
662661
<span class="k">for</span> <span class="p">(</span><span class="n"><a href="../cstdint/uint32_t.html">std::uint32_t</a></span> <span class="n">x</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">x</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">;</span> <span class="o">++</span><span class="n">x</span><span class="p">)</span> <span class="p">{</span>
663662
<span class="k">for</span> <span class="p">(</span><span class="n"><a href="../cstdint/uint32_t.html">std::uint32_t</a></span> <span class="n">y</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">y</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">;</span> <span class="o">++</span><span class="n">y</span><span class="p">)</span> <span class="p">{</span>
664663
<span class="k">for</span> <span class="p">(</span><span class="n"><a href="../cstdint/uint32_t.html">std::uint32_t</a></span> <span class="n">z</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">z</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">;</span> <span class="o">++</span><span class="n">z</span><span class="p">)</span> <span class="p">{</span>
665-
<span class="n"><a href="philox_engine/seed.html">engine.seed</a></span><span class="p">(</span><span class="n">seed</span><span class="p">);</span>
664+
<span class="n"><a href="philox4x32.html">std::philox4x32</a></span> <span class="n">engine</span><span class="p">{</span><span class="n">seed</span><span class="p">};</span>
666665
<span class="n"><a href="philox_engine/set_counter.html">engine.set_counter</a></span><span class="p">({</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span><span class="p">,</span> <span class="mi">0</span><span class="p">});</span>
667666

668667
<span class="n">std</span><span class="o">::</span><span class="n"><a href="uniform_real_distribution.html">uniform_real_distribution</a></span><span class="o">&lt;</span><span class="kt">float</span><span class="o">&gt;</span> <span class="n">dist</span><span class="p">{</span><span class="mi">0</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">};</span>

rss.xml

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,51 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2024-12-19T13:16:29.640696</updated>
6-
<id>8be6638d-efe7-4484-9e22-9bd6be953073</id>
5+
<updated>2024-12-19T13:21:18.944893</updated>
6+
<id>62ec3ac5-d4f4-4aa8-a73e-1d3f29198a2b</id>
77

88

9+
<entry>
10+
<title>philox_engine -- philox_engineのサンプル : ループ内でオブジェクトを作るよう修正</title>
11+
<link href="https://cpprefjp.github.io/reference/random/philox_engine.html"/>
12+
<id>000cd8fb45da8eb4f823102d56ae6fa10b67f2ab:reference/random/philox_engine.md</id>
13+
<updated>2024-12-19T22:18:14+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md
16+
index 4a60b07dc..4fa2ae4b5 100644
17+
--- a/reference/random/philox_engine.md
18+
+++ b/reference/random/philox_engine.md
19+
@@ -213,13 +213,12 @@ struct Vector {
20+
int main()
21+
{
22+
std::uint32_t seed = 12345;
23+
- std::philox4x32 engine;
24+
25+
// 2x2x2個のランダムなベクトルを生成する
26+
for (std::uint32_t x = 0; x &amp;lt; 2; ++x) {
27+
for (std::uint32_t y = 0; y &amp;lt; 2; ++y) {
28+
for (std::uint32_t z = 0; z &amp;lt; 2; ++z) {
29+
- engine.seed(seed);
30+
+ std::philox4x32 engine{seed};
31+
engine.set_counter({x, y, z, 0});
32+
33+
std::uniform_real_distribution&amp;lt;float&amp;gt; dist{0, 1.0};
34+
@@ -236,7 +235,6 @@ int main()
35+
}
36+
```
37+
* std::philox4x32[link philox4x32.md]
38+
-* engine.seed[link philox_engine/seed.md]
39+
* engine.set_counter[link philox_engine/set_counter.md]
40+
* uniform_real_distribution[link /reference/random/uniform_real_distribution.md]
41+
* std::uint32_t[link /reference/cstdint/uint32_t.md]
42+
&lt;/code&gt;&lt;/pre&gt;</summary>
43+
44+
<author>
45+
<name>Akira Takahashi</name>
46+
<email>[email protected]</email>
47+
</author>
48+
</entry>
49+
950
<entry>
1051
<title>set_counter -- philox_engine::set_counter : シード値を状態として保持してないことを記載</title>
1152
<link href="https://cpprefjp.github.io/reference/random/philox_engine/set_counter.html"/>
@@ -166,31 +207,4 @@ index 94e62dcf2..62a8fa34e 100644
166207
</author>
167208
</entry>
168209

169-
<entry>
170-
<title>philox_engine -- コメント修正忘れ</title>
171-
<link href="https://cpprefjp.github.io/reference/random/philox_engine.html"/>
172-
<id>7b0c554ae195c2b40a7680451443ecdd83ec4825:reference/random/philox_engine.md</id>
173-
<updated>2024-12-19T22:00:57+09:00</updated>
174-
175-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md
176-
index 902f2cc4c..4a60b07dc 100644
177-
--- a/reference/random/philox_engine.md
178-
+++ b/reference/random/philox_engine.md
179-
@@ -215,7 +215,7 @@ int main()
180-
std::uint32_t seed = 12345;
181-
std::philox4x32 engine;
182-
183-
- // 4x4x4個のランダムなベクトルを生成する
184-
+ // 2x2x2個のランダムなベクトルを生成する
185-
for (std::uint32_t x = 0; x &amp;lt; 2; ++x) {
186-
for (std::uint32_t y = 0; y &amp;lt; 2; ++y) {
187-
for (std::uint32_t z = 0; z &amp;lt; 2; ++z) {
188-
&lt;/code&gt;&lt;/pre&gt;</summary>
189-
190-
<author>
191-
<name>Akira Takahashi</name>
192-
<email>[email protected]</email>
193-
</author>
194-
</entry>
195-
196210
</feed>

sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913

914914
<url>
915915
<loc>https://cpprefjp.github.io/reference/random/philox_engine.html</loc>
916-
<lastmod>2024-12-19T22:00:57+09:00</lastmod>
916+
<lastmod>2024-12-19T22:18:14+09:00</lastmod>
917917
<changefreq>daily</changefreq>
918918
<priority>0.7</priority>
919919
</url>

0 commit comments

Comments
 (0)