<commit_before>#include <fstream>

#include "clib/ct.h"
#include "ctmatutils.h"

void reportError();

void transportmethods(int nlhs, mxArray* plhs[],
                      int nrhs, const mxArray* prhs[])
{
    double vv = 0.0;
    int n = getInt(prhs[1]);
    int job = getInt(prhs[2]);
    double* h;
    int iok = 0;
    int nsp;

    if (job == -1) {
        char* model = getString(prhs[3]);
        int loglevel = getInt(prhs[4]);
        int m = -2;
        m = (int) newTransport(model, n, loglevel);
        if (m < 0) {
            reportError();
        }

        // Create matrix for the return argument.
        plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL);
        double* x = mxGetPr(plhs[0]);
        *x = m;
        return;
    }


    if (job < 10) {
        switch (job) {
        case 0:
            delTransport(n);
            vv = 0.0;
            break;
        case 1:
            vv = trans_viscosity(n);
            break;
        case 2:
            vv = trans_thermalConductivity(n);
        case 3:
            vv = trans_electricalConductivity(n);
            break;
        default:
            mexErrMsgTxt("unknown Transport method");
        }
        if (vv < 0.0) {
            reportError();
        }
        plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL);
        h = mxGetPr(plhs[0]);
        *h = vv;
        return;
    } else if (job < 20) {
        nsp = getInt(prhs[3]);
        plhs[0] = mxCreateNumericMatrix(nsp,1,mxDOUBLE_CLASS,mxREAL);
        h = mxGetPr(plhs[0]);

        switch (job) {
        case 11:
            iok = trans_getMixDiffCoeffs(n, nsp, h);
            break;
        case 12:
            iok = trans_getThermalDiffCoeffs(n, nsp, h);
            break;
        default:
            mexErrMsgTxt("unknown Transport method");
        }
    }
<commit_msg>[Matlab] Fix 'thermalConductivity' method<commit_after>#include <fstream>

#include "clib/ct.h"
#include "ctmatutils.h"

void reportError();

void transportmethods(int nlhs, mxArray* plhs[],
                      int nrhs, const mxArray* prhs[])
{
    double vv = 0.0;
    int n = getInt(prhs[1]);
    int job = getInt(prhs[2]);
    double* h;
    int iok = 0;
    int nsp;

    if (job == -1) {
        char* model = getString(prhs[3]);
        int loglevel = getInt(prhs[4]);
        int m = -2;
        m = (int) newTransport(model, n, loglevel);
        if (m < 0) {
            reportError();
        }

        // Create matrix for the return argument.
        plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL);
        double* x = mxGetPr(plhs[0]);
        *x = m;
        return;
    }


    if (job < 10) {
        switch (job) {
        case 0:
            delTransport(n);
            vv = 0.0;
            break;
        case 1:
            vv = trans_viscosity(n);
            break;
        case 2:
            vv = trans_thermalConductivity(n);
	    break;
        case 3:
            vv = trans_electricalConductivity(n);
            break;
        default:
            mexErrMsgTxt("unknown Transport method");
        }
        if (vv < 0.0) {
            reportError();
        }
        plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL);
        h = mxGetPr(plhs[0]);
        *h = vv;
        return;
    } else if (job < 20) {
        nsp = getInt(prhs[3]);
        plhs[0] = mxCreateNumericMatrix(nsp,1,mxDOUBLE_CLASS,mxREAL);
        h = mxGetPr(plhs[0]);

        switch (job) {
        case 11:
            iok = trans_getMixDiffCoeffs(n, nsp, h);
            break;
        case 12:
            iok = trans_getThermalDiffCoeffs(n, nsp, h);
            break;
        default:
            mexErrMsgTxt("unknown Transport method");
        }
    }

{'fraction_non_alphanumeric': 0.12587601078167115, 'fraction_numerical': 0.020485175202156335, 'mean_word_length': 1.56994459833795, 'pattern_counts': {'":': 0, '<': 13, '<?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': '7225923', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1284, 'n_words': 284}