Index: include/bn/randmt.h
===================================================================
--- include/bn/randmt.h	(revision 70553)
+++ include/bn/randmt.h	(working copy)
@@ -19,43 +19,14 @@
  */
 
 /*----------------------------------------------------------------------*/
-/** @addtogroup bn_rmt
- *
- * @brief
- * Mersenne Twister random number generation as defined by MT19937.
- *
- * Generates one pseudorandom real number (double) which is uniformly
- * distributed on [0, 1]-interval, for each call.
- *
- * @par Usage:
- @code
- double d;
+// Uses the Mersenne Twister C++ STL's implementation. It generates numbers between 0 and 1.
+#define ul unsigned long
+#include <random>
+#include "src/libbn/randmt.cpp"
 
- bn_randmt_seed(integer_seed);
+void bn_randmt_seed(); //To use a new seed
 
- while (NEED_MORE_RAND_NUMBERS) {
- d = bn_randmt();
- }
- @endcode
- *
- */
-/** @{ */
-/** @file randmt.h */
-
-#ifndef BN_RANDMT_H
-#define BN_RANDMT_H
-
-#include "common.h"
-#include "bn/defines.h"
-
-__BEGIN_DECLS
-
-BN_EXPORT extern double bn_randmt(void);
-BN_EXPORT extern void bn_randmt_seed(unsigned long seed);
-
-__END_DECLS
-
-#endif  /* BN_RANDMT_H */
+double bn_randmt(void);//Return random number between 0 and 1
 /** @} */
 /*
  * Local Variables:
Index: include/bn/randmt.hpp
===================================================================
Index: random.cpp
===================================================================
--- random.cpp	(nonexistent)
+++ random.cpp	(working copy)
@@ -0,0 +1,64 @@
+#define ll long long
+
+#include <random>
+#include "bu.h"
+#include "bn.h"
+#include <iostream>
+#include <stdlib.h>
+#include <climits>
+#include "SFMT.h"
+
+using namespace std;
+
+volatile uint64_t a=0;
+
+void bn_rand(ll int nbr){
+    bn_randmt_seed(0);
+    for (int i=0; i<nbr; i++){
+        a+=(double)bn_randmt()*10;
+    }
+    cout << a << endl;
+    a=0;
+}
+void STL_rand(ll int nbr){
+    mt19937_64 r(0);
+    for (int i=0; i<nbr; i++){
+        a+=(double)r()/ULLONG_MAX*10;
+    }
+    cout << a << endl;
+    a=0;
+}
+void SFMT_rand(ll int nbr){
+    sfmt_t sfmt;
+    sfmt_init_gen_rand(&sfmt, 0);
+    for (int i=0; i<nbr; i++){
+        a+=(double)sfmt_genrand_res53(&sfmt)*10;
+    }
+    cout << a << endl;
+    a=0;
+}
+
+void match(){
+    bn_randmt_seed(1);
+    mt19937_64 r(1);
+    sfmt_t sfmt;
+    sfmt_init_gen_rand(&sfmt, 1);
+    for (int i=0; i<10; i++){
+        cout << bn_randmt() << " " << (double)r()/ULLONG_MAX << " " << sfmt_genrand_res53(&sfmt) << endl;
+    }
+}
+
+int main(int ac, char *av[]) {
+    int nb;
+    cout << "How many values would you like to test? " << endl;
+    cin >> nb;
+    ll int time1=bu_gettime();
+    bn_rand(nb);
+    ll int time2=bu_gettime();
+    STL_rand(nb);
+    ll int time3=bu_gettime();
+    SFMT_rand(nb);
+    cout << "Time for bn_randmt: " << time2-time1 << endl << "Time for STL rand:  " << time3-time2 << endl << "Time for SFMT rand: " << bu_gettime()-time3 << endl;
+    match();
+    return 0;
+}
Index: src/libbn/randmt.cpp
===================================================================
--- src/libbn/randmt.cpp	(nonexistent)
+++ src/libbn/randmt.cpp	(working copy)
@@ -0,0 +1,48 @@
+/*                              R A N D M T . C P P
+* BRL-CAD
+*
+* Copyright (c) 2004-2016 United States Government as represented by
+* the U.S. Army Research Laboratory.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public License
+* version 2.1 as published by the Free Software Foundation.
+*
+* This library is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this file; see the file named COPYING for more
+* information.
+*/
+
+/*----------------------------------------------------------------------*/
+//BRL-CAD
+//Generating random number between 0 and ULLONG_MAX using the C++ STL's randmt and dividing it by ULLONG_MAX to generate a number between 0 and 1, which is an implementation of the Mersenne Twister for BRL-CAD.
+
+#define ul unsigned long
+#include <random>
+#include <climits>
+
+using namespace std;
+
+mt19937_64 rando(0);
+
+void bn_randmt_seed(ul s){
+    rando.seed(s); //Replace the current seed with the new one
+}
+
+double bn_randmt(void){
+    return (double)rando()/ULLONG_MAX; //Random generates a number between 0 and 1
+}
+
+/*
+ * Local Variables:
+ * mode: C++
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
