PyEMMA
PyEMMA copied to clipboard
_bar_df wrong for loop boundary
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;
}```
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.
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.
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.