<commit_before>#include "ctmatutils.h"
#include "clib/ct.h"

void checkNArgs(const int n, const int nrhs)
{
    if (n != nrhs) {
        mexErrMsgTxt("Wrong number of arguments.");
    }
}

void kineticsmethods(int nlhs, mxArray* plhs[],
                     int nrhs, const mxArray* prhs[])
{
    double vv = 0.0;
    int job = getInt(prhs[2]);
    int kin, irxn;

    // construct a new instance
    if (job == 0) {
        checkNArgs(8, nrhs);
        int root = getInt(prhs[1]);
        int iph = getInt(prhs[3]);
        int in1 = getInt(prhs[4]);
        int in2 = getInt(prhs[5]);
        int in3 = getInt(prhs[6]);
        int in4 = getInt(prhs[7]);
        vv = (double) newKineticsFromXML(root, iph, in1, in2, in3, in4);
        plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL);
        double* h = mxGetPr(plhs[0]);
        *h = vv;
        return;<commit_msg>[Matlab] Fix detection of errors when importing Kinetics<commit_after>#include "ctmatutils.h"
#include "clib/ct.h"

void checkNArgs(const int n, const int nrhs)
{
    if (n != nrhs) {
        mexErrMsgTxt("Wrong number of arguments.");
    }
}

void kineticsmethods(int nlhs, mxArray* plhs[],
                     int nrhs, const mxArray* prhs[])
{
    double vv = 0.0;
    int job = getInt(prhs[2]);
    int kin, irxn;

    // construct a new instance
    if (job == 0) {
        checkNArgs(8, nrhs);
        int root = getInt(prhs[1]);
        int iph = getInt(prhs[3]);
        int in1 = getInt(prhs[4]);
        int in2 = getInt(prhs[5]);
        int in3 = getInt(prhs[6]);
        int in4 = getInt(prhs[7]);
        vv = static_cast<int>(newKineticsFromXML(root, iph, in1, in2, in3, in4));
        plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL);
        double* h = mxGetPr(plhs[0]);
        *h = vv;
        return;
{'fraction_non_alphanumeric': 0.14553472987872107, 'fraction_numerical': 0.025358324145534728, 'mean_word_length': 2.4052532833020637, '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': '1531343', 'n_tokens_mistral': 699, 'n_tokens_neox': 704, 'n_words': 165}