@@ -58,10 +58,11 @@ distributions**, every one of them with:
5858<Tab value = " Rust" >
5959``` rust
6060use stochastic_rs :: distributions :: normal :: SimdNormal ;
61+ use stochastic_rs :: simd_rng :: Deterministic ;
6162use stochastic_rs :: traits :: DistributionExt ;
6263use rand_distr :: Distribution ;
6364
64- let d = SimdNormal :: <f64 >:: with_seed (/* mean */ 0.0 , /* std */ 1.0 , 42 );
65+ let d = SimdNormal :: <f64 >:: new (/* mean */ 0.0 , /* std */ 1.0 , & Deterministic :: new ( 42 ) );
6566
6667// Single sample
6768let mut rng = rand :: thread_rng ();
@@ -100,9 +101,10 @@ print(d.pdf(0.0), d.cdf(1.96)) # 0.3989, 0.975
100101<Tab value = " Rust" >
101102``` rust
102103use stochastic_rs :: distributions :: beta :: SimdBeta ;
104+ use stochastic_rs :: simd_rng :: Deterministic ;
103105use stochastic_rs :: traits :: DistributionExt ;
104106
105- let d = SimdBeta :: <f64 >:: with_seed (/* alpha */ 2.0 , /* beta */ 5.0 , 42 );
107+ let d = SimdBeta :: <f64 >:: new (/* alpha */ 2.0 , /* beta */ 5.0 , & Deterministic :: new ( 42 ) );
106108let mut buf = vec! [0.0 ; 1_000 ];
107109d . fill_slice_fast (& mut buf );
108110assert! (buf . iter (). all (| & x | x >= 0.0 && x <= 1.0 ));
@@ -130,8 +132,9 @@ print(d.mean(), d.variance()) # 0.2857, 0.0255
130132<Tab value = " Rust" >
131133``` rust
132134use stochastic_rs :: distributions :: poisson :: SimdPoisson ;
135+ use stochastic_rs :: simd_rng :: Deterministic ;
133136
134- let d = SimdPoisson :: <f64 >:: with_seed (/* lambda */ 4.0 , 42 );
137+ let d = SimdPoisson :: <u32 >:: new (/* lambda */ 4.0 , & Deterministic :: new ( 42 ) );
135138let mut buf = vec! [0_u32 ; 10_000 ];
136139d . fill_slice_fast (& mut buf );
137140
@@ -154,10 +157,20 @@ print(counts.mean(), counts.var()) # both ≈ 4.0
154157
155158### Construction
156159
160+ Every distribution follows the same ` new(args, &seed) ` constructor pattern — pass
161+ [ ` Unseeded ` ] ( /docs/concepts/seeding ) for an auto-seeded RNG or
162+ [ ` Deterministic::new(u64) ` ] ( /docs/concepts/seeding ) for a reproducible
163+ stream. See the [ seeding concept page] ( /docs/concepts/seeding ) for the
164+ full design (including ` SeedExt::reseed ` , the generic ` R: SimdRngExt `
165+ backing RNG, and the experimental ` dual-stream-rng ` feature).
166+
157167``` rust
158- let d = Foo :: <T >:: new (/* params */ ); // thread-local seed
159- let d = Foo :: <T >:: with_seed (/* params */ , /* seed */ 42 ); // explicit seed
160- let d = Foo :: <T >:: from_seed_source (/* params */ , source ); // chain seeds
168+ use stochastic_rs :: simd_rng :: {Deterministic , Unseeded };
169+
170+ let d = Foo :: <T >:: new (/* params */ , & Unseeded ); // auto-seeded
171+ let d = Foo :: <T >:: new (/* params */ , & Deterministic :: new (42 )); // reproducible
172+ let d = Foo :: <T >:: new (/* params */ , & shared_seed_source ); // share a seed source
173+ // across sub-components
161174```
162175
163176### Sampling
0 commit comments