diff options
author | Arun Isaac | 2022-01-08 12:44:52 +0530 |
---|---|---|
committer | Arun Isaac | 2022-01-08 13:02:05 +0530 |
commit | 81b49377edf2d5b08dca4b5ff3132499861244ea (patch) | |
tree | 9732533cbd870b0aa11a14c37b468e6ed1bfce45 /src/macros | |
parent | 0ef42dfb41960ffa49aafc04fc7c9bfd49d13857 (diff) | |
download | nsmc-81b49377edf2d5b08dca4b5ff3132499861244ea.tar.gz nsmc-81b49377edf2d5b08dca4b5ff3132499861244ea.tar.lz nsmc-81b49377edf2d5b08dca4b5ff3132499861244ea.zip |
Bunch of unfinished experimentsunfinished-experiments
These experiments were in progress towards the end, and never properly
finished. I leave the code here in case it turns out to be useful.
Diffstat (limited to 'src/macros')
-rw-r--r-- | src/macros/macros.sc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/macros/macros.sc b/src/macros/macros.sc index 1ccfeab..4832887 100644 --- a/src/macros/macros.sc +++ b/src/macros/macros.sc @@ -26,6 +26,9 @@ (when (not condition) body ...)) +(sc-define-syntax (incr var) + (set+ var 1)) + (sc-define-syntax (for-i index limit body ...) (for ((define index int 0) (< index limit) @@ -49,6 +52,18 @@ gsl-vector-free body ...)) +(sc-define-syntax (with-matrix var m n body ...) + (with-alloc var gsl-matrix* + (gsl-matrix-alloc m n) + gsl-matrix-free + body ...)) + +(sc-define-syntax (with-square-matrix var n body ...) + (with-alloc var gsl-matrix* + (gsl-matrix-alloc n n) + gsl-matrix-free + body ...)) + (sc-define-syntax (with-rng var body ...) (with-alloc var gsl-rng* (gsl-rng-alloc gsl-rng-default) gsl-rng-free |