summaryrefslogtreecommitdiff
path: root/cl/src
diff options
context:
space:
mode:
Diffstat (limited to 'cl/src')
-rw-r--r--cl/src/approx/derivative.lisp9
-rw-r--r--cl/src/approx/maceps.lisp11
-rw-r--r--cl/src/approx/package.lisp5
-rw-r--r--cl/src/package.lisp7
-rw-r--r--cl/src/utils/package.lisp5
-rw-r--r--cl/src/utils/table.lisp11
-rw-r--r--cl/src/utils/within-range.lisp5
-rw-r--r--cl/src/vector/distance.lisp6
-rw-r--r--cl/src/vector/norm.lisp17
-rw-r--r--cl/src/vector/package.lisp7
10 files changed, 0 insertions, 83 deletions
diff --git a/cl/src/approx/derivative.lisp b/cl/src/approx/derivative.lisp
deleted file mode 100644
index 02fcb4c..0000000
--- a/cl/src/approx/derivative.lisp
+++ /dev/null
@@ -1,9 +0,0 @@
-(in-package :lizfcm.approx)
-
-(defun derivative-at (f x &optional (delta 0.01))
- (let* ((x2 (+ x delta))
- (x1 (- x delta))
- (y2 (apply f (list x2)))
- (y1 (apply f (list x1))))
- (/ (- y2 y1)
- (- x2 x1))))
diff --git a/cl/src/approx/maceps.lisp b/cl/src/approx/maceps.lisp
deleted file mode 100644
index ad234e8..0000000
--- a/cl/src/approx/maceps.lisp
+++ /dev/null
@@ -1,11 +0,0 @@
-(in-package :lizfcm.approx)
-
-(defun compute-maceps (f a init)
- (let ((h init)
- (err init))
- (loop while (> err 0)
- do
- (setf h (/ h 2)
- err (abs (- (funcall f (+ a h))
- (funcall f a))))
- collect (list a h err))))
diff --git a/cl/src/approx/package.lisp b/cl/src/approx/package.lisp
deleted file mode 100644
index c11eb60..0000000
--- a/cl/src/approx/package.lisp
+++ /dev/null
@@ -1,5 +0,0 @@
-(in-package :cl-user)
-(defpackage lizfcm.approx
- (:use :cl)
- (:export :derivative-at
- :compute-maceps))
diff --git a/cl/src/package.lisp b/cl/src/package.lisp
deleted file mode 100644
index 88b10eb..0000000
--- a/cl/src/package.lisp
+++ /dev/null
@@ -1,7 +0,0 @@
-(in-package :cl-user)
-(defpackage lizfcm.vector
- (:use :cl)
- (:export
- :n-norm
- :max-norm
- :distance))
diff --git a/cl/src/utils/package.lisp b/cl/src/utils/package.lisp
deleted file mode 100644
index bdd5589..0000000
--- a/cl/src/utils/package.lisp
+++ /dev/null
@@ -1,5 +0,0 @@
-(in-package :cl-user)
-(defpackage lizfcm.utils
- (:use :cl)
- (:export :within-range-p
- :table))
diff --git a/cl/src/utils/table.lisp b/cl/src/utils/table.lisp
deleted file mode 100644
index e96f37b..0000000
--- a/cl/src/utils/table.lisp
+++ /dev/null
@@ -1,11 +0,0 @@
-(in-package :lizfcm.utils)
-
-(defmacro table ((&key headers domain-order domain-values) &body body)
- `(cons
- ,headers
- (mapcar (lambda (tuple)
- (destructuring-bind ,domain-order tuple
- (append tuple
- (list
- ,@body))))
- ,domain-values)))
diff --git a/cl/src/utils/within-range.lisp b/cl/src/utils/within-range.lisp
deleted file mode 100644
index 9a0b762..0000000
--- a/cl/src/utils/within-range.lisp
+++ /dev/null
@@ -1,5 +0,0 @@
-(in-package :lizfcm.utils)
-
-(defun within-range-p (x true-value delta)
- (and (< x (+ true-value delta))
- (> x (- true-value delta))))
diff --git a/cl/src/vector/distance.lisp b/cl/src/vector/distance.lisp
deleted file mode 100644
index 74631ce..0000000
--- a/cl/src/vector/distance.lisp
+++ /dev/null
@@ -1,6 +0,0 @@
-(in-package :lizfcm.vector)
-
-(defun distance (v1 v2 norm)
- (let* ((d (mapcar #'- v1 v2))
- (length (funcall norm d)))
- length))
diff --git a/cl/src/vector/norm.lisp b/cl/src/vector/norm.lisp
deleted file mode 100644
index 2158296..0000000
--- a/cl/src/vector/norm.lisp
+++ /dev/null
@@ -1,17 +0,0 @@
-(in-package :lizfcm.vector)
-
-(defun p-norm (p)
- (lambda (v)
- (expt
- (reduce (lambda (acc x)
- (+ acc x))
- (mapcar (lambda (x)
- (abs
- (expt x p)))
- v))
- (/ 1 p))))
-
-(defun max-norm (v)
- (reduce (lambda (acc x)
- (max acc x))
- v))
diff --git a/cl/src/vector/package.lisp b/cl/src/vector/package.lisp
deleted file mode 100644
index 009b190..0000000
--- a/cl/src/vector/package.lisp
+++ /dev/null
@@ -1,7 +0,0 @@
-(in-package :cl-user)
-(defpackage lizfcm.vector
- (:use :cl)
- (:export
- :p-norm
- :max-norm
- :distance))