<commit_before>/*****************************************************************************
  splitBed.h

  (c) 2015 - <NAME> PhD
  @yokofakun http://plindenbaum.blogspot.com
  Univ. Nantes, France

  Licenced under the GNU General Public License 2.0 license.
******************************************************************************/
#include <math.h>
#include <inttypes.h>
#include <getopt.h>
#include "lineFileUtilities.h"
#include "version.h"
#include "splitBed.h"

// define our program name
#define PROGRAM_NAME "bedtools split"

#define SAVE_BEANS(splits) do {\
    for(size_t _i = 0; _i < splits.size();++_i) {\
            BedSplitItems* bean=splits[_i];\
            saveBean(bean,_i);\
            delete bean;\
            } } while(0)

class Random
    {
    private:
         unsigned int seedp;
    public:
        Random():seedp(0)
            {
            }
        Random(unsigned int seed):seedp(seed)
            {
            }
        
         int nextInt()
            {
            return rand_r(&seedp);
            }
         int nextInt(int max)
            {
            return nextInt()%max;
            }
         int nextInt(int beg,int end)
            {
            return beg+nextInt(end-beg);
            }
         uint64_t nextULong()
            {
            uint64_t num;
            num = nextInt();
            num = (num << 32) | nextInt();
            return num;
            }
         uint64_t nextULong(uint64_t max)
            {
             return nextULong()%max;
            }
         uint64_t nextULong(uint64_t beg,uint64_t end)
            {
            return beg+nextULong(end-beg);
            }
         double nextDouble()
            {
            return nextInt()/(double)RAND_MAX;
            }
    };


class BedSplitItems
	{
	public:
		vector<BED*> items;
		long nbases;
		BedSplitItems():nbases(0L)
			{
			}
		~BedSplitItems()
			{
			}
		void add(BED* entry)
		    {
		    items.push_back(entry);
		    nbases += entry->size();
		    }
		vector<BED*>::size_type size() const<commit_msg>moved from long to double<commit_after>/*****************************************************************************
  splitBed.h

  (c) 2015 - <NAME> PhD
  @yokofakun http://plindenbaum.blogspot.com
  Univ. Nantes, France

  Licenced under the GNU General Public License 2.0 license.
******************************************************************************/
#include <math.h>
#include <inttypes.h>
#include <getopt.h>
#include "lineFileUtilities.h"
#include "version.h"
#include "splitBed.h"

// define our program name
#define PROGRAM_NAME "bedtools split"

#define SAVE_BEANS(splits) do {\
    for(size_t _i = 0; _i < splits.size();++_i) {\
            BedSplitItems* bean=splits[_i];\
            saveBean(bean,_i);\
            delete bean;\
            } } while(0)

class Random
    {
    private:
         unsigned int seedp;
    public:
        Random():seedp(0)
            {
            }
        Random(unsigned int seed):seedp(seed)
            {
            }
        
         int nextInt()
            {
            return rand_r(&seedp);
            }
         int nextInt(int max)
            {
            return nextInt()%max;
            }
         int nextInt(int beg,int end)
            {
            return beg+nextInt(end-beg);
            }
         uint64_t nextULong()
            {
            uint64_t num;
            num = nextInt();
            num = (num << 32) | nextInt();
            return num;
            }
         uint64_t nextULong(uint64_t max)
            {
             return nextULong()%max;
            }
         uint64_t nextULong(uint64_t beg,uint64_t end)
            {
            return beg+nextULong(end-beg);
            }
         double nextDouble()
            {
            return nextInt()/(double)RAND_MAX;
            }
    };


class BedSplitItems
	{
	public:
		vector<BED*> items;
		double nbases;
		BedSplitItems():nbases(0.0)
			{
			}
		~BedSplitItems()
			{
			}
		void add(BED* entry)
		    {
		    items.push_back(entry);
		    nbases += (double)entry->size();
		    }
		vector<BED*>::size_type size() const
{'fraction_non_alphanumeric': 0.18140207178993015, 'fraction_numerical': 0.012768007708985786, 'mean_word_length': 1.7066492829204694, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2322305', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1239, 'n_words': 253}