aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Expand)Author
2021-06-30Implement offcenter volume experiments.•••* src/volume-bodies.sc: Implement offcenter volume experiments. Arun Isaac
2021-06-30Add offcenter ellipsoid extent oracle.•••* 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. Arun Isaac
2021-06-30Implement window stopping criterion for integrals.•••* src/extent-sampling.sc (integral): Implement window stopping criterion. Arun Isaac
2021-06-30Support sampling in sphere.•••* src/nd-random.sc (random-vector-in-sphere): New function. * include/nd-random.h (random_vector_in_sphere): Declare it. Arun Isaac
2021-05-07Implement spheroid importance sampling experiments.•••* src/spheroid.sc: New file. * CMakeLists.txt: Add spheroid executable. Arun Isaac
2021-05-07Implement volume of bodies experiments.•••* src/volume-bodies.sc: New file. * CMakeLists.txt: Add volume-bodies executable. Arun Isaac
2021-05-07Implement integral experiments.•••* src/integral.sc: New file. * CMakeLists.txt: Explicitly specify sources for nsmc library. Add integral executable. Arun Isaac
2021-05-07Use window stopping criterion for volume.•••* src/extent-sampling.sc (volume): Use window stopping criterion. Arun Isaac
2021-05-07Treat extent oracles and integrands as const arguments.•••* 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. Arun Isaac
2021-05-07Do not pass rng to integral-per-direction.•••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. Arun Isaac
2021-05-07Define with-file and with-data-file sc macros.•••* src/macros/macros.sc (with-file, with-data-file): New macros. Arun Isaac
2021-05-07Move with-rstats and define with-rstats* sc macros.•••* src/extent-sampling.sc (with-rstats): Move to ... * src/macros/macros.sc (with-rstats): ... to here. (with-rstats*): New macro. Arun Isaac
2021-05-07Define with-rng sc macro.•••* src/macros/macros.sc (with-rng): New macro. Arun Isaac
2021-05-07Move with-vector to macros.sc.•••* src/extent-sampling.sc (with-vector): Move to ... * src/macros/macros.sc (with-vector): ... here. Arun Isaac
2021-05-07Define for-i-step sc macro.•••* src/macros/macros.sc (for-i-step): New macro. Arun Isaac
2021-05-07Define when and unless sc macros.•••* src/macros/macros.sc (when, unless): New macros. Arun Isaac
2021-05-07Add rtol? predicate.•••* src/utils.sc (rtol?): New function. * include/utils.h (rtol_p): Declare it. Arun Isaac
2021-04-20Do not return volume or integral estimate.•••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. Arun Isaac
2021-04-20Return the first accurate estimate.•••* 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. Arun Isaac
2021-04-08Rename volume-experiment to volume-importance.•••* src/extent-sampling.sc, include/extent-sampling.h (volume-experiment): Rename to volume-importance. Arun Isaac
2021-03-16Deal in solid angle fractions, not absolute solid angles.•••* 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. Arun Isaac
2021-03-16Fix edge case when vectors around the nth canonical axis are required.•••* src/nd-random.sc (rotate-from-nth-canonical): Do nothing when vectors around the nth canonical axis are required. Arun Isaac
2021-03-16Implement simplified cone sampling algorithm.•••* 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. Arun Isaac
2021-02-26Add copyright and license headers for all files.•••* include/extent-sampling.h, include/gaussian-nd-random.h, include/integrands.h, include/nd-random.h, include/oracles.h, include/utils.h, src/extent-sampling.sc, src/gaussian-nd-random.sc, src/integrands.sc, src/macros/macros.sc, src/nd-random.sc, src/oracles.sc, src/utils.sc, CMakeLists.txt, pre-inst-env.in: Add copyright and license headers. Arun Isaac
2021-02-26Rename subsampling-random-vector to cone-random-vector.•••* scm/nsmc/wrap.scm: (subsampling-random-vector): Rename to cone-random-vector. * src/nd-random.sc (subsampling-random-vector): Rename to cone-random-vector. * include/nd-random.h (subsampling_random_vector): Rename to cone_random_vector. Arun Isaac
2021-02-26Remove unused neval variable.•••* src/extent-sampling.sc (integral-per-direction): Remove neval from function arguments. (integral): Adjust integral-per-direction function call. Arun Isaac
2021-02-24Remove workaround for sph-sc negation bug.•••The bug has been fixed upstream. * src/integrands.sc (gaussian-integrand): Remove workaround for sph-sc negation bug. Arun Isaac
2021-02-23Implement the lower incomplete gamma function as a scheme wrapper.•••With this change, the wrapper around the gsl lower incomplete gamma function is directly in scheme. Earlier, there was one layer of wrapping in C which needed to be wrapped again in scheme. * include/utils.h (lower_incomplete_gamma): Delete function. * src/utils.sc (lower-incomplete-gamma): Delete function. * scm/extent-sampling/wrap.scm (lower-incomplete-gamma): New function. Arun Isaac
2021-02-23Provide test integrals.•••* include/integrands.h, src/integrands.sc: New files. Arun Isaac
2021-02-23Redefine integrand_t as a struct.•••This change will make it easier for the scheme wrapper to curry integrands. * include/extent-sampling.h (integrand_t): Redefine type as struct. (integral): Pass pointer to integrand_t. * src/extent-sampling.sc (integral-per-direction, integral): Handle new integrand-t type. (invoke-integrand): New sc macro. Arun Isaac
2021-02-23Implement uniform-true-volume without log.•••Logarithmic functions trip up when their parameter is 0. * src/oracles.sc (uniform-true-volume): Implement without log. Arun Isaac
2021-02-23Rename function scope params argument to avoid name conflict.•••* src/oracles.sc (bernoulli-extent-oracle, bernoulli-true-volume, uniform-extent-oracle, uniform-true-volume, beta-extent-oracle, beta-true-volume, cube-extent-oracle, cube-extent-oracle-with-center, cube-true-volume, ellipsoid-extent-oracle, ellipsoid-true-volume, spheroid-extent-oracle, spheroid-true-volume): Rename params argument to -params. Arun Isaac
2021-02-11Pass extent-oracle-t as pointer.•••* include/extent-sampling.h (volume, volume_window, integral, volume_cone, volume_experiment): Pass extent_oracle_t as pointer. * src/extent-sampling.sc: Likewise. Arun Isaac
2021-02-11Change extent oracle and true volume prototypes.•••This change will make it easier for the scheme wrapper to curry extent oracles. * include/extent-sampling.h (extent_oracle_t): Define as a struct that bundles the parameters required by the actual extent oracle. * include/oracles.h (bernoulli_params, uniform_params, beta_params, cube_params, ellipsoid_params, spheroid_params): New types. (bernoulli_extent_generator, uniform_extent_generator, beta_extent_generator): Rename to bernoulli_extent_oracle, uniform_extent_oracle, beta_extent_oracle respectively and change to the new extent oracle prototype. (bernoulli_true_volume, uniform_true_volume, beta_true_volume, cube_extent_oracle, cube_extent_oracle_with_center, cube_true_volume, ellipsoid_extent_oracle, ellipsoid_true_volume, spheroid_extent_oracle, spheroid_true_volume): Change to new extent oracle and true volume prototypes. * src/oracles.sc: Likewise. * src/extent-sampling.sc (invoke-extent-oracle): New macro. (volume, volume-window, integral, volume-cone): Call using new extent oracle prototype. Arun Isaac
2021-02-11Remove unnecessary whitespace.•••* src/nd-random.sc (solid-angle->planar-angle): Remove unnecessary whitespace at the beginning of the line. Arun Isaac
2021-02-11Remove cube maximum extent function.•••We are not using maximum extent functions anymore. * src/oracles.sc (cube-maximum-extent): Delete function. * include/oracles.h (cube-maximum-extent): Delete function declaration. Arun Isaac
2021-02-10Remove unnecessary solver type variable.•••* src/utils.sc (with-root-fsolver): Rewrite without a temporary solver type variable. Arun Isaac
2021-02-10Fix collision between solver type and solver type variable.•••* src/utils.sc (with-root-fsolver): Fix collision between solver type and solver type variable. Arun Isaac
2021-02-10Declare planar, solid angle conversion functions as public.•••* src/nd-random.sc (planar-angle->solid-angle, solid-angle->planar-angle): Declare these to be a part of the public interface of the module. Arun Isaac
2021-02-05Use let* instead of declare and set.•••* src/macros/macros.sc (with-alloc): Use let* instead of declare and set. Arun Isaac
2021-02-05Replace underscores in identifiers with hyphens.•••* src/utils.sc (angle-between-vectors, gaussian-cdf, bisection, bisection-rlimit): Replace underscores in identifiers with hyphens. Arun Isaac
2021-02-05Migrate C source to SC.•••sph-sc is a scheme-like S-expression syntax for C. It elements much of the pain and repetition involved in writing C syntax. * src/extent-sampling.c, src/gaussian-nd-random.c, src/nd-random.c, src/oracles.c, src/utils.c: Delete files. * src/extent-sampling.sc, src/gaussian-nd-random.sc, src/macros/macros.sc, src/nd-random.sc, src/oracles.sc, src/utils.sc: New files. * CMakeLists.txt: Generate C source files from SC source files. Arun Isaac
2021-02-05Declare infinity_norm as static.•••* src/oracles.c (infinity_norm): Declare as static. Arun Isaac
2021-02-05Remove unused geometric progression functions.•••* include/utils.h (gprate, gpterm): Delete function prototype declarations. * src/utils.c (gprate, gpterm): Delete functions. Arun Isaac
2021-02-05Remove unused extent oracles.•••* include/oracles.c (symmetric_spiral_extent_oracle, right_triangle_extent_oracle, right_triangle_true_volume, sphere_extent_oracle, sphere_maximum_extent, plane_extent_oracle): Delete function prototype declarations. * src/oracles.c (symmetric_spiral_extent_oracle, right_triangle_extent_oracle, right_triangle_true_volume, sphere_extent_oracle, sphere_maximum_extent, plane_extent_oracle): Delete functions. Arun Isaac
2021-02-03Move source files and headers to separate directories.•••* extent-sampling.h, gaussian-nd-random.h, nd-random.h, oracles.h, utils.h: Move into include directory. * extent-sampling.c, gaussian-nd-random.c, nd-random.c, oracles.c, utils.c: Move into src directory. * CMakeLists.txt: Set include as include directory. Look for source files inside src directory. Arun Isaac