PyEMMA icon indicating copy to clipboard operation
PyEMMA copied to clipboard

_bar_df wrong for loop boundary

Open MaaikeG opened this issue 2 years ago • 3 comments

In PyEMMA/pyemma/thermo/extensions/bar/_bar.c

The second for loop should run from 0 to L2, not L1. Current implementation gives an access violation whenever L1 > L2


extern double _bar_df(double *db_IJ, int L1, double *db_JI, int L2, double *scratch)
{
    int i;
    double ln_avg1;
    double ln_avg2; 
    for (i=0; i<L1; i++)
    {
        scratch[i] = db_IJ[i]>0 ? 0 : db_IJ[i];
    }
    ln_avg1 = _logsumexp_sort_kahan_inplace(scratch, L1);
    for (i=0; i<L1; i++)
    {
        scratch[i] = db_JI[i]>0 ? 0 : db_JI[i];
    }
    ln_avg2 = _logsumexp_sort_kahan_inplace(scratch, L2);
    return ln_avg2 - ln_avg1;
}```

MaaikeG avatar Dec 16 '21 15:12 MaaikeG

Ouch :) To be fair I think we should just wait until deeptime-ml/deeptime#168 is merged and then back-integrate here with the next deeptime release.

clonker avatar Dec 17 '21 13:12 clonker

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 02 '22 00:11 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 22 '23 00:05 stale[bot]