Using #include <random>

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using #include <random>

Hyon Lim
Hi.
I'm trying to use std::tr1 feature for random generator.

std::tr1::mt19937 generator;  // a core engine class
std::tr1::normal_distribution<int> normal(g_mean, g_sigma);

However compiler gives following error even I specified tr1 namespace.

Users/hyon/Codes/quadrover/Playground/jni/../cpp/BRIEF.h:9: error: 'tr1' is not a namespace-name
/Users/hyon/Codes/quadrover/Playground/jni/../cpp/BRIEF.h:9: error: expected namespace-name before ';' token

I used compiler option "-std=c++0x" for this new feature.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/2ySjqG8OAUUJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Using #include <random>

RichardC
Using: android-ndk-r8d, GCC 4.6 and defining -std=gnu++11

std::mt19937 generator;

Compiled for me (note: std:: not std::tr1)
 

On Tuesday, January 15, 2013 5:30:18 AM UTC, Hyon Lim wrote:
Hi.
I'm trying to use std::tr1 feature for random generator.

std::tr1::mt19937 generator;  // a core engine class
std::tr1::normal_distribution<int> normal(g_mean, g_sigma);

However compiler gives following error even I specified tr1 namespace.

Users/hyon/Codes/quadrover/Playground/jni/../cpp/BRIEF.h:9: error: 'tr1' is not a namespace-name
/Users/hyon/Codes/quadrover/Playground/jni/../cpp/BRIEF.h:9: error: expected namespace-name before ';' token

I used compiler option "-std=c++0x" for this new feature.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/NKsLLEdqBIMJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.