Changeset: 7753663c9dc4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7753663c9dc4
Modified Files:
gdk/gdk_sample.c
Branch: stratified_sampling
Log Message:
Remove obsolete code
diffs (34 lines):
diff --git a/gdk/gdk_sample.c b/gdk/gdk_sample.c
--- a/gdk/gdk_sample.c
+++ b/gdk/gdk_sample.c
@@ -31,21 +31,6 @@
#undef BATsample
-#ifdef STATIC_CODE_ANALYSIS
-#define DRAND (0.5)
-#else
-/* the range of rand() is [0..RAND_MAX], i.e. inclusive;
- * cast first, add later: on Linux RAND_MAX == INT_MAX, so adding 1
- * will overflow, but INT_MAX does fit in a double */
-#if RAND_MAX < 46340 /* 46340*46340 = 2147395600 < INT_MAX */
-/* random range is too small, double it */
-#define DRAND ((double)(rand() * (RAND_MAX + 1) + rand()) / ((double)
((RAND_MAX + 1) * (RAND_MAX + 1))))
-#else
-#define DRAND ((double)rand() / ((double)RAND_MAX + 1))
-#endif
-#endif
-
-
/* this is a straightforward implementation of a binary tree */
struct oidtreenode {
oid o;
@@ -175,8 +160,6 @@ BATsample(BAT *b, BUN n)
for (rescnt = 0; rescnt < n; rescnt++) {
oid candoid;
do {
- //candoid = (oid) (minoid + DRAND * (maxoid -
minoid));
-
/* generate a new random OID in [minoid, maxoid[
* that is including minoid, excluding maxoid*/
candoid = (oid) ( minoid + (mtwist_u32rand(mt_rng)%range) );
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list