Using a public PRNG and uniform distribution (C++17)
I am trying to implement a PRNG I found online yet I am having compile time issues (seen below):
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4010): error C2061: syntax error: identifier 'result_type'
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2923: 'std::conditional_t': '_Ty1' is not a valid template type argument for parameter '_Ty2'
This is my code:
std::random_device rd;
small_prng engine;
std::uniform_int_distribution< int > ud( 0, 50 );
for ( auto i = 0; i < 100; i++ )
printf( "%in", ud( engine ) );
And this is the code I got online...
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
using value_type = uint32_t;
explicit small_prng( uint32_t seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
inline uint32_t operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
;
Is there any reason this isn't working? How come? Compiling using Visual Studio 2017.
c++ visual-studio random visual-studio-2017
|
show 5 more comments
I am trying to implement a PRNG I found online yet I am having compile time issues (seen below):
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4010): error C2061: syntax error: identifier 'result_type'
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2923: 'std::conditional_t': '_Ty1' is not a valid template type argument for parameter '_Ty2'
This is my code:
std::random_device rd;
small_prng engine;
std::uniform_int_distribution< int > ud( 0, 50 );
for ( auto i = 0; i < 100; i++ )
printf( "%in", ud( engine ) );
And this is the code I got online...
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
using value_type = uint32_t;
explicit small_prng( uint32_t seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
inline uint32_t operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
;
Is there any reason this isn't working? How come? Compiling using Visual Studio 2017.
c++ visual-studio random visual-studio-2017
Better use<random>standard header
– Basile Starynkevitch
Nov 11 at 13:12
Where is the class definition?
– Matteo Italia
Nov 11 at 13:12
apologies @MatteoItalia added it now.
– john tope
Nov 11 at 13:13
@BasileStarynkevitch I'd rather not... the entire reason I'm doing this is for performance.
– john tope
Nov 11 at 13:13
Have you benchmarked? Mersenne Twister runs very quickly
– Basile Starynkevitch
Nov 11 at 13:15
|
show 5 more comments
I am trying to implement a PRNG I found online yet I am having compile time issues (seen below):
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4010): error C2061: syntax error: identifier 'result_type'
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2923: 'std::conditional_t': '_Ty1' is not a valid template type argument for parameter '_Ty2'
This is my code:
std::random_device rd;
small_prng engine;
std::uniform_int_distribution< int > ud( 0, 50 );
for ( auto i = 0; i < 100; i++ )
printf( "%in", ud( engine ) );
And this is the code I got online...
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
using value_type = uint32_t;
explicit small_prng( uint32_t seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
inline uint32_t operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
;
Is there any reason this isn't working? How come? Compiling using Visual Studio 2017.
c++ visual-studio random visual-studio-2017
I am trying to implement a PRNG I found online yet I am having compile time issues (seen below):
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4010): error C2061: syntax error: identifier 'result_type'
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2065: '_Ty1': undeclared identifier
1>c:program files (x86)microsoft visual studio2017communityvctoolsmsvc14.15.26726includexutility(4012): error C2923: 'std::conditional_t': '_Ty1' is not a valid template type argument for parameter '_Ty2'
This is my code:
std::random_device rd;
small_prng engine;
std::uniform_int_distribution< int > ud( 0, 50 );
for ( auto i = 0; i < 100; i++ )
printf( "%in", ud( engine ) );
And this is the code I got online...
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
using value_type = uint32_t;
explicit small_prng( uint32_t seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
inline uint32_t operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
;
Is there any reason this isn't working? How come? Compiling using Visual Studio 2017.
c++ visual-studio random visual-studio-2017
c++ visual-studio random visual-studio-2017
edited Nov 11 at 13:13
asked Nov 11 at 13:10
john tope
33
33
Better use<random>standard header
– Basile Starynkevitch
Nov 11 at 13:12
Where is the class definition?
– Matteo Italia
Nov 11 at 13:12
apologies @MatteoItalia added it now.
– john tope
Nov 11 at 13:13
@BasileStarynkevitch I'd rather not... the entire reason I'm doing this is for performance.
– john tope
Nov 11 at 13:13
Have you benchmarked? Mersenne Twister runs very quickly
– Basile Starynkevitch
Nov 11 at 13:15
|
show 5 more comments
Better use<random>standard header
– Basile Starynkevitch
Nov 11 at 13:12
Where is the class definition?
– Matteo Italia
Nov 11 at 13:12
apologies @MatteoItalia added it now.
– john tope
Nov 11 at 13:13
@BasileStarynkevitch I'd rather not... the entire reason I'm doing this is for performance.
– john tope
Nov 11 at 13:13
Have you benchmarked? Mersenne Twister runs very quickly
– Basile Starynkevitch
Nov 11 at 13:15
Better use
<random> standard header– Basile Starynkevitch
Nov 11 at 13:12
Better use
<random> standard header– Basile Starynkevitch
Nov 11 at 13:12
Where is the class definition?
– Matteo Italia
Nov 11 at 13:12
Where is the class definition?
– Matteo Italia
Nov 11 at 13:12
apologies @MatteoItalia added it now.
– john tope
Nov 11 at 13:13
apologies @MatteoItalia added it now.
– john tope
Nov 11 at 13:13
@BasileStarynkevitch I'd rather not... the entire reason I'm doing this is for performance.
– john tope
Nov 11 at 13:13
@BasileStarynkevitch I'd rather not... the entire reason I'm doing this is for performance.
– john tope
Nov 11 at 13:13
Have you benchmarked? Mersenne Twister runs very quickly
– Basile Starynkevitch
Nov 11 at 13:15
Have you benchmarked? Mersenne Twister runs very quickly
– Basile Starynkevitch
Nov 11 at 13:15
|
show 5 more comments
1 Answer
1
active
oldest
votes
The requirements for a random engine are outlined at [rand.req.eng]; you can find here a summary of them; in particular you are missing (highlighted through the code with a MISSING comment):
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
// MISSING: the result type must indeed be called `result_type`
using result_type = uint32_t;
// MISSING: you must provide min and max, with the
// minimum/maximum value your RNG can return
result_type min() const noexcept return 0;
result_type max() const noexcept return 0xffffffff;
explicit small_prng( result_type seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
// MISSING: constructor from a SeedSequence (see https://en.cppreference.com/w/cpp/named_req/SeedSequence)
template<typename S>
explicit small_prng(S &seq)
uint32_t nseed[1];
seq.generate(nseed, nseed+1);
seed(nseed[0]);
// MISSING: seed() overloads
void seed() *this = small_prng();
void seed(result_type seed) *this = small_prng(seed);
template<typename S> void seed(S &seq) *this = small_prng(seq);
inline result_type operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
// MISSING: discard n extractions
void discard(unsigned long long z)
// does this engine implement more efficient jump-ahead?
while(z--) (*this)();
// MISSING: dump generator state operator
friend std::ostream &operator<<(std::ostream &os, const small_prng &r)
return os<<r.a<<" "<<r.b<<" "<<r.c<<" "<<r.d<<" ";
// MISSING: read from generator state dump operator
friend std::istream &operator>>(std::istream &is, small_prng &r)
return is>>r.a>>r.b>>r.c>>r.d;
;
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249057%2fusing-a-public-prng-and-uniform-distribution-c17%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The requirements for a random engine are outlined at [rand.req.eng]; you can find here a summary of them; in particular you are missing (highlighted through the code with a MISSING comment):
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
// MISSING: the result type must indeed be called `result_type`
using result_type = uint32_t;
// MISSING: you must provide min and max, with the
// minimum/maximum value your RNG can return
result_type min() const noexcept return 0;
result_type max() const noexcept return 0xffffffff;
explicit small_prng( result_type seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
// MISSING: constructor from a SeedSequence (see https://en.cppreference.com/w/cpp/named_req/SeedSequence)
template<typename S>
explicit small_prng(S &seq)
uint32_t nseed[1];
seq.generate(nseed, nseed+1);
seed(nseed[0]);
// MISSING: seed() overloads
void seed() *this = small_prng();
void seed(result_type seed) *this = small_prng(seed);
template<typename S> void seed(S &seq) *this = small_prng(seq);
inline result_type operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
// MISSING: discard n extractions
void discard(unsigned long long z)
// does this engine implement more efficient jump-ahead?
while(z--) (*this)();
// MISSING: dump generator state operator
friend std::ostream &operator<<(std::ostream &os, const small_prng &r)
return os<<r.a<<" "<<r.b<<" "<<r.c<<" "<<r.d<<" ";
// MISSING: read from generator state dump operator
friend std::istream &operator>>(std::istream &is, small_prng &r)
return is>>r.a>>r.b>>r.c>>r.d;
;
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
add a comment |
The requirements for a random engine are outlined at [rand.req.eng]; you can find here a summary of them; in particular you are missing (highlighted through the code with a MISSING comment):
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
// MISSING: the result type must indeed be called `result_type`
using result_type = uint32_t;
// MISSING: you must provide min and max, with the
// minimum/maximum value your RNG can return
result_type min() const noexcept return 0;
result_type max() const noexcept return 0xffffffff;
explicit small_prng( result_type seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
// MISSING: constructor from a SeedSequence (see https://en.cppreference.com/w/cpp/named_req/SeedSequence)
template<typename S>
explicit small_prng(S &seq)
uint32_t nseed[1];
seq.generate(nseed, nseed+1);
seed(nseed[0]);
// MISSING: seed() overloads
void seed() *this = small_prng();
void seed(result_type seed) *this = small_prng(seed);
template<typename S> void seed(S &seq) *this = small_prng(seq);
inline result_type operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
// MISSING: discard n extractions
void discard(unsigned long long z)
// does this engine implement more efficient jump-ahead?
while(z--) (*this)();
// MISSING: dump generator state operator
friend std::ostream &operator<<(std::ostream &os, const small_prng &r)
return os<<r.a<<" "<<r.b<<" "<<r.c<<" "<<r.d<<" ";
// MISSING: read from generator state dump operator
friend std::istream &operator>>(std::istream &is, small_prng &r)
return is>>r.a>>r.b>>r.c>>r.d;
;
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
add a comment |
The requirements for a random engine are outlined at [rand.req.eng]; you can find here a summary of them; in particular you are missing (highlighted through the code with a MISSING comment):
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
// MISSING: the result type must indeed be called `result_type`
using result_type = uint32_t;
// MISSING: you must provide min and max, with the
// minimum/maximum value your RNG can return
result_type min() const noexcept return 0;
result_type max() const noexcept return 0xffffffff;
explicit small_prng( result_type seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
// MISSING: constructor from a SeedSequence (see https://en.cppreference.com/w/cpp/named_req/SeedSequence)
template<typename S>
explicit small_prng(S &seq)
uint32_t nseed[1];
seq.generate(nseed, nseed+1);
seed(nseed[0]);
// MISSING: seed() overloads
void seed() *this = small_prng();
void seed(result_type seed) *this = small_prng(seed);
template<typename S> void seed(S &seq) *this = small_prng(seq);
inline result_type operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
// MISSING: discard n extractions
void discard(unsigned long long z)
// does this engine implement more efficient jump-ahead?
while(z--) (*this)();
// MISSING: dump generator state operator
friend std::ostream &operator<<(std::ostream &os, const small_prng &r)
return os<<r.a<<" "<<r.b<<" "<<r.c<<" "<<r.d<<" ";
// MISSING: read from generator state dump operator
friend std::istream &operator>>(std::istream &is, small_prng &r)
return is>>r.a>>r.b>>r.c>>r.d;
;
The requirements for a random engine are outlined at [rand.req.eng]; you can find here a summary of them; in particular you are missing (highlighted through the code with a MISSING comment):
class small_prng
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
static inline uint32_t rot( uint32_t x, uint32_t k ) noexcept ( ( x ) >> ( 32 - ( k ) ) ) );
public:
// MISSING: the result type must indeed be called `result_type`
using result_type = uint32_t;
// MISSING: you must provide min and max, with the
// minimum/maximum value your RNG can return
result_type min() const noexcept return 0;
result_type max() const noexcept return 0xffffffff;
explicit small_prng( result_type seed = 0xdeadbeef ) noexcept
a = 0xf1ea5eed;
b = c = d = seed;
for ( size_t i = 0; i < 20; ++i )
( *this )( );
// MISSING: constructor from a SeedSequence (see https://en.cppreference.com/w/cpp/named_req/SeedSequence)
template<typename S>
explicit small_prng(S &seq)
uint32_t nseed[1];
seq.generate(nseed, nseed+1);
seed(nseed[0]);
// MISSING: seed() overloads
void seed() *this = small_prng();
void seed(result_type seed) *this = small_prng(seed);
template<typename S> void seed(S &seq) *this = small_prng(seq);
inline result_type operator()( ) noexcept
uint32_t e = a - rot( b, 27 );
a = b ^ rot( c, 17 );
b = c + d;
c = d + e;
d = e + a;
return d;
// MISSING: discard n extractions
void discard(unsigned long long z)
// does this engine implement more efficient jump-ahead?
while(z--) (*this)();
// MISSING: dump generator state operator
friend std::ostream &operator<<(std::ostream &os, const small_prng &r)
return os<<r.a<<" "<<r.b<<" "<<r.c<<" "<<r.d<<" ";
// MISSING: read from generator state dump operator
friend std::istream &operator>>(std::istream &is, small_prng &r)
return is>>r.a>>r.b>>r.c>>r.d;
;
edited Nov 12 at 16:34
answered Nov 12 at 14:57
Matteo Italia
98.5k15140238
98.5k15140238
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
add a comment |
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
is the sequence constructor call correct? This suggests the arguments should denote a range to write into.
– Caleth
Nov 12 at 15:21
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
@Caleth: indeed you are right, I misunderstood. Fixing...
– Matteo Italia
Nov 12 at 16:31
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53249057%2fusing-a-public-prng-and-uniform-distribution-c17%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Better use
<random>standard header– Basile Starynkevitch
Nov 11 at 13:12
Where is the class definition?
– Matteo Italia
Nov 11 at 13:12
apologies @MatteoItalia added it now.
– john tope
Nov 11 at 13:13
@BasileStarynkevitch I'd rather not... the entire reason I'm doing this is for performance.
– john tope
Nov 11 at 13:13
Have you benchmarked? Mersenne Twister runs very quickly
– Basile Starynkevitch
Nov 11 at 13:15