aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-01-08 13:14:30 +0530
committerArun Isaac2022-01-08 13:14:30 +0530
commit89d4e7984ca26315e2f645beee7aea0e52d5cb2a (patch)
treeef3a5b2cb30e35bc740f45765590928cf99f8760
parentb8d499871bdd6d5ccf42f7cd41b5c6f6d1fa090c (diff)
downloadnsmc-main.tar.gz
nsmc-main.tar.lz
nsmc-main.zip
Advertise python code.HEADmain
* README.org: Advertise python code. * python/README.md: New file.
-rw-r--r--README.org4
-rw-r--r--python/README.md36
2 files changed, 40 insertions, 0 deletions
diff --git a/README.org b/README.org
index 758545f..5f4c93f 100644
--- a/README.org
+++ b/README.org
@@ -4,6 +4,10 @@ This repository is the source code accompanying the following papers.
- [[https://arxiv.org/abs/2101.00936][An O(n) algorithm for generating uniform random vectors in n-dimensional cones]]
- [[https://arxiv.org/abs/2007.06808][An algorithm for estimating volumes and other integrals in n dimensions]]
+Most of the code has been ported to Python and is in the /python/
+directory. So, if you wish, you can ignore the rest of this document,
+and jump straight there.
+
* Build
Build dependencies are
diff --git a/python/README.md b/python/README.md
new file mode 100644
index 0000000..8a061c3
--- /dev/null
+++ b/python/README.md
@@ -0,0 +1,36 @@
+This repository is the source code accompanying the following papers.
+- [An O(n) algorithm for generating uniform random vectors in n-dimensional cones](https://arxiv.org/abs/2101.00936)
+- [An algorithm for estimating volumes and other integrals in n dimensions](https://arxiv.org/abs/2007.06808)
+
+However, most of the code for [An O(n) algorithm for generating
+uniform random vectors in n-dimensional
+cones](https://arxiv.org/abs/2101.00936) has been released as a
+separate library—sambal. See [PyPI
+page](https://pypi.org/project/sambal/) and
+[source](https://git.systemreboot.net/sambal).
+
+# Dependencies
+
+The code depends on the following dependencies. Please install them
+before running the scripts. A python virtual environment may be an
+easy way to do this.
+
+- Python 3
+- matplotlib
+- numpy
+- scipy
+- sambal
+
+# Run
+
+The core functions are in `nsmc.py`. The experiments are in the
+scripts `distribution-volumes.py`, `distribution-integrals.py` and
+`spheroid.py`. Run those scripts as
+```
+$ python3 distribution-volumes.py
+$ python3 distribution-integrals.py
+$ python3 spheroid.py
+```
+Plots of the number of samples versus the dimension get written to the
+current directory. Play around with the number of trials, dimensions,
+and relative error tolerances in the scripts.