Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gsll
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
antik
gsll
Commits
efcc519c
Commit
efcc519c
authored
11 years ago
by
Liam M. Healy
Browse files
Options
Downloads
Patches
Plain Diff
Start GSL test conversion change to mimic GSL's test functions
parent
75b6667f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test-unit/convert.lisp
+29
-16
29 additions, 16 deletions
test-unit/convert.lisp
test-unit/gsl-tests.lisp
+3
-2
3 additions, 2 deletions
test-unit/gsl-tests.lisp
with
32 additions
and
18 deletions
test-unit/convert.lisp
+
29
−
16
View file @
efcc519c
;; Convert the GSL tests
;; Liam Healy 2010-05-22 13:03:53EDT convert.lisp
;; Time-stamp: <2014-0
1-21
1
6
:1
6:59
EST convert.lisp>
;; Time-stamp: <2014-0
2-09
1
7
:1
8:12
EST convert.lisp>
;; Copyright 2010, 2014 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -32,6 +32,34 @@
(
in-package
:gsl
)
(
defun
replace-function-name
(
string
)
"Replace the names of GSL functions with their GSLL equivalents."
(
cl-ppcre:regex-replace
;;"\\((\\w*)\\W*\\((.*\\))"
"(gsl_\\w*)\\W*\\((.*)\\)"
string
(
lambda
(
match
&rest
registers
)
(
declare
(
ignore
match
))
(
format
nil
"(~a ~a)"
(
symbol-name
(
gsl-lookup
(
first
registers
)))
(
second
registers
)))
:simple-calls
t
))
(
defun
convert-gsl-form
(
string
&optional
map-args
)
"Read the GSL form as a string and generate an equivalent CL form. The argument 'map-args is a list of numbers giving a permutation."
;; Future: could be lambdas to map the functions.
(
let
((
sexp
(
read-from-string
(
substitute
#\space
#\,
(
replace-function-name
string
)))))
(
if
permute-args
(
cons
(
first
sexp
)
(
mapcar
(
lambda
(
n
)
(
nth
n
(
rest
sexp
)))
map-args
))
sexp
)))
;;;;****************************************************************************
;;; [2014-02-09 Sun 13:07] OLD
;;; (princ (convert-gsl-test "(gsl_cdf_tdist_P, (0.001, 1.0), 5.00318309780080559e-1, TEST_TOL6)"))
;;; (ASSERT-TO-TOLERANCE (TDIST-P 0.001d0 1.0d0) 5.00318309780080559d-1 +TEST-TOL6+)
;;; (princ (convert-gsl-test "(s, gsl_sf_lngamma_e, (-0.1, &r), 2.368961332728788655 , TEST_TOL0, GSL_SUCCESS)" *sf-select*))
...
...
@@ -61,21 +89,6 @@
when
d
collect
(
nth
i
list
))
list
))
(
defun
replace-function-name
(
string
)
"Replace the names of GSL functions with their GSLL equivalents."
(
cl-ppcre:regex-replace
;;"\\((\\w*)\\W*\\((.*\\))"
"(gsl_\\w*)\\W*\\((.*)\\)"
string
(
lambda
(
match
&rest
registers
)
(
declare
(
ignore
match
))
(
format
nil
"(~a ~a)"
(
symbol-name
(
gsl-lookup
(
first
registers
)))
(
second
registers
)))
:simple-calls
t
))
(
defparameter
*float-parse-regex*
;; Based on advice given in
;; http://www.regular-expressions.info/floatingpoint.html
...
...
This diff is collapsed.
Click to expand it.
test-unit/gsl-tests.lisp
+
3
−
2
View file @
efcc519c
;; GSL defined tests
;; Liam Healy 2014-01-21 10:42:48EST gsl-tests.lisp
;; Time-stamp: <2014-0
1-21 16:14:55
EST gsl-tests.lisp>
;; Time-stamp: <2014-0
2-09 17:47:37
EST gsl-tests.lisp>
;; Copyright 2014 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -50,7 +50,8 @@
status
test-description
result
expected
)))))
;; TEST(gsl_cdf_beta_P, (0.0000000000000000e+00,1.3,2.7), 0.000000000000e+00, TEST_TOL6);
;;; TEST(gsl_cdf_beta_P, (0.0000000000000000e+00,1.3,2.7), 0.000000000000e+00, TEST_TOL6);
;;; (convert-gsl-form )
;; gsl-lookup("gsl_cdf_beta_P")
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment