<commit_before><commit_msg>Create speed-cl.c<commit_after>#include <stdio.h>

/* Function to calculate the age-to-age factors */
void get_factor(double *vec, double *fact, int p)
{
	int j, m;
	double tmp[2];
	for(j = 0; j < p-1; ++j)
	{
		tmp[0] = 0.; tmp[1] = 0.;
		for(m = 0; m < (p - (j + 1)); ++m)
		{
			//printf("j, m: %d, %d\n", j, m);
			tmp[0] += vec[(m + j*p)];
			tmp[1] += vec[(m + (1 + j)*p)];
		}
		fact[j] = tmp[1]/tmp[0];
	}
}

/* chain ladder function*/
void cl(double *vec, double *fact, int p)
{
	int i, j, k;
	for(i = p - 1; i > 0; --i)
	{
		for(j = 0; j < p - i; ++j)
		{
			k = p*i + (p - i) + j*p;
			vec[k] = vec[k - p]*fact[i+j-1];
		}
	}
}
{'fraction_non_alphanumeric': 0.2631578947368421, 'fraction_numerical': 0.02706766917293233, 'mean_word_length': 2.4507772020725387, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '2295032', 'n_tokens_mistral': 361, 'n_tokens_neox': 331, 'n_words': 86}