GithubHelp home page GithubHelp logo

nilsfriess / multigridmc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eikehmueller/multigridmc

0.0 0.0 0.0 1.56 MB

Multigrid Monte Carlo implementation

License: GNU General Public License v3.0

C++ 93.51% Python 3.92% CMake 2.57%

multigridmc's Introduction

Automated tests Code style: black

Multigrid Monte Carlo

C++ implementation of multigrid Monte Carlo (MGMC) algorithm. In addition to MGMC, the code also implements sampling based on different Cholesky factorisations as an alternative algorithm.

Dependencies

The code requires the Eigen library for linear algebra as well as libconfig for parsing configuration files. To install libconfig, clone the libconfig repository and build/install it with CMake.

If possible, Eigen will use BLAS/LAPACK support for dense linear algebra, but it will fall back to the non-BLAS/LAPACK version if these libraries are not installed.

CholMod is an optional dependency, if it is not found the code falls back to using the Simplicial Cholesky factorisation in Eigen, which is not necessarily slower. Cholmod is available as part of SuiteSparse. To prevent the use of CholMod even if it has been installed, set the USE_CHOLMOD flag to Off during the CMake configure stage.

Building the code

To compile, create a new directory called build. Change to this directory and run

cmake ..

to configure, followed by

make

to build the code.

Testing the code

To run the unit tests, use

./bin/test

This can take quite long (several minutes to an hour), to build a simplified version of the tests (which essentially generated less samples when testing statistical properties) set the flag USE_THOROUGH_TESTS to Off when configuring CMake.

Running the code

The executables are called driver_mg (for the deterministic multigrid solve) and driver_mgmc (for Monte Carlo sampling with different samplers) in the bin subdirectory. To run the code, use

./bin/DRIVER CONFIG_FILE

where DRIVER is driver_mg or driver_mgmc and CONFIG_FILE is the name of the file that contains the runtime configuration; an example can be found in parameters_template.cfg. The location, mean and variance of the observations are defined in a measurement file, which is referenced in the measurements dictionary of the configurations file. An example of such a file can be found in measurements_template.cfg. Measurements files can be generated with the Python script generate_measuremenents.py.

References

multigridmc's People

Contributors

eikehmueller avatar nilsfriess avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.