correct counts on load

This commit is contained in:
Sigbjørn Skjæret 2024-06-13 02:10:17 +02:00 committed by GitHub
parent 4ad3eb21bf
commit fe21ef7920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,8 +343,10 @@ bool IMatrixCollector::load_imatrix(const char * fname) {
// Recreate the state as expected by save_imatrix(), and corerct for weighted sum.
for (int i = 0; i < nval; i++) {
e.values[i] += tmp[i];
e.counts[i] += ncall;
if (tmp[i]) {
e.values[i] += tmp[i];
e.counts[i] += ncall;
}
}
e.ncall += ncall;