<commit_before>/*
 *  n_point_naive_multi_main.cc
 *  
 *
 *  Created by <NAME> on 6/9/10.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */


#include "fastlib/fastlib.h"
#include "n_point_perm_free.h"
#include "n_point.h"

bool IncIndex(ArrayList<index_t>& new_ind, 
              const ArrayList<index_t>& orig_ind, 
              index_t k, int tensor_rank_, int num_bins_) {
  
  if (k >= tensor_rank_) {
    return true;
  }
  
  new_ind[k]++;
  if (new_ind[k] >= num_bins_) {
    new_ind[k] = orig_ind[k];
    return IncIndex(new_ind, orig_ind, k+1, tensor_rank_, num_bins_);
  }
  else {
    return false;
  }
  
} // IncrementIndex

int main(int argc, char* argv[]) {

  fx_init(argc, argv, NULL);
  
  int n = fx_param_int_req(NULL, "n");
  int n_choose_2 = n_point_impl::NChooseR(n, 2);
  
  Matrix data;
  const char* data_file = fx_param_str_req(NULL, "data");
  data::Load(data_file, &data);
  
  Matrix lower_bounds;
  lower_bounds.Init(n, n);
  lower_bounds.SetAll(0.0);
  
  double min_band = fx_param_double_req(NULL, "min_band");
  double max_band = fx_param_double_req(NULL, "max_band");
  double num_bands = fx_param_int_req(NULL, "num_bands");
  
  ArrayList<double> dists;
  dists.Init(num_bands);
  
  
  double this_dist = min_band;
  double dist_step = (max_band - min_band) / (double)(num_bands-1);
  
  //printf("dist_step = %g\n", dist_step);
  
  // TODO: double check this
  for (index_t i = 0; i < num_bands; i++) {
    
    dists[i] = this_dist;
    this_dist += dist_step;
    
  }
  
  ArrayList<index_t> indices;
  indices.InitRepeat(0, n_choose_2);
  
  ArrayList<index_t> indices_copy;
  indices_copy.InitCopy(indices);

  
  // form each matcher
  <commit_msg>fixed small error in naive multi main<commit_after>/*
 *  n_point_naive_multi_main.cc
 *  
 *
 *  Created by <NAME> on 6/9/10.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */


#include "fastlib/fastlib.h"
#include "n_point_perm_free.h"
#include "n_point.h"

bool IncIndex(ArrayList<index_t>& new_ind, 
              const ArrayList<index_t>& orig_ind, 
              index_t k, int tensor_rank_, int num_bins_) {
  
  if (k >= tensor_rank_) {
    return true;
  }
  
  new_ind[k]++;
  if (new_ind[k] >= num_bins_) {
    new_ind[k] = orig_ind[k];
    return IncIndex(new_ind, orig_ind, k+1, tensor_rank_, num_bins_);
  }
  else {
    return false;
  }
  
} // IncrementIndex

int main(int argc, char* argv[]) {

  fx_init(argc, argv, NULL);
  
  int n = fx_param_int_req(NULL, "n");
  int n_choose_2 = n_point_impl::NChooseR(n, 2);
  
  Matrix data;
  const char* data_file = fx_param_str_req(NULL, "data");
  data::Load(data_file, &data);
  
  Matrix lower_bounds;
  lower_bounds.Init(n, n);
  lower_bounds.SetAll(0.0);
  
  double min_band = fx_param_double_req(NULL, "min_band");
  double max_band = fx_param_double_req(NULL, "max_band");
  int num_bands = fx_param_int_req(NULL, "num_bands");
  
  ArrayList<double> dists;
  dists.Init(num_bands);
  
  
  double this_dist = min_band;
  double dist_step = (max_band - min_band) / (double)(num_bands-1);
  
  //printf("dist_step = %g\n", dist_step);
  
  // TODO: double check this
  for (index_t i = 0; i < num_bands; i++) {
    
    dists[i] = this_dist;
    this_dist += dist_step;
    
  }
  
  ArrayList<index_t> indices;
  indices.InitRepeat(0, n_choose_2);
  
  ArrayList<index_t> indices_copy;
  indices_copy.InitCopy(indices);

  
  // form each matcher
  
{'fraction_non_alphanumeric': 0.13271515502752826, 'fraction_numerical': 0.009852216748768473, 'mean_word_length': 3.331242158092848, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '5561250', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1372, 'n_words': 272}