Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
328 commits
Select commit Hold shift + click to select a range
a24069f
optimal weight function now has support for scoring function and stre…
philipwosull Feb 19, 2025
322f61d
now supports custom adj sizing
philipwosull Feb 19, 2025
4df0dd6
fixed hinge constraint bug
philipwosull Feb 22, 2025
cbfb15b
tweaked original smc to allow for setting processes and num threads p…
philipwosull Feb 22, 2025
4858283
tweaked region selection prob in gsmc to now be size^alpha
philipwosull Feb 23, 2025
999bbd8
RNG generation is now threadsafe
philipwosull Mar 2, 2025
b68fe50
tweaked diagnostic that redist_gsmc puts out
philipwosull Mar 3, 2025
487dcd3
consolidated mergesplit files and changed to just specify desired num…
philipwosull Mar 3, 2025
8979e27
make PRNG more robust with long_jump functionality
philipwosull Mar 3, 2025
4e26019
Adding Plan method for computing log tau terms
philipwosull Mar 4, 2025
32a5f75
cleaned up code and removed extraneous plan variables
philipwosull Mar 5, 2025
2e5b3bc
added compactness parameter and all alg versions passed 6x6 validation
philipwosull Mar 5, 2025
dfeaadb
removed more unncessary attributes from plan object
philipwosull Mar 7, 2025
a500803
removed recursion from functions which use cut tree to update plans
philipwosull Mar 8, 2025
82c2706
refactor of get valid edges in tree with speed up by only requiring o…
philipwosull Mar 8, 2025
8e42811
Now removed unnessecary copying in the splitting step
philipwosull Mar 9, 2025
eaeda4f
removed duplicate tree splitters, now only uses one for entire gsmc f…
philipwosull Mar 9, 2025
15f3bd8
forgot new UST Sampler files
philipwosull Mar 9, 2025
7ef437c
some minor tweaks to starting prinout message
philipwosull Mar 10, 2025
6dc8bc6
removed feature unnesarily computing log tau for simple graph space w…
philipwosull Mar 10, 2025
11d6d8a
added parallel versions of some redistmetrics functions to speed up s…
philipwosull Mar 15, 2025
2d94604
added more parallel versions of some redistmetrics functions
philipwosull Mar 15, 2025
c427528
adding weights file
philipwosull Mar 15, 2025
36c83c4
more tweaks to make parallel redistmetric functions more thread safe.…
philipwosull Mar 15, 2025
750abc0
fixed issue with parallel polsby popper. If no pool object RcppThread…
philipwosull Mar 15, 2025
5ca5610
implemented new merge split using Plan class. Passes validation
philipwosull Mar 19, 2025
7d0cef1
some more code refactor to help support linking edge stuff
philipwosull Mar 20, 2025
79f292c
skeleton of linking edge done. Just need to add multigraph tau
philipwosull Mar 20, 2025
71a2db0
linking edge space sampling passes validation
philipwosull Mar 21, 2025
33d242e
some code tweaks
philipwosull Mar 21, 2025
6af2ef4
minor typo in tree splitter types file
philipwosull Mar 21, 2025
3ed2cac
exposed exported generic gsmc file as export
philipwosull Mar 21, 2025
96dc627
forgot generic redist man page
philipwosull Mar 21, 2025
ce63e94
more man page tweaks
philipwosull Mar 21, 2025
086c3c9
removed unneccesary copy in smc plans function
philipwosull Mar 21, 2025
91318bf
reduced memory usage in plan reorder
philipwosull Mar 22, 2025
a7d5acd
smc merge split working for forest, still doesn't pass validation for…
philipwosull Mar 22, 2025
820a179
caught error with not correctly updating linking probabilities/comput…
philipwosull Mar 23, 2025
6531948
smc+ms works for linking edge
philipwosull Mar 24, 2025
21913a3
refactored diagnostics and added code to track the size of regions we…
philipwosull Mar 25, 2025
bc0efe0
added for mcmc too
philipwosull Mar 25, 2025
4b74e61
added constants for alg types
philipwosull Mar 25, 2025
adab046
adding county check in merge split
philipwosull Mar 26, 2025
2d4b2a6
added county split checking
philipwosull Mar 26, 2025
b3d5557
added more diagnostics for merge split seperation bug
philipwosull Mar 26, 2025
5af72f6
hopefully fixed issue with incorrect hiearchical tree drawing for gen…
philipwosull Mar 26, 2025
f776cb7
trying to turn off pop bounds in sample_sub_ust to see if that fixes …
philipwosull Mar 26, 2025
e2e4ac9
trying again to fix
philipwosull Mar 27, 2025
7452576
indexing typo in update
philipwosull Mar 27, 2025
e6f9d8d
added quick multithreaded sorting function for district statistics
philipwosull Mar 31, 2025
a14f8db
had non uploaded function in Rcpp file
philipwosull Mar 31, 2025
ef8bb31
didnt remove stuff from Rcpp exports last time
philipwosull Mar 31, 2025
842e0db
very hacky fix for county issue GRAPH SPACE ONLY
philipwosull Apr 10, 2025
696b5b4
adding functions for computing log optimal weights and target density
philipwosull Apr 10, 2025
3187a56
another bug in county checking, quick fix but needs more verification
philipwosull Apr 10, 2025
0157522
attempted to fix county boundary counting issue
philipwosull Apr 11, 2025
e98f306
major refactor. Switched from arma columns to uint8 vectors for plan ids
philipwosull Apr 13, 2025
c0b3bdb
starting to refactor forests to be smaller
philipwosull Apr 13, 2025
cea469d
tweaking forest assignment to take more space upfront
philipwosull Apr 13, 2025
5adc7bd
Now support 65535 counties instead of 255
philipwosull Apr 13, 2025
6cdcfdb
hopefully counties now work for graph plans optimal weights
philipwosull Apr 15, 2025
89d5399
fixed another uint issue
philipwosull Apr 15, 2025
eba70c4
switched determinants to PSD version and added shallow copy
philipwosull Apr 15, 2025
dcf6730
refactor to avoid using as much memory when no intial plans
philipwosull Apr 23, 2025
d679b97
more memory usage refactoring
philipwosull Apr 24, 2025
7fac0e6
more memory usage reduction
philipwosull Apr 24, 2025
e389547
resampling done in c++ to save memory
philipwosull Apr 24, 2025
fdc0433
more stuff done in Rcpp to save mem
philipwosull Apr 25, 2025
73ba889
made extra printing controlled by verbose
philipwosull Apr 25, 2025
e9554a3
fixed bug with incorrect copying for odd split numbers
philipwosull Apr 28, 2025
354ad0c
fixed minor typo
philipwosull Apr 28, 2025
fc949cd
added functions to compute log target density and the log target for …
philipwosull May 3, 2025
c341b20
added incomplete implementation of pair hash
philipwosull May 22, 2025
4c1bbe2
overhauled county component stuff for graph and forest space
philipwosull Jun 2, 2025
70b1836
smc and smc+mcmc pass validation now
philipwosull Jun 4, 2025
bf09868
constraint code now scores districts only on per constraint basis. De…
philipwosull Jun 8, 2025
bd16605
mergesplit tweak
philipwosull Jun 8, 2025
2750687
added support for MMD plans and nseats for partial SMD plans
philipwosull Jun 12, 2025
6a2709c
Added but not tested code for multi member district district only splits
philipwosull Jun 16, 2025
03c189d
added hard constraints to manual weights cpp code
philipwosull Jun 17, 2025
fb9009b
caught potential bug in MMD split district only where big districts c…
philipwosull Jun 17, 2025
480f50a
nvm allowing districts to be split again
philipwosull Jun 17, 2025
b1b13a1
renamed and changed redist_gsmc function inputs to match old redist_smc
philipwosull Jun 19, 2025
da355f6
some more cleanup tweaks to gsmc cpp file
philipwosull Jun 19, 2025
de276c3
added support for seeding random trees on initialized non blank fores…
philipwosull Jun 20, 2025
3aa720f
Major refactor of code, eliminated county components and replaced wit…
philipwosull Jun 24, 2025
db69bcb
fixed minor bug in simple weights
philipwosull Jun 24, 2025
d4ce7e8
caught bug in not catching diff adjacent components
philipwosull Jun 24, 2025
61cbe73
fixed error in redist_gsmc where it would not do split districts only
philipwosull Jun 25, 2025
3c388fa
change multigraph to be vec of vec of int array of size 3
philipwosull Jun 25, 2025
896fc3b
now display the number of threads in the threadpool
philipwosull Jun 25, 2025
3ab54c6
renamed redist gsmc to redist smc and moved old smc to legacy version…
philipwosull Jun 26, 2025
6c63099
renamed everything from gredist back to redist
philipwosull Jun 26, 2025
8cfa4ee
more renaming back to redist stuff and reset plot_maps file
philipwosull Jun 27, 2025
5b4f6c4
attempting to add seq_alpha back but failing validation
philipwosull Jun 27, 2025
44c5465
seq alpha passes validation
philipwosull Jun 27, 2025
85033ac
removed old smc cpp code and replaced it with new code
philipwosull Jun 28, 2025
7f03402
fixed bug in MMD district splits where incorrect split sizes from pre…
philipwosull Jun 29, 2025
7a59ba3
starting to overhaul diagnostics
philipwosull Jun 29, 2025
ab6373c
made it so you always compute multidsistrict selection probability fo…
philipwosull Jun 29, 2025
dc68e07
more tweaks and fixed a ms bug with tree size counts
philipwosull Jul 1, 2025
c69bad1
removed some pointless tests and fixed issue with null nseats for ref…
philipwosull Jul 1, 2025
000a32b
removed so non used functions, consolidated a file, and reskinned mer…
philipwosull Jul 1, 2025
6f1d60b
caught issue with multigraph check if hier valid not working properly
philipwosull Jul 2, 2025
17e023f
added incumbency constraint to updated smc code, avoided duplicate by…
philipwosull Jul 2, 2025
9d3ced8
more constraints added to new code
philipwosull Jul 2, 2025
fa0cffe
overhauled Wilson code to reuse as many vectors as possible
philipwosull Jul 9, 2025
5725d4d
made tree pop stacks fixed size
philipwosull Jul 9, 2025
f7fba3e
updating SMC tests for new code interface changes
philipwosull Jul 12, 2025
77df900
updated merge split tests for new function inputs
philipwosull Jul 13, 2025
b0fe550
added new soft and hard plan constraints and other tweaks
philipwosull Jul 13, 2025
b112b07
code now passes all tests on Philip mac
philipwosull Jul 14, 2025
2fe10f8
removed all parallel redistmetrics functions. Moved to gsmcs repo
philipwosull Jul 14, 2025
4111e4a
clean ups
philipwosull Jul 14, 2025
5a37f79
fixing merge conflicts
philipwosull Jul 14, 2025
9ea023e
updated code to avoid unnecessary repeated memory allocation in weigh…
philipwosull Jul 14, 2025
a2eb9d7
Added updated version of eval_segregation and eval_grp_pow and grp_po…
philipwosull Jul 14, 2025
120acfe
adding some of the new updates under 5.0
philipwosull Jul 15, 2025
3382833
more tweaks to news and readme
philipwosull Jul 15, 2025
666d857
addressing comments on plans_helpers
philipwosull Jul 15, 2025
f2c3c0c
updating main readme
philipwosull Jul 15, 2025
4849d02
reverting changes to dot files
philipwosull Jul 15, 2025
6d0bed7
starting to work on short explainer for c++ code
philipwosull Jul 15, 2025
70d475d
revising redist smc
philipwosull Jul 16, 2025
f0cf574
switching naming conventions. total_seats to nseats, nseats to seats,…
philipwosull Jul 17, 2025
6eb02b5
switched shortburst mergesplit backend to forest space
philipwosull Jul 17, 2025
0626438
more renaming of region_sizes to seats
philipwosull Jul 17, 2025
860cdac
cleaning up redist alg helpers
philipwosull Jul 17, 2025
785b5f6
cleaning up redist alg helpers
philipwosull Jul 17, 2025
0c11a58
removing cli prefix before cli_warn and cli_abort
philipwosull Jul 17, 2025
479845f
refactored summary function
philipwosull Jul 18, 2025
766b077
now pass district pops out from redist smc and ms to avoid needing to…
philipwosull Jul 19, 2025
96f8ccb
renaming score_districts_only to only_districts for constraints
philipwosull Jul 19, 2025
961368d
added thresh to constraint R code, still need to add to c++
philipwosull Jul 19, 2025
b8fe0dd
more minor tweaks
philipwosull Jul 20, 2025
74d5c24
moved some constraint functions to map calc
philipwosull Jul 20, 2025
86c744a
changes to linking edge multigraph tau
philipwosull Jul 22, 2025
34faa16
in the middle of fixing linking edge with counties on
philipwosull Jul 22, 2025
5460e68
hierarchical linking edge count now passes some tests
philipwosull Jul 23, 2025
fc871e6
linking edge with counties on now passes first round of tests. Method…
philipwosull Jul 23, 2025
0098a52
linking edge now passes all hierarchical validations
philipwosull Jul 23, 2025
7f50da7
resolving some merge conflicts
philipwosull Jul 23, 2025
cfd3691
all cli lib calls now prefixed with cli colon colon
philipwosull Jul 23, 2025
730a22e
slightly sped up hierarchical linking edge calculation
philipwosull Jul 25, 2025
0a93fa2
more efficiency tweaks to compute log linking edge
philipwosull Jul 25, 2025
90c1bbb
for optimal weights moved linking edge computation from weights
philipwosull Jul 25, 2025
4f5daa8
flipped linking edge term ratio in optimal weights. fixed
philipwosull Jul 25, 2025
cd8799b
added and tested faster method to convert log linking edge for merged…
philipwosull Jul 26, 2025
7b07488
now only compute linking edge selection probability when needed, inst…
philipwosull Jul 28, 2025
f68a826
fixed issue with district populations not being resampled correctly
philipwosull Jul 29, 2025
a7e6a79
when inferring seat sizes only warns about not-tight bounds once
philipwosull Jul 29, 2025
d5d7f83
added mergesplit parallel back with deprecation warning
philipwosull Jul 30, 2025
8dd1677
max_dev now works for multimember plans
philipwosull Jul 31, 2025
93e6c3d
more code tweaks
philipwosull Jul 31, 2025
69a4b66
more mostly style changes for pr
philipwosull Jul 31, 2025
70fdd1b
added thresholding in constraints and new test for custom plan based …
philipwosull Aug 4, 2025
d70da95
adding some missing man pages
philipwosull Aug 4, 2025
b4f5b28
made summary backwards compatible with previous redist plans
philipwosull Aug 4, 2025
90dfcaa
moved constants to package file
philipwosull Aug 5, 2025
4472305
modified constraints cpp code to reduce memory usage
philipwosull Aug 8, 2025
e71879f
thresholding now turns constraints into indicators
philipwosull Aug 10, 2025
01da894
added missing array header
philipwosull Aug 21, 2025
69d2972
can now exactly specify what number of regions plan constraints apply to
philipwosull Aug 21, 2025
010d185
fixed problem with non-unique thread ids
philipwosull Aug 22, 2025
3b0ea35
fixed remaining thread id assignment issues. Now ensures thread ids a…
philipwosull Aug 22, 2025
32eabe2
fixed redist parity bug with MMD
philipwosull Aug 22, 2025
76bf3a7
renaming some mergesplit parameters
philipwosull Sep 19, 2025
a48ba78
removing stale debugging statement
philipwosull Sep 20, 2025
770fb00
forgot to rename some ms move to step in diagnostics
philipwosull Sep 22, 2025
a207d6e
updated diagnostics to return rhats and diagnostics df
philipwosull Oct 11, 2025
a17f6ce
fixed polsby popper calculations
philipwosull Oct 24, 2025
93fd5c0
fixed minor bug with competition constraint c++ code
philipwosull Oct 24, 2025
37a2e1f
updating some doc files
philipwosull Oct 24, 2025
6d962fa
minor verbose output printing tweaks
philipwosull Oct 24, 2025
47cb624
added min_frac thresholding for multiple groups and changed default c…
philipwosull Nov 15, 2025
f0401c2
added min_frac thresholding for multiple groups and changed default c…
philipwosull Nov 15, 2025
fea4023
adding more doc files
philipwosull Dec 4, 2025
d9e9564
for smc can now specify mergesplit for last n steps or every n steps
philipwosull Dec 17, 2025
01c545d
added plan total splits constraint
philipwosull Dec 18, 2025
c7810e5
fixed issue with redist ms test
philipwosull Dec 21, 2025
85139ad
adding partial caching for compactness calculations
philipwosull Dec 26, 2025
560a20c
new much faster tau calculations
philipwosull Dec 27, 2025
9c1f627
removed redundant print statement
philipwosull Dec 27, 2025
12807bc
fixed an issue with cache updating between smc rounds
philipwosull Dec 27, 2025
beebae5
switched linking edge taus to eigen as well:
philipwosull Dec 27, 2025
c2808cd
Merge pull request #4 from philipwosull/sparsechol
philipwosull Dec 30, 2025
fe60b97
Update pkgdown workflow triggers
CoryMcCartan Jan 2, 2026
9bc6c60
Update check-standard.yaml to simplify branch rules
CoryMcCartan Jan 2, 2026
8d28854
Add workflow_dispatch trigger to check-standard.yaml
CoryMcCartan Jan 2, 2026
a035f76
fixing issue with missing functions in RcppExports
philipwosull Jan 13, 2026
9daaa46
fixing issue with subsetting when chain values are NA
philipwosull Jan 21, 2026
80ce495
improving computational stability for plan based constraints
philipwosull Feb 26, 2026
7bb59a9
adding max_split_tries parameter
philipwosull Mar 4, 2026
1814c12
weaken impossibility check
CoryMcCartan Mar 22, 2026
f90e571
improving some linking edge error diagnostics
philipwosull Mar 22, 2026
e76920e
more diagnostic printing detail
philipwosull Mar 22, 2026
b297c7f
rbind for 4.0 and 5.0 SMD plans should work now
philipwosull Mar 31, 2026
6eed205
shortburst now works for multi member district plans
philipwosull May 2, 2026
94b39da
updating shortburst for mmd init plan
philipwosull May 19, 2026
83f631b
copy config files from dev
CoryMcCartan May 29, 2026
966ba88
run formatters
CoryMcCartan May 29, 2026
8042f07
resolve merge conflicts
CoryMcCartan May 29, 2026
7fa96b6
Get tests running, integrate cycle walk, fix lints
CoryMcCartan May 30, 2026
507c431
reorg ignores
CoryMcCartan May 30, 2026
1d5a3cd
base pipe, clean tests, fix check?
CoryMcCartan May 30, 2026
0c1689f
cpp format and try to fix windows check
CoryMcCartan May 30, 2026
25f4f09
printfs for diagnosing windows CI
CoryMcCartan May 30, 2026
cb29925
trace v2
CoryMcCartan May 30, 2026
e8dbcf6
trace 3
CoryMcCartan May 30, 2026
a765f7e
trace 4
CoryMcCartan May 30, 2026
6ad550b
trace 5
CoryMcCartan May 30, 2026
d4f6f37
trace 6
CoryMcCartan May 30, 2026
fbb7dcc
revert diagnostics & remove threading from MS setup (should fix for n…
CoryMcCartan May 30, 2026
fbacd5d
refactor thread_local statics
CoryMcCartan May 31, 2026
ce83082
ensuring shortburst status quo scorer properly labels plans
philipwosull Jun 1, 2026
aad333f
adding issue with backwards compatibility of adding reference plans
philipwosull Jun 15, 2026
5d2f0ec
removing all calls to arma log symmetrical determinant (replaced with…
philipwosull Jun 15, 2026
168e0f8
allowing mmd sampling when one district size can be written as sum of…
philipwosull Jun 16, 2026
a013e09
removing erroneous warnings about certain mmd size configurations
philipwosull Jun 17, 2026
2dcf253
adding some more granular time tracking of smc code
philipwosull Jun 22, 2026
0137bfa
making debugging if statements constexpr and making redist ms use les…
philipwosull Jun 24, 2026
96bee3d
adding toggable dev flag for granular time tracking
philipwosull Jun 30, 2026
cf0ae4f
removing some extraneous at instead of bracket access
philipwosull Jul 1, 2026
6609e14
updating random func to be pass by ref
philipwosull Jul 2, 2026
45f62d5
added packed forest but didn't remove old type
philipwosull Jul 5, 2026
892465b
still occasionally throwing up some kind of rare bug
philipwosull Jul 6, 2026
8e3ad47
adding more checks in the code
philipwosull Jul 6, 2026
a8c9bee
more error catching added
philipwosull Jul 6, 2026
74877d4
even more checks
philipwosull Jul 7, 2026
a632913
more error checks again
philipwosull Jul 7, 2026
617cf77
more checks
philipwosull Jul 7, 2026
cd63411
removing smc base and making utils file
philipwosull Jul 7, 2026
ebe4222
made debug checks more robust
philipwosull Jul 8, 2026
b701f95
adding more optional checks
philipwosull Jul 8, 2026
a4c4163
even more checks added
philipwosull Jul 9, 2026
5da7325
last few commits before removing old forest graph code
philipwosull Jul 9, 2026
8f5837e
removing unnesscary checks and putting the others behind compile flags
philipwosull Jul 9, 2026
ef43cac
added proper dummy county sampling
philipwosull Jul 9, 2026
efad86b
removed vertex forest as an option entirely
philipwosull Jul 10, 2026
c80cdff
switching parent tracking from atomics to one vector per thread (more…
philipwosull Jul 10, 2026
1abf68c
removed old graph tree code
philipwosull Jul 10, 2026
f4ecdc7
slightly faster forest updating now
philipwosull Jul 10, 2026
5ca52f9
makes vectors appended instead of inserted in find joined tree edges
philipwosull Jul 10, 2026
564905c
switched dummy county trees to BFS to encourage bushier trees
philipwosull Jul 10, 2026
8593ccf
brought back compute retroactive split prob with vertex forest for fo…
philipwosull Jul 11, 2026
ee92b6e
removed duplicate constraint code and wrote helpers for R processing
philipwosull Jul 12, 2026
6546373
speeding up log eff boundary computation for forest space by only cop…
philipwosull Jul 12, 2026
7b5bfc6
turning off granular tracking for main branch
philipwosull Jul 13, 2026
4e773f2
removing debugging check from smc
philipwosull Jul 13, 2026
f2a59d0
Merge pull request #7 from philipwosull/packedforests
philipwosull Jul 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
^.*\.Rproj$
^\.Rproj\.user$
README.Rmd
\.git
\.gitignore
^\.github$
\.travis\.yml
\.DS_Store
\.\.Rcheck
builder.sh
^\.vscode$
^\.cache$
^\.claude$
^\.clang-format$
^src/\.clang-format-ignore$
^src/cpp_code_overview\.md$
^air\.toml$
^jarl\.toml$
^compile_commands\.json$
^.*\.o$
^doc$
^\.\.Rcheck$
^Meta$
^doc$
builder.sh
^_pkgdown\.yml$
^docs$
^pkgdown$
^.*\.Rproj$
^\.Rproj\.user$
^cran-comments\.md$
^CRAN-RELEASE$
^R/dev_helpers\.R$
^inst/enumpart/enumpart\.exe$
^data-raw$
^explore$
^\.github$
^LICENSE\.md$
^inst/enumpart/enumpart$
^inst/enumpart/enumpart\.exe$
^cran-comments\.md$
^CRAN-RELEASE$
^CRAN-SUBMISSION$
^revdep$
^\.cache$
^\.claude$
^\.vscode$
^\.clang-format$
^src/\.clang-format-ignore$
^LICENSE\.md$
^CONTRIBUTING\.md$
^air\.toml$
^jarl\.toml$
^compile_commands\.json$
2 changes: 1 addition & 1 deletion .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:

name: R-CMD-check

Expand Down
35 changes: 22 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
# R / RStudio
.Rproj.user
.vscode
.DS_Store
.Rhistory

.claude/
# OS / editors
.DS_Store
.vscode
.cache/
.claude/
CLAUDE.md
compile_commands.json

*.so
# Compiled objects
*.o
*.rds
*.tmp
*.so
*.dll
*.gch
*.pch
*.dll

inst/doc
inst/enumpart/enumpart
# R data / temp
*.rds
*.tmp

# Build artifacts
Meta
doc
inst/doc
src-i386/

# pkgdown / vignette caches
docs
docs/articles/*_cache/*
vignettes/*_cache/*
src-i386/

# Package-specific
inst/enumpart/enumpart
inst/enumpart/enumpart.exe
redist/tests/testthat/_snaps
docs

compile_commands.json
15 changes: 11 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Package: redist
Version: 4.3.2.9000
Date: 2026-02-28
Version: 5.0.0.1
Comment thread
philipwosull marked this conversation as resolved.
Title: Simulation Methods for Legislative Redistricting
Authors@R: c(
person("Christopher T.", "Kenny", email = "ctkenny@proton.me",
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9386-6860")),
person("Cory", "McCartan", email = "mccartan@psu.edu", role = "aut",
comment = c(ORCID = "0000-0002-6251-669X")),
person("Philip", "O'Sullivan", email = "posullivan@fas.harvard.edu", role = "aut",
comment = c(ORCID = "0000-0002-9665-2462")),
person("Ben", "Fifield", email = "benfifield@gmail.com", role = "aut",
comment = c(ORCID = "0000-0002-2247-0201")),
person("Kosuke", "Imai", email = "imai@harvard.edu", role = "aut",
Expand Down Expand Up @@ -61,11 +62,17 @@ Suggests:
spelling,
igraph,
pkgload
LinkingTo: Rcpp, RcppArmadillo, RcppThread, cli, redistmetrics
LinkingTo:
Rcpp,
RcppArmadillo,
RcppEigen,
RcppThread,
redistmetrics,
cli
License: GPL (>= 2)
Encoding: UTF-8
Language: en-US
LazyData: true
License: GPL (>= 2)
SystemRequirements: C++17
NeedsCompilation: yes
BugReports: https://github.com/alarm-redist/redist/issues
Expand Down
10 changes: 9 additions & 1 deletion NAMESPACE
Comment thread
philipwosull marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,24 @@ S3method(ungroup,redist_plans)
S3method(weights,redist_plans)
export(add_constr_compet)
export(add_constr_custom)
export(add_constr_custom_plan)
export(add_constr_edges_rem)
export(add_constr_fry_hold)
export(add_constr_grp_hinge)
export(add_constr_grp_inv_hinge)
export(add_constr_grp_pow)
export(add_constr_incumbency)
export(add_constr_log_st)
export(add_constr_min_group_frac)
export(add_constr_multisplits)
export(add_constr_plan_incumbency)
export(add_constr_plan_splits)
export(add_constr_polsby)
export(add_constr_pop_dev)
export(add_constr_segregation)
export(add_constr_splits)
export(add_constr_status_quo)
export(add_constr_total_plan_splits)
export(add_constr_total_splits)
export(add_reference)
export(as_redist_map)
Expand All @@ -82,15 +87,19 @@ export(compare_plans)
export(competitiveness)
export(county_splits)
export(distr_compactness)
export(est_norm_biased)
export(est_norm_unbiased)
export(filter)
export(freeze)
export(get_adj)
export(get_existing)
export(get_existing_seats)
export(get_mh_acceptance_rate)
export(get_plans_matrix)
export(get_plans_weights)
export(get_pop_tol)
export(get_sampling_info)
export(get_seats_matrix)
export(get_target)
export(group_frac)
export(is_contiguous)
Expand Down Expand Up @@ -204,7 +213,6 @@ importFrom(cli,cli_inform)
importFrom(cli,cli_text)
importFrom(cli,cli_warn)
importFrom(doRNG,"%dorng%")
importFrom(dplyr,"%>%")
importFrom(dplyr,.data)
importFrom(dplyr,all_of)
importFrom(dplyr,arrange)
Expand Down
45 changes: 42 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
# redist (development)

# redist 5.0.0
* Replaces old SMC weights with generally lower variance optimal weights.
* Adds the option to add Mergesplit MCMC steps at any point during an SMC run.
Adding mergesplit steps can help achieve convergence for plans with a larger
number of districts without increasing the sample size.
* Improves SMC and Mergesplit MCMC performance by pre-allocating and reusing as
much memory as possible while drawing spanning trees.
* Introduces new methods for sampling plans for both SMC and Mergesplit MCMC.
The final output is still plans from the same distribution as before but new
sampling spaces and splitting methods will sometimes perform better under some
scenarios.
* Introduces a new method for splitting in SMC - generalized region splits.
Instead of splitting off one district at a time this allows for splitting into
two arbitrary sized regions. For an equal sample size generalized region splits
tends to converge slower but it is typically much faster (up to twice as fast or
more) since on average it draws spanning trees on smaller subgraphs then
single district splits.
* Adds support for sampling multimember district plans with both SMC and
mergesplit MCMC under some mild conditions. The district seat sizes (how many
legislators a district can have) must be a range of values e.g. (3,4,5) and no
district seat size can be the sum of two others.
* When counties are used `redist_mergesplit` now samples from the same target
distribution as `redist_smc` (it guarantees no more than the number of districts
minus 1 splits).
* `redist_mergesplit` inputs now work differently.
Comment thread
CoryMcCartan marked this conversation as resolved.
* `nsims` is now the number of plans saved.
* `warmup` is the number of steps to run the chain for before collecting any samples.
* `thin` means we will run the chain for `thin - 1` steps between saving plans
* Overall the chain will be run for `warmup + nsims * thin` and return `nsims` plans.
* Adds the option to incorporate rejection sampling for all constraints in SMC
and mergesplit MCMC. Any constraint can now include a threshold argument `thresh`
where for a newly split plan if either of the two new regions has a raw score
greater than or equal to `thresh` then the plan will be automatically reject.
This amounts to giving plans where any region has a score above `thresh` a
probability of 0.
* Updates the target distribution when counties are turned on. For more details

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give any more details here, since the paper is not available?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have a preprint by the time this is released

see the forthcoming working paper.
* The mergesplit backend for `redist_shortburst` now uses uniform edge sampling
with forest space for the backend instead of sampling with graph space and all
`k` related parameters have been removed.

# redist 4.4.0
* Old `enumpart` functions are deprecated in favor of `redist_enumpart()` which provides a more consistent syntax.

# redist 4.3.2

* Allows for parallel flip with `chains` argument in `redist_flip()`.
* Fixes URL issues causing a note on CRAN. We have pointed the links to our website directly.

Expand Down
Loading