diff options
Diffstat (limited to 'publish_0630.cu')
| -rw-r--r-- | publish_0630.cu | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/publish_0630.cu b/publish_0630.cu index 583b46f..31e66c9 100644 --- a/publish_0630.cu +++ b/publish_0630.cu @@ -143,17 +143,14 @@ template <typename key_type> class ReadHelper_ { /// 用來存放文件名 char const *filename; - static constexpr size_t REVERSED_BLOCK = 256; - /// 用於生成讀入時要跳過的數的數量 auto genRandomRow(size_t total_row) const { /// 檢查是否滿足需要跳過行數的條件 if (total_row != 0) { /// 檢查總行數是否少於需要讀入的數量相加 - assert(total_row > (population_length + sample_length + REVERSED_BLOCK)); + assert(total_row > (population_length + sample_length)); - return randomRow(total_row - population_length - sample_length - - REVERSED_BLOCK); + return randomRow(total_row - population_length - sample_length); } /// 否則返回 0 則會不跳過 return 0UL; @@ -217,7 +214,7 @@ public: read_number = 0; /// 將剩下的資料存入 vector 中 - auto remain = population_length + REVERSED_BLOCK; + auto remain = population_length; for (key_type i; read_number < remain && !fin.eof(); store_into_vector(i)) { fin >> i; read_number++; |
