<commit_before>// KD-Tree declarations


#define MAX 65536
#define MAX_DIST sqrt((MAX * MAX) + (MAX * MAX))

struct Node {
    struct Node *left;
    struct Node *right;
    struct Node *parent;
    int *point;
    int dimension;
    int max_x;
    int max_y;
    int min_x;
    int min_y;
};

struct Tree {
    struct Node *root;
};

struct Tree *init_tree(void);

struct Node *init_node(int *point);

void init_root(struct Tree *tree, int *point);

void free_tree(struct Tree *tree);

void free_nodes(struct Node *node);

void free_node(struct Node *node);

int **create_random_points(int number_of_points);

void insert_node(struct Node *node, struct Node *new_node);

void set_dimension(struct Node *node, struct Node *new_node);

void insert_point_list(struct Tree *tree, int **points, int number_of_points);

struct Node *closest_neighbor(struct Node *root, int *point); 

float calculate_distance_point(struct Node *node, int *point);

float calculate_distance_rect(struct Node *node, int *point);
<commit_msg>Macro for MAX_DIST<commit_after>// KD-Tree declarations

#include <limits.h>


#define MAX 65536
#define MAX_DIST LONG_MAX

struct Node {
    struct Node *left;
    struct Node *right;
    struct Node *parent;
    int *point;
    int dimension;
    int max_x;
    int max_y;
    int min_x;
    int min_y;
};

struct Tree {
    struct Node *root;
    float close_dist;
    int *close_coords;
};

struct Tree *init_tree(void);

struct Node *init_node(int *point);

void init_root(struct Tree *tree, int *point);

void free_tree(struct Tree *tree);

void free_nodes(struct Node *node);

void free_node(struct Node *node);

int **create_random_points(int number_of_points);

void insert_node(struct Node *node, struct Node *new_node);

void set_dimension(struct Node *node, struct Node *new_node);

void insert_point_list(struct Tree *tree, int **points, int number_of_points);

void closest_neighbor(struct Tree *tree, struct Node *node, int *point);

float calculate_distance_point(struct Node *node, int *point);

float calculate_distance_rect(struct Node *node, int *point);

{'fraction_non_alphanumeric': 0.1037284894837476, 'fraction_numerical': 0.004780114722753346, 'mean_word_length': 4.6875, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '761903', 'n_tokens_mistral': 710, 'n_tokens_neox': 687, 'n_words': 225}