<commit_before>#ifndef _TABLE_BIGINTCOLUMN_H_
#define _TABLE_BIGINTCOLUMN_H_

#include <Column.h>

namespace table {
  class BigIntColumn : public Column {
  public:
  BigIntColumn(const std::string & _name) : Column(_name) { }
  BigIntColumn(const char * _name) : Column(_name) { }
    
    ColumnType getType() const override { return NUMBER; }

    std::shared_ptr<Column> copy() const override { return std::make_shared<BigIntColumn>(*this); }
    std::shared_ptr<Column> create() const override { return std::make_shared<BigIntColumn>(name()); }
    void reserve(size_t n) { data.reserve(n); }
    size_t size() const override { return data.size(); }
    
    double getDouble(int i) const override { return (double)data[i]; }
    int getInt(int i) const override { return (int)data[i]; }
    long long getInt64(int i) const override { return data[i]; }
    std::string getText(int i) const override { return std::to_string(data[i]); }
    
    void setValue(int i, double v) override { setValue(i, (long long)v); }
    void setValue(int i, int v) override { setValue(i, (int)v); }
    void setValue(int i, const std::string & v) override { setValue(i, stoll(v)); }
    void setValue(int i, long long v) override {
      while (i >= data.size()) data.push_back(0);
      data[i] = v;
    }
	
    void pushValue(double v) override { pushValue((long long)v); }
    void pushValue(int v) override { pushValue((long long)v); }
    void pushValue(const std::string & v) override { pushValue(stoll(v)); }
    void pushValue(long long v) override { data.push_back(v); }
    
    bool compare(int a, int b) const override {
      return data[a] < data[b];
    }
    void clear() override { data.clear(); }

    Column & operator= (double a) override { 
      data.assign(data.size(), int(a));
      return *this;
    }
    Column & operator= (int a) override {
      data.assign(data.size(), a);
      return *this;
    }
    
  private:
    std::vector<long long> data;
  };
};

#endif<commit_msg>make accessors safe, remove useless operators<commit_after>#ifndef _TABLE_BIGINTCOLUMN_H_
#define _TABLE_BIGINTCOLUMN_H_

#include <Column.h>

namespace table {
  class BigIntColumn : public Column {
  public:
  BigIntColumn(const std::string & _name) : Column(_name) { }
  BigIntColumn(const char * _name) : Column(_name) { }
    
    ColumnType getType() const override { return NUMBER; }

    std::shared_ptr<Column> copy() const override { return std::make_shared<BigIntColumn>(*this); }
    std::shared_ptr<Column> create() const override { return std::make_shared<BigIntColumn>(name()); }
    void reserve(size_t n) { data.reserve(n); }
    size_t size() const override { return data.size(); }
    
    double getDouble(int i) const override { return (double)getInt64(i); }
    int getInt(int i) const override { return (int)getInt64(i); }
    std::string getText(int i) const override { return std::to_string(getInt64(i)); }
    long long getInt64(int i) const override {
      if (i >= 0 && i < data.size()) {
	return data[i];
      } else {
	return 0;
      }
    }
    
    void setValue(int i, double v) override { setValue(i, (long long)v); }
    void setValue(int i, int v) override { setValue(i, (int)v); }
    void setValue(int i, const std::string & v) override { setValue(i, stoll(v)); }
    void setValue(int i, long long v) override {
      while (i >= data.size()) data.push_back(0);
      data[i] = v;
    }
	
    void pushValue(double v) override { pushValue((long long)v); }
    void pushValue(int v) override { pushValue((long long)v); }
    void pushValue(const std::string & v) override { pushValue(stoll(v)); }
    void pushValue(long long v) override { data.push_back(v); }
    
    bool compare(int a, int b) const override {
      return data[a] < data[b];
    }
    void clear() override { data.clear(); }
    
  private:
    std::vector<long long> data;
  };
};

#endif
{'fraction_non_alphanumeric': 0.13963039014373715, 'fraction_numerical': 0.003593429158110883, 'mean_word_length': 3.541958041958042, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '1512792', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1291, 'n_words': 350}