Skip to content

Commit

Permalink
restriction of min pop
Browse files Browse the repository at this point in the history
  • Loading branch information
hanase committed May 23, 2024
1 parent 4d747a5 commit d70089d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bayesPop
Type: Package
Title: Probabilistic Population Projection
Version: 10.0-1.9013
Version: 10.0-1.9014
Date: 2024-05-23
Author: Hana Sevcikova, Adrian Raftery, Thomas Buettner
Maintainer: Hana Sevcikova <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions src/projection_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ void CCM(int *nobserved, int *abridged, int *npred, double *MIGm, double *MIGf,
totp[j] = 0;
for(i=0; i < adim; ++i) {
if(migendm[i][jve] < 0)
migendm[i][jve] = fmax(migendm[i][jve], -popm[i+t] + minpop); /* adjust migration if it would yield negative population */
migendm[i][jve] = fmin(0, fmax(migendm[i][jve], -popm[i+t] + minpop)); /* adjust migration if it would yield negative population */
popm[i+t] = popm[i + t] + migendm[i][jve];
if(migendf[i][jve] < 0)
migendf[i][jve] = fmax(migendf[i][jve], -popf[i+t] + minpop);
migendf[i][jve] = fmin(0, fmax(migendf[i][jve], -popf[i+t] + minpop));
popf[i+t] = popf[i + t] + migendf[i][jve];
totp[j] += popm[i + t] + popf[i + t];
}
Expand Down

0 comments on commit d70089d

Please sign in to comment.