aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-08Add C code for experiments.Arun Isaac
* experiments/cube.c, experiments/integral.c, experiments/spheroid.c, experiments/volume.c: New files.
2022-01-08Port spheroid experiment to python.Arun Isaac
* python/spheroid.py: New file.
2022-01-08Ignore python generated files.Arun Isaac
* .gitignore: Add python/__pycache__ and python/*.png.
2022-01-08Port integral experiments to python.Arun Isaac
* python/distribution-integrals.py: New file.
2022-01-08Port volume experiments to python.Arun Isaac
* python/distribution-volumes.py: New file.
2022-01-08Port to python.Arun Isaac
* python/nsmc.py: New file.
2022-01-07Move to `guix shell' friendly manifest.scm.Arun Isaac
* guix.scm: Rename to manifest.scm. Replace `guix environment -l guix.scm' with `guix shell'. * README.org (Build): Replace `guix environment -l guix.scm' with `guix shell'.
2022-01-07Add python dependencies to manifest.Arun Isaac
* guix.scm: Import (guix build-system python), (guix download), (gnu packages check), (gnu packages python), (gnu packages python-science) and (gnu packages python-xyz). (python-sambal): New variable. Add python, python-matplotlib, python-numpy, python-sambal and python-scipy to manifest.
2022-01-07Switch to a Guix manifest.Arun Isaac
* guix.scm (nsmc): Delete package. Return a manifest.
2021-12-31Use git-predicate in guix.scm.Arun Isaac
* guix.scm: Do not import (ice-9 match), (ice-9 popen), (ice-9 rdelim), (srfi srfi-1), (srfi srfi-26) and (guix build utils). (git-file?): Delete function. (nsmc): Use git-predicate instead of git-file?
2021-06-30Expose rstats in scheme wrapper.Arun Isaac
* scm/nsmc/wrap.scm (rstat-alloc): Export it. (volume, integral): Accept and return rstats object.
2021-06-30Implement offcenter volume experiments.Arun Isaac
* src/volume-bodies.sc: Implement offcenter volume experiments.
2021-06-30Add offcenter ellipsoid extent oracle.Arun Isaac
* src/oracles.sc: Include gsl/gsl_poly.h. (ellipsoid-extent-oracle-with-center): New function. * include/oracles.h (ellipsoid_params): Add center member. (ellipsoid_extent_oracle_with_center): Declare it.
2021-06-30Implement window stopping criterion for integrals.Arun Isaac
* src/extent-sampling.sc (integral): Implement window stopping criterion.
2021-06-30Support sampling in sphere.Arun Isaac
* src/nd-random.sc (random-vector-in-sphere): New function. * include/nd-random.h (random_vector_in_sphere): Declare it.
2021-05-07Implement spheroid importance sampling experiments.Arun Isaac
* src/spheroid.sc: New file. * CMakeLists.txt: Add spheroid executable.
2021-05-07Implement volume of bodies experiments.Arun Isaac
* src/volume-bodies.sc: New file. * CMakeLists.txt: Add volume-bodies executable.
2021-05-07Implement integral experiments.Arun Isaac
* src/integral.sc: New file. * CMakeLists.txt: Explicitly specify sources for nsmc library. Add integral executable.
2021-05-07Use window stopping criterion for volume.Arun Isaac
* src/extent-sampling.sc (volume): Use window stopping criterion.
2021-05-07Treat extent oracles and integrands as const arguments.Arun Isaac
* include/extent-sampling.h (volume, volume_cone, volume_importance, integral): Pass extent oracle and integrand as const arguments. * src/extent-sampling.sc (volume, volume_cone, volume_importance, integral, integral-per-direction): Likewise.
2021-05-07Do not pass rng to integral-per-direction.Arun Isaac
integral-per-direction should be purely deterministic. * src/extent-sampling.sc (integral-per-direction): Do not accept rng as argument. (integral): Do not pass rng to integral-per-direction.
2021-05-07Define with-file and with-data-file sc macros.Arun Isaac
* src/macros/macros.sc (with-file, with-data-file): New macros.
2021-05-07Move with-rstats and define with-rstats* sc macros.Arun Isaac
* src/extent-sampling.sc (with-rstats): Move to ... * src/macros/macros.sc (with-rstats): ... to here. (with-rstats*): New macro.
2021-05-07Define with-rng sc macro.Arun Isaac
* src/macros/macros.sc (with-rng): New macro.
2021-05-07Move with-vector to macros.sc.Arun Isaac
* src/extent-sampling.sc (with-vector): Move to ... * src/macros/macros.sc (with-vector): ... here.
2021-05-07Define for-i-step sc macro.Arun Isaac
* src/macros/macros.sc (for-i-step): New macro.
2021-05-07Define when and unless sc macros.Arun Isaac
* src/macros/macros.sc (when, unless): New macros.
2021-05-07Add rtol? predicate.Arun Isaac
* src/utils.sc (rtol?): New function. * include/utils.h (rtol_p): Declare it.
2021-05-07Declare polynomial_integrand_params member as const.Arun Isaac
* include/integrands.h (polynomial_integrand_params): Declare coefficients member as const.
2021-04-20Wrap ellipsoid functions.Arun Isaac
* scm/nsmc/wrap.scm (make-ellipsoid-params, make-ellipsoid-oracle, ellipsoid-true-volume): New functions.
2021-04-20Return rstat object from volume and integral wrappers.Arun Isaac
We return the rstat object so it can be passed on into another invocation to continue the estimation and refine the estimate to a closer tolerance. * scm/nsmc/wrap.scm (volume, integral): Return rsat object.
2021-04-20Do not return volume or integral estimate.Arun Isaac
We are already passing in the true volume or integral, and checking that the estimate is within the required tolerance. What is the point in returning the estimate to the caller. * include/extent-sampling.h (volume, integral): Return nothing. * src/extent-sampling.sc (volume, integral): Return nothing. * scm/nsmc/wrap.scm (volume, integral): Accept no return value from C function.
2021-04-20Return the first accurate estimate.Arun Isaac
* include/extent-sampling.h (volume_window): Delete function. * src/extent-sampling.sc (integral, volume): Return the first accurate estimate. (volume-window): Delete function. * scm/nsmc/wrap.scm (volume-window): Delete function.
2021-04-08Wrap volume-importance.Arun Isaac
* scm/nsmc/wrap.scm (volume-importance): New function.
2021-04-08Rename volume-experiment to volume-importance.Arun Isaac
* src/extent-sampling.sc, include/extent-sampling.h (volume-experiment): Rename to volume-importance.
2021-04-08Wrap gsl_sf_lngamma.Arun Isaac
* scm/nsmc/wrap.scm (log-gamma): New function.
2021-03-19Demonstrate cone sampling with rejection sampling too.Arun Isaac
* contrib/cone-vector.py (sample_code): Demonstrate cone sampling with rejection sampling too.
2021-03-19Implement rejection sampling based cone sampling.Arun Isaac
* contrib/cone-vector.py: Import log. (random_planar_angle_pdf, random_vector_on_spherical_cap_pdf): New functions.
2021-03-19Factor out random planar angle generation.Arun Isaac
* contrib/cone-vector.py (random_planar_angle_cdf, random_vector_on_disk): New functions. (random_vector_on_spherical_cap): Rename to random_vector_on_spherical_cap_cdf. Call random_planar_angle_cdf and random_vector_on_disk. (sample_code): Call random_vector_on_spherical_cap_cdf instead of random_vector_on_spherical_cap.
2021-03-16Deal in solid angle fractions, not absolute solid angles.Arun Isaac
* src/extent-sampling.sc (volume-cone): Use solid-angle-fraction->planar-angle instead of solid-angle->planar-angle. * src/nd-random.sc (planar-angle->solid-angle): Rename to planar-angle->solid-angle-fraction and return a solid angle fraction. (solid-angle->planar-angle): Rename to solid-angle-fraction->planar-angle and accept a solid angle fraction. (hollow-cone-random-vector): Use planar-angle->solid-angle-fraction instead of planar-angle->solid-angle. (beta-inc-unnormalized, incomplete-wallis-integral): Delete functions. * include/nd-random.h (planar_angle_to_solid_angle): Rename to planar_angle_to_solid_angle_fraction. (solid_angle_to_planar_angle): Rename to solid_angle_fraction_to_planar_angle. * scm/nsmc/wrap.scm (planar-angle->solid-angle): Rename to planar-angle->solid-angle-fraction.
2021-03-16Fix edge case when vectors around the nth canonical axis are required.Arun Isaac
* src/nd-random.sc (rotate-from-nth-canonical): Do nothing when vectors around the nth canonical axis are required.
2021-03-16Implement simplified cone sampling algorithm.Arun Isaac
* src/nd-random.sc (hollow-cone-random-vector): Implement simplified algorithm that directly samples the surface of the sphere instead of sampling a disk and projecting it onto the surface.
2021-03-15Put sample code in separate function.Arun Isaac
* contrib/cone-vector.py: Call sample_code when run as a script. (sample_code): New function.
2021-03-15Remove unused imports.Arun Isaac
* contrib/cone-vector.py: Don't import zeros from numpy and gamma from scipy.special.
2021-03-15Add function docstrings.Arun Isaac
* contrib/cone-vector.py (random_vector_on_sphere, planar_angle2solid_angle_fraction, solid_angle_fraction2planar_angle, rotate_from_nth_canonical, random_vector_on_spherical_cap): Add docstrings.
2021-03-15Remove space between function name and bracket.Arun Isaac
* contrib/cone-vector.py (random_vector_on_sphere, planar_angle2solid_angle_fraction, solid_angle_fraction2planar_angle, rotate_from_nth_canonical, random_vector_on_spherical_cap): Remove space between function name and bracket.
2021-03-15Implement simplified cone sampling algorithm.Arun Isaac
* contrib/cone-vector.py: Don't import tan. (random_vector_on_spherical_cap): Implement simplified algorithm that directly samples the surface of the sphere instead of sampling a disk and projecting it onto the surface.
2021-03-15Vectorize functions.Arun Isaac
* contrib/cone-vector.py: Import where. (planar_angle2solid_angle_fraction, solid_angle_fraction2planar_angle): Vectorize functions.
2021-03-15Fix solid_angle_fraction2planar_angle for solid_angle_fraction > 1/2.Arun Isaac
* contrib/cone-vector.py (solid_angle_fraction2planar_angle): Fix for solid_angle_fraction > 1/2.
2021-03-10Do not concatenate numpy arrays.Arun Isaac
* contrib/cone-vector.py: Import empty. Don't import concatenate. (random_vector_on_spherical_cap): Build random vector without concatenation.