]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Always use splitPoint=1.0 for non-optimize cover and fastcover
authorJennifer Liu <jenniferliu620@fb.com>
Thu, 30 Aug 2018 21:53:59 +0000 (14:53 -0700)
committerJennifer Liu <jenniferliu620@fb.com>
Thu, 30 Aug 2018 21:59:22 +0000 (14:59 -0700)
lib/dictBuilder/cover.c
lib/dictBuilder/fastcover.c
lib/dictBuilder/zdict.h

index 74b70ef82812a5d499ec6f0f4894a4a407bed025..6b4af69d29c5979af32279488d5b7e3bca13ecac 100644 (file)
@@ -684,7 +684,7 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_cover(
   BYTE* const dict = (BYTE*)dictBuffer;
   COVER_ctx_t ctx;
   COVER_map_t activeDmers;
-  parameters.splitPoint = parameters.splitPoint <= 0.0 ? DEFAULT_SPLITPOINT : parameters.splitPoint;
+  parameters.splitPoint = 1.0;
   /* Initialize global data */
   g_displayLevel = parameters.zParams.notificationLevel;
   /* Checks */
index 9a41ac2f9321544270bc939e96417a0e4120b619..fbf5770bab5034b42e4f9f0f508671d785410f08 100644 (file)
@@ -510,7 +510,7 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_fastCover(
     /* Initialize global data */
     g_displayLevel = parameters.zParams.notificationLevel;
     /* Assign splitPoint and f if not provided */
-    parameters.splitPoint = parameters.splitPoint <= 0.0 ? DEFAULT_SPLITPOINT : parameters.splitPoint;
+    parameters.splitPoint = 1.0;
     parameters.f = parameters.f == 0 ? DEFAULT_F : parameters.f;
     parameters.accel = parameters.accel == 0 ? DEFAULT_ACCEL : parameters.accel;
     /* Convert to cover parameter */
index c838fd4a7e306c90a8ea9d2203ef9b7d3381c7ad..a22e91782b972e7dcd0ec4c1f393f539e9b1c04f 100644 (file)
@@ -87,7 +87,7 @@ typedef struct {
     unsigned d;                  /* dmer size : constraint: 0 < d <= k : Reasonable range [6, 16] */
     unsigned steps;              /* Number of steps : Only used for optimization : 0 means default (32) : Higher means more parameters checked */
     unsigned nbThreads;          /* Number of threads : constraint: 0 < nbThreads : 1 means single-threaded : Only used for optimization : Ignored if ZSTD_MULTITHREAD is not defined */
-    double splitPoint;           /* Percentage of samples used for training: the first nbSamples * splitPoint samples will be used to training, the last nbSamples * (1 - splitPoint) samples will be used for testing, 0 means default (1.0), 1.0 when all samples are used for both training and testing */
+    double splitPoint;           /* Percentage of samples used for training: Only used for optimization : the first nbSamples * splitPoint samples will be used to training, the last nbSamples * (1 - splitPoint) samples will be used for testing, 0 means default (1.0), 1.0 when all samples are used for both training and testing */
     ZDICT_params_t zParams;
 } ZDICT_cover_params_t;
 
@@ -97,7 +97,7 @@ typedef struct {
     unsigned f;                  /* log of size of frequency array : constraint: 0 < f <= 31 : 1 means default(18)*/
     unsigned steps;              /* Number of steps : Only used for optimization : 0 means default (32) : Higher means more parameters checked */
     unsigned nbThreads;          /* Number of threads : constraint: 0 < nbThreads : 1 means single-threaded : Only used for optimization : Ignored if ZSTD_MULTITHREAD is not defined */
-    double splitPoint;           /* Percentage of samples used for training: the first nbSamples * splitPoint samples will be used to training, the last nbSamples * (1 - splitPoint) samples will be used for testing, 0 means default (0.75), 1.0 when all samples are used for both training and testing */
+    double splitPoint;           /* Percentage of samples used for training: Only used for optimization : the first nbSamples * splitPoint samples will be used to training, the last nbSamples * (1 - splitPoint) samples will be used for testing, 0 means default (0.75), 1.0 when all samples are used for both training and testing */
     unsigned accel;              /* Acceleration level: constraint: 0 < accel <= 10, higher means faster and less accurate, 0 means default(1) */
     ZDICT_params_t zParams;
 } ZDICT_fastCover_params_t;