Added svrt.seed(long).
authorFrancois Fleuret <francois@fleuret.org>
Fri, 16 Jun 2017 07:43:16 +0000 (09:43 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Fri, 16 Jun 2017 07:43:16 +0000 (09:43 +0200)
svrt.c
svrt.h

diff --git a/svrt.c b/svrt.c
index 102084b..d1341b6 100644 (file)
--- a/svrt.c
+++ b/svrt.c
@@ -86,6 +86,10 @@ THByteStorage *uncompress(THByteStorage *x) {
   return result;
 }
 
+void seed(long s) {
+  srand48(s);
+}
+
 THByteTensor *generate_vignettes(long n_problem, THLongTensor *labels) {
   struct VignetteSet vs;
   long nb_vignettes;
diff --git a/svrt.h b/svrt.h
index 94020c4..ff77fb9 100644 (file)
--- a/svrt.h
+++ b/svrt.h
@@ -27,4 +27,6 @@ THByteStorage *compress(THByteStorage *x);
 
 THByteStorage *uncompress(THByteStorage *x);
 
+void seed(long s);
+
 THByteTensor *generate_vignettes(long n_problem, THLongTensor *labels);