<commit_before>#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include <limits.h>
#include <string.h>
#include <stdint.h>

//Forward declaration required due to CFFI's requirement to have unmangled symbols
extern "C" {
	int pairwise_diff(const double* a, const double* b, double* result, size_t awidth, size_t bwidth);
}

int pairwise_diff(const double* a, const double* b, double* result, size_t awidth, size_t bwidth) {

	//Iterate over all (a,b) element pairs
	for (size_t ax = 0; ax < awidth; ++ax) {
		for (size_t bx = 0; bx < bwidth; ++bx) {
			result[ax*awidth + bx] = abs(a[ax] - b[bx]);
		}	
	}
	return 0;
}<commit_msg>Try to avoid ambiguous abs() call in distance.cpp by explicit cast to int64_t (in an attempt to resolve #1)<commit_after>#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include <limits.h>
#include <string.h>
#include <stdint.h>

//Forward declaration required due to CFFI's requirement to have unmangled symbols
extern "C" {
	int pairwise_diff(const double* a, const double* b, double* result, size_t awidth, size_t bwidth);
}

int pairwise_diff(const double* a, const double* b, double* result, size_t awidth, size_t bwidth) {

	//Iterate over all (a,b) element pairs
	for (size_t ax = 0; ax < awidth; ++ax) {
		for (size_t bx = 0; bx < bwidth; ++bx) {
			result[ax*awidth + bx] = abs((int64_t)(a[ax] - b[bx]));
		}	
	}
	return 0;
}
{'fraction_non_alphanumeric': 0.14254859611231102, 'fraction_numerical': 0.007919366450683946, 'mean_word_length': 4.4296875, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, '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': '6912539', 'n_tokens_mistral': 556, 'n_tokens_neox': 520, 'n_words': 172}