<commit_before>#include <math.h>
#include "cpotential.h"

double c_value(CPotential *p, double t, double *q) {
    double v = 0;
    for (int i=0; i < p->n_components; i++) {
        v = v + (p->value)[i](t, (p->parameters)[i], q);
    }
    return v;
}

double c_density(CPotential *p, double t, double *q) {
    double v = 0;
    for (int i=0; i < p->n_components; i++) {
        v = v + (p->density)[i](t, (p->parameters)[i], q);
    }
    return v;
}

void c_gradient(CPotential *p, double t, double *q, double *grad) {
    int i;

    for (i=0; i < (p->n_dim); i++) {
        grad[i] = 0.;
    }

    for (i=0; i < p->n_components; i++) {
        (p->gradient)[i](t, (p->parameters)[i], q, grad);<commit_msg>trying to make C89 compliant [ci skip]<commit_after>#include <math.h>
#include "cpotential.h"

double c_value(CPotential *p, double t, double *q) {
    double v = 0;
    int i;

    for (i=0; i < p->n_components; i++) {
        v = v + (p->value)[i](t, (p->parameters)[i], q);
    }
    return v;
}

double c_density(CPotential *p, double t, double *q) {
    double v = 0;
    int i;

    for (i=0; i < p->n_components; i++) {
        v = v + (p->density)[i](t, (p->parameters)[i], q);
    }
    return v;
}

void c_gradient(CPotential *p, double t, double *q, double *grad) {
    int i;

    for (i=0; i < (p->n_dim); i++) {
        grad[i] = 0.;
    }

    for (i=0; i < p->n_components; i++) {
        (p->gradient)[i](t, (p->parameters)[i], q, grad);
{'fraction_non_alphanumeric': 0.2113156100886162, 'fraction_numerical': 0.010906612133605999, 'mean_word_length': 2.5544794188861983, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, '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': '7126314', 'n_tokens_mistral': 620, 'n_tokens_neox': 601, 'n_words': 161}