Article View: pl.comp.programming
Article #217479Re: Jak zrobić test za pomocą PractRand?
From: M.M.
Date: Fri, 20 Aug 2021 13:04
Date: Fri, 20 Aug 2021 13:04
49 lines
3140 bytes
3140 bytes
On Thursday, August 19, 2021 at 6:15:26 PM UTC+2, osobli...@gmail.com wrote:
> Czy ktoś z Was robił testy generatorów liczb pseudolosowych za pomocą PractRand?
Jeśli chce Ci się czytać C++ to możesz zobaczyć jak ja to zrobiłem:
https://github.com/mmarszik/MRndCPP
https://github.com/mmarszik/MRndCPP/blob/master/tests/test.sh
{ time ./$prog | ./../../PractRand/RNG_test stdin -singlethreaded -tlmax 360000s > $test; } 2> $time
https://github.com/mmarszik/MRndCPP/blob/master/test01.cpp
fwrite( buf, 1, sizeof(buf), stdout );
>
> Przeczytałem instrukcje stąd:
>
> https://www.pcg-random.org/posts/how-to-test-with-practrand.html
>
> I zrobiłem build process na konsoli Ubuntu na Windowsie. Chcę jednak zrobić test mojego własnego generatora. Rozumiem, że muszę napisać kod w C++. Skopiowałem kod:
>
> #include <cstdio>
> #include <cstdint>
>
> #include <random>
>
> int main()
> {
> freopen(NULL, "wb", stdout); // Only necessary on Windows, but harmless.
>
> std::mt19937 rng(42);
>
> while (1) {
> uint32_t value = rng();
> fwrite((void*) &value, sizeof(value), 1, stdout);
> }
> }
>
> ale nie udało mi się go skompilować. Wynik:
>
> g++: error: mt19937-min.cpp: No such file or directory
> g++: fatal error: no input files
> compilation terminated.
>
> Nie wiem właściwie nic o C++, znam podstawy programowania w Pythonie, więc może coś robię źle? Niemniej, kod mojego generatora w C++ jakoś sobie prędzej, czy później napiszę, choć liczyłem, że będzie można użyć pliku txt z wygenerowanymi już liczbami. Najważniejsze jest dla mnie jak to uruchomić.
Słyszałem że temat generowania liczb pseudo-losowych jest bardzo trudny :/
Pozdrawiam
Technical Details
Message-ID:
<0b0e0278-0506-4691-8051-1f73a327e87an@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mailReferences:
<6a2d60cf-5d52-4f70-a0bb-67ac51f2ea47n@googlegroups.com>Show Full Headers
Complete Article Headers
X-Received: by 2002:ad4:5c68:: with SMTP id i8mr19983364qvh.54.1629464652994; Fri, 20 Aug 2021 06:04:12 -0700 (PDT) X-Received: by 2002:ac8:7682:: with SMTP id g2mr2497935qtr.349.1629464652845; Fri, 20 Aug 2021 06:04:12 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!2.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: pl.comp.programming Date: Fri, 20 Aug 2021 06:04:12 -0700 (PDT) In-Reply-To: <6a2d60cf-5d52-4f70-a0bb-67ac51f2ea47n@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=37.128.16.171; posting-account=xjvq9QoAAAATMPC2X3btlHd_LkaJo_rj NNTP-Posting-Host: 37.128.16.171 References: <6a2d60cf-5d52-4f70-a0bb-67ac51f2ea47n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0b0e0278-0506-4691-8051-1f73a327e87an@googlegroups.com> Subject: Re: Jak zrobić test za pomocą PractRand? From: "M.M." <mmarszik@gmail.com> Injection-Date: Fri, 20 Aug 2021 13:04:12 +0000 X-Received-Bytes: 3253 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit