<commit_before>#ifndef GUARD_cluster_h
#define GUARD_cluster_h

// #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include "assert.h"
//
#include "utils.h"
#include "Suffstats.h"


template <class T> class Suffstats;
template <class T> class Cluster;
template <typename T> std::ostream& operator<<(std::ostream& os,
					       const Cluster<T>& cT);

template <class T>
class Cluster {
 public:
  Cluster<T>(int NUM_COLS): num_cols(NUM_COLS) { init_suffstats(); };
  double insert_row(std::vector<T> vT, int row_idx);
  double remove_row(std::vector<T> vT, int row_idx);
  double calc_data_logp(std::vector<T> vT) const;
  double get_score() const;
  int get_count() const;
  std::set<int> get_global_row_indices();
  std::set<int> get_global_col_indices();
  friend std::ostream& operator<< <>(std::ostream& os, const Cluster<T>& cT);
  Suffstats<T> get_suffstats_i(int idx) const;
  //
  std::map<int, double> calc_logps();
  double calc_sum_logp();
  double get_vector_logp(std::vector<T> vT); // to be removed when test ensures calc_data_logps correctness
 private:
  double score;
  int num_cols;
  int count;
  void init_suffstats();
  std::map<int, Suffstats<T> > suffstats_m;
  std::set<int> global_row_indices;
  std::set<int> global_col_indices;<commit_msg>add default constructor for use in std::map<commit_after>#ifndef GUARD_cluster_h
#define GUARD_cluster_h

// #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include "assert.h"
//
#include "utils.h"
#include "Suffstats.h"


template <class T> class Suffstats;
template <class T> class Cluster;
template <typename T> std::ostream& operator<<(std::ostream& os,
					       const Cluster<T>& cT);

template <class T>
class Cluster {
 public:
  Cluster<T>(): num_cols(5) { init_suffstats(); };
  Cluster<T>(int NUM_COLS): num_cols(NUM_COLS) { init_suffstats(); };
  double insert_row(std::vector<T> vT, int row_idx);
  double remove_row(std::vector<T> vT, int row_idx);
  double calc_data_logp(std::vector<T> vT) const;
  double get_score() const;
  int get_count() const;
  std::set<int> get_global_row_indices();
  std::set<int> get_global_col_indices();
  friend std::ostream& operator<< <>(std::ostream& os, const Cluster<T>& cT);
  Suffstats<T> get_suffstats_i(int idx) const;
  //
  std::map<int, double> calc_logps();
  double calc_sum_logp();
  double get_vector_logp(std::vector<T> vT); // to be removed when test ensures calc_data_logps correctness
 private:
  double score;
  int num_cols;
  int count;
  void init_suffstats();
  std::map<int, Suffstats<T> > suffstats_m;
  std::set<int> global_row_indices;
  std::set<int> global_col_indices;
{'fraction_non_alphanumeric': 0.14615662215806569, 'fraction_numerical': 0.00036088054853843375, 'mean_word_length': 5.695652173913044, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 58, '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': '1576078', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1006, 'n_words': 250}