Skip to content

Pcg32 random - #93

Merged
aantonyb merged 3 commits into
mainfrom
pcg32-random
Sep 14, 2026
Merged

aantonyb merged 3 commits into
mainfrom
pcg32-random

Conversation

@aantonyb

Copy link
Copy Markdown
Contributor

Pushing random number generator that allows for controlled random number sequence across platforms

…omness

- Added cardamom_random.c/h with PCG32 implementation
- Replaced all random()/srandom() calls with cardarand()/cardarand_seed()
- Replaced RAND_MAX with CARDAMOM_RAND_MAX
- No macros, no environment dependencies
- Guarantees identical random sequences across all platforms
- Updated all MCMC functions to use new RNG
- Added cardaurand() as cleaner replacement for (double)cardarand()/(double)CARDAMOM_RAND_MAX
- Replaced 31 instances across all MCMC files with the new function
- Code is now more readable and maintainable
- Moved documentation files to /Users/abloom/CLAUDE/SUMMARIES_AND_DESCRIPTIONS/ with SEP26 prefix
- Verified compilation still successful
- Merged cardamom_random.c into cardamom_random.h as static inline functions
- Deleted cardamom_random.c (no longer needed)
- Reverted CARDAMOM_COMPILE.sh to original (no changes required)
- Implementation is now included directly via header
- Zero changes to build system!
@aantonyb
aantonyb merged commit 3e0334a into main Sep 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant