aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArun Isaac2021-02-10 16:36:10 +0530
committerArun Isaac2021-02-10 16:36:10 +0530
commit49c13d72c248e86e65bde977059e97b7f79a97f8 (patch)
tree1301a236d42390d70f1791356cee04a0e1571f5d /src
parent734dada2a74517f31c26c2fa96ec13cb46afaf82 (diff)
downloadnsmc-49c13d72c248e86e65bde977059e97b7f79a97f8.tar.gz
nsmc-49c13d72c248e86e65bde977059e97b7f79a97f8.tar.lz
nsmc-49c13d72c248e86e65bde977059e97b7f79a97f8.zip
Remove unnecessary solver type variable.
* src/utils.sc (with-root-fsolver): Rewrite without a temporary solver type variable.
Diffstat (limited to 'src')
-rw-r--r--src/utils.sc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/utils.sc b/src/utils.sc
index db59e15..a481109 100644
--- a/src/utils.sc
+++ b/src/utils.sc
@@ -74,15 +74,12 @@ the range [0,pi]."
exact value EXACT."
(return (fabs (- 1 (/ approx exact)))))
-(sc-define-syntax* (with-root-fsolver solver solver-type function a b body ...)
- (let ((solver-type-var (sc-gensym)))
- `(begin
- (let* ((,solver-type-var (const gsl-root-fsolver-type*) ,solver-type))
- (with-alloc solver gsl-root-fsolver*
- (gsl-root-fsolver-alloc ,solver-type)
- gsl-root-fsolver-free
- (gsl-root-fsolver-set solver ,function ,a ,b)
- ,@body)))))
+(sc-define-syntax (with-root-fsolver solver solver-type function a b body ...)
+ (with-alloc solver gsl-root-fsolver*
+ (gsl-root-fsolver-alloc solver-type)
+ gsl-root-fsolver-free
+ (gsl-root-fsolver-set solver function a b)
+ body ...))
(sc-define-syntax* (with-error-handler handler body ...)
(let ((old-handler (sc-gensym)))