Skip to content

New MCMC example, Matrix unit tests & bug fixes#83

Merged
willp240 merged 5 commits intosnoplus:masterfrom
dcookman:profiling_and_eigen
Apr 29, 2026
Merged

New MCMC example, Matrix unit tests & bug fixes#83
willp240 merged 5 commits intosnoplus:masterfrom
dcookman:profiling_and_eigen

Conversation

@dcookman
Copy link
Copy Markdown

This PR does a few things at once:

  • A new example piece of code has been added, examples/MCMC.cpp, which goes through the process of setting up and running a Metropolis MCMC chain under realistic conditions. This is intended both as an example piece of code for new users, and as a piece of code that can be used to test the performance of future changes to OXO.
  • A series of unit tests were added for both the SparseMatrix and DenseMatrix classes, as none currently exist. These ensure that with any future changes to these classes, e.g. if we change how we handle matrices underneath, we can easily test that the SparseMatrix and DenseMatrix interfaces have remained unchanged.
  • In making these unit tests, a major bug was spotted in the multiplication methods for both matrix classes!
    • The fNCols and fNRows member variables were not updated in the output during multiplication
    • Even worse, in the operator*() method for the DenseMatrix class, one of the input matrices would be modified to the product matrix!
    • This has all now been fixed.
  • A few further small changes/clean ups were made to the matrix wrapper classes.

@willp240 willp240 self-requested a review April 29, 2026 13:42
@willp240 willp240 merged commit 5b74c33 into snoplus:master Apr 29, 2026
1 check 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.

2 participants