Adding forgotten files. Using new memoize.

This commit is contained in:
Jens Axel Søgaard 2013-12-08 21:10:26 +01:00
parent 6e41c86f54
commit 5095d55cdb
8 changed files with 3957 additions and 4061 deletions

View File

@ -20,4 +20,9 @@ just begon.
Spin off mathematics libraries will be made available on PLaneT.
Installation
============
Open and run install.rkt in DrRacket to install the packages
that Bracket uses.
/soegaard

View File

@ -240,7 +240,9 @@
"undefined.rkt"
#;(submod ".." undefined)
(submod ".." identifiers))
(require (planet dherman/memoize:3:1))
(require ; (planet dherman/memoize:3:1)
memoize ; install with install.rkt
)
(provide simplify
simplify-plus

29
bracket/test-main.rkt Normal file
View File

@ -0,0 +1,29 @@
(module main "bracket-lang.rkt"
(require (submod (file "/Users/soegaard/Dropbox/GitHub/bracket/bracket/bracket.rkt") bracket)
(submod (file "/Users/soegaard/Dropbox/GitHub/bracket/bracket/bracket.rkt") symbolic-application))
(define-syntax (#%infix stx) (syntax-case stx () ((_ expr) #'expr)))
(define expt Power)
(define + Plus)
(define - Minus)
(define * Times)
(define / Quotient)
(define = Equal)
(define sqrt Sqrt)
(define list List)
(define list-ref List-ref)
(define-syntax (define stx) (syntax-case stx () ((_ . more) #'(Define . more))))
(#%infix (begin (begin (begin
(begin
(begin
(begin
(begin
(begin
(begin
(begin
(begin
(begin
(begin
(begin
(begin (begin (begin (begin (begin (begin (begin (begin (begin (begin (begin (begin (begin (begin (begin (DeclareVars x y z x0 y0 z0 w) (* (list 2 3) (list 4 5))) (* 2 (list 3 4))) (* (list 3 4) 5)) (define (Fold f b xs) (foldl f b (rest xs)))) (define (sum-list xs) (Fold Plus 0 xs))) (define (RRange i j) (if (>= i j) (list) (Cons i (Range (+ i 1) j))))) (define (sum f x i j) (sum-list (Map (lambda (k) (Substitute f (= x k))) (Range i j))))) (sum (expt x 2) x 1 4)) (define (dot v w) (sum-list (* v w)))) (define (norm v) (sqrt (dot v v)))) (define (proj v w) (* (/ (dot v w) (expt (norm w) 2)) w))) (define (line point normal) (dot (- point (list x y)) normal))) (define a (list x y))) (define b (list z w))) (define bug-in-next-two-lines 2)) (* a b)) (dot a b)) (norm a)) (norm b)) (proj a b)) (line (list x0 y0) (list z w))) (define x 0)) (= x 0)) (If (= x 0) 1 2)) (If (= x 0) 1 2)) (If (= x 42) 1 2)) (If (+ 3 z) 1 2))
(define x 3)) x))
)

View File

@ -1,5 +1,5 @@
#lang bracket
DeclareVars(x);
DeclareVars(x, Rotate);
Graphics({Disk()});
Graphics({Disk({0,0})});
Graphics({Disk({0,0},5)});
@ -10,4 +10,6 @@ Graphics({Hue(0),Point({0,0}),Hue(1/3),Point({3,0}),Hue(2/3),Point({6,0})});
Graphics({Line({10,10},{20,20},{20,30},{30,30}),
Point({10,10})});
Graphics(AppendStar(Map((λ x.{Hue(x/(2*pi)),Point({8*Sin(2*x),8*Cos(3*x)})}),Range(0,2*pi,1/128))))
Graphics(AppendStar(Map((λ x.{Hue(x/(2*pi)),Point({8*Sin(2*x),8*Cos(3*x)})}),Range(0,2*pi,1/128))));
; Graphics(Map((λ x.{Blend({Red, Yellow}, x/10), Rotate(Rectangle({x, 0}), 2*pi*x/10)}),Range(0,10)));

File diff suppressed because it is too large Load Diff

25
install.rkt Normal file
View File

@ -0,0 +1,25 @@
#lang racket
(require pkg)
;;;
;;; Open this file in DrRacket and run it to install
;;; these packages:
;;;
; install : source -> void
(define (install source)
(define (always) #t)
(define (handle e)
(displayln (~a "Error occured while installing: " source))
(displayln (exn-message e)))
(with-handlers ([always handle])
(apply pkg-install-command (list source))))
; memoize
(install "memoize")

View File

@ -1,7 +1,7 @@
#reader(lib"read.ss""wxme")WXME0108 ##
#|
This file uses the GRacket editor format.
Open this file in DrRacket version 5.3.0.11 or later to read it.
Open this file in DrRacket version 5.3.0.14 or later to read it.
Most likely, it was created by saving a program in DrRacket,
and it probably contains a program with non-text elements
@ -9,7 +9,7 @@
http://racket-lang.org/
|#
30 7 #"wxtext\0"
29 7 #"wxtext\0"
3 1 6 #"wxtab\0"
1 1 8 #"wximage\0"
2 0 8 #"wxmedia\0"
@ -48,8 +48,7 @@
2 0 34 #"(lib \"scheme-snipclass.ss\" \"xml\")\0"
1 0 10 #"text-box%\0"
1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0"
1 0 15 #"test-case-box%\0"
2 0 1 6 #"wxloc\0"
1 0 1 6 #"wxloc\0"
0 0 65 0 1 #"\0"
0 75 1 #"\0"
0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
@ -209,46 +208,45 @@
-1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 100 0 0 0 0 -1
-1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 0 -1 -1 0
1 #"\0"
0 -1 1 #"\0"
0 13 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
0 13 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1 0 1
#"\0"
0 75 12 #"Courier New\0"
0.0 16 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 47 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 49 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 2 1 #"\0"
-1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 0 100 0 0 0 0 -1
-1 4 1 #"\0"
-1 2 1 #"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1 0 1
#"\0"
0 75 12 #"Courier New\0"
0.0 16 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 0 -1 -1 0 1 #"\0"
0 -1 1 #"\0"
0.0 13 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
0.0 13 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 47 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 49 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 45 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 14714 0 26 3 12 #"#lang racket"
-1 -1 0 14554 0 26 3 12 #"#lang racket"
0 0 22 29 1 #"\n"
0 0 22 3 1 #"("
0 0 14 3 7 #"require"
0 0 22 3 1 #" "
0 0 19 3 10 #"\"../utils/"
0 0 19 3 12 #"for-max.rkt\""
0 0 19 3 22 #"\"../utils/for-max.rkt\""
0 0 22 3 1 #")"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
@ -392,10 +390,7 @@
0 0 22 29 1 #"\n"
0 0 17 3 36 #"; Run this in DrRacket and evaluate "
0 0 22 29 1 #"\n"
0 0 17 3 6 #"; ("
0 0 17 3 7 #"require"
0 0 17 3 10 #" (submod \""
0 0 17 3 9 #".\" test))"
0 0 17 3 32 #"; (require (submod \".\" test))"
0 0 22 29 1 #"\n"
0 0 17 3 45 #"; in the interaction window to run the tests."
0 0 22 29 1 #"\n"
@ -404,10 +399,7 @@
0 0 17 3 11 #"; module to"
0 0 17 3 1 #" "
0 0 17 3 3 #"the"
0 0 17 3 1 #" "
0 0 17 3 4 #"list"
0 0 17 3 1 #" "
0 0 17 3 21 #"of submodules to run."
0 0 17 3 27 #" list of submodules to run."
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 22 3 1 #"("
@ -1167,10 +1159,7 @@
0 0 19 3 1 #" "
0 0 19 3 8 #"elements"
0 0 19 3 1 #" "
0 0 19 3 2 #"do"
0 0 19 3 1 #" "
0 0 19 3 3 #"not"
0 0 19 3 8 #" match.\""
0 0 19 3 14 #"do not match.\""
0 0 22 29 1 #"\n"
0 0 22 3 16 #" ("
0 0 14 3 1 #"="
@ -1646,10 +1635,7 @@
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 2 #"; "
0 0 17 3 17 #"(for/matrix m n ("
0 0 17 3 6 #"clause"
0 0 17 3 1 #" "
0 0 17 3 18 #"...) . defs+exprs)"
0 0 17 3 42 #"(for/matrix m n (clause ...) . defs+exprs)"
0 0 22 29 1 #"\n"
0 0 17 3 63
#"; Return an m x n matrix with elements from the last expr."
@ -1811,9 +1797,7 @@
0 0 22 3 2 #"))"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 20 #"; (for*/matrix m n ("
0 0 17 3 6 #"clause"
0 0 17 3 19 #" ...) . defs+exprs)"
0 0 17 3 45 #"; (for*/matrix m n (clause ...) . defs+exprs)"
0 0 22 29 1 #"\n"
0 0 17 3 63
#"; Return an m x n matrix with elements from the last expr."
@ -1824,8 +1808,7 @@
0 0 22 29 1 #"\n"
0 0 17 3 40 #"; The bindings in clauses run nested."
0 0 22 29 1 #"\n"
0 0 17 3 29 #"; (for*/matrix m n #:column ("
0 0 17 3 25 #"clause ...) . defs+exprs)"
0 0 17 3 54 #"; (for*/matrix m n #:column (clause ...) . defs+exprs)"
0 0 22 29 1 #"\n"
0 0 17 3 63
#"; Return an m x n matrix with elements from the last expr."
@ -2165,10 +2148,7 @@
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 18 #"; (for/matrix-sum "
0 0 17 3 1 #"("
0 0 17 3 6 #"clause"
0 0 17 3 1 #" "
0 0 17 3 18 #"...) . defs+exprs)"
0 0 17 3 26 #"(clause ...) . defs+exprs)"
0 0 22 29 1 #"\n"
0 0 17 3 69
(
@ -2338,10 +2318,7 @@
0 0 22 3 2 #"))"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 19 #"; (for*/matrix-sum "
0 0 17 3 1 #"("
0 0 17 3 6 #"clause"
0 0 17 3 19 #" ...) . defs+exprs)"
0 0 17 3 45 #"; (for*/matrix-sum (clause ...) . defs+exprs)"
0 0 22 29 1 #"\n"
0 0 17 3 69
(
@ -2635,10 +2612,7 @@
0 0 19 3 8 #"expected"
0 0 19 3 1 #" "
0 0 19 3 6 #"matrix"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"M"
0 0 22 3 2 #"))"
@ -2663,10 +2637,7 @@
0 0 19 3 3 #"row"
0 0 19 3 1 #" "
0 0 19 3 6 #"number"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"r"
0 0 22 3 3 #")))"
@ -2796,10 +2767,7 @@
0 0 19 3 8 #"expected"
0 0 19 3 1 #" "
0 0 19 3 6 #"matrix"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"M"
0 0 22 3 2 #"))"
@ -2824,10 +2792,7 @@
0 0 19 3 3 #"row"
0 0 19 3 1 #" "
0 0 19 3 6 #"number"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"r"
0 0 22 3 3 #")))"
@ -3033,10 +2998,7 @@
0 0 19 3 8 #"expected"
0 0 19 3 1 #" "
0 0 19 3 6 #"matrix"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"M"
0 0 22 3 2 #"))"
@ -3061,10 +3023,7 @@
0 0 19 3 3 #"col"
0 0 19 3 1 #" "
0 0 19 3 6 #"number"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"s"
0 0 22 3 3 #")))"
@ -3198,10 +3157,7 @@
0 0 19 3 8 #"expected"
0 0 19 3 1 #" "
0 0 19 3 6 #"matrix"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"M"
0 0 22 3 2 #"))"
@ -3226,10 +3182,7 @@
0 0 19 3 3 #"col"
0 0 19 3 1 #" "
0 0 19 3 6 #"number"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 3 #"got"
0 0 19 3 4 #" ~a\""
0 0 19 3 9 #", got ~a\""
0 0 22 3 1 #" "
0 0 14 3 1 #"s"
0 0 22 3 3 #")))"
@ -3349,10 +3302,7 @@
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 13 #"; (submatrix "
0 0 17 3 1 #"M"
0 0 17 3 1 #" "
0 0 17 3 1 #"i"
0 0 17 3 7 #" j m n)"
0 0 17 3 10 #"M i j m n)"
0 0 22 29 1 #"\n"
0 0 17 3 62
#"; Return the submatrix of M with upper left corner in (i,j)"
@ -3583,10 +3533,7 @@
0 0 17 3 6 #"matrix"
0 0 17 3 1 #" "
0 0 17 3 4 #"with"
0 0 17 3 1 #" "
0 0 17 3 4 #"ones"
0 0 17 3 1 #" "
0 0 17 3 36 #"on the diagonal and zeros elsewhere."
0 0 17 3 42 #" ones on the diagonal and zeros elsewhere."
0 0 22 29 1 #"\n"
0 0 22 3 1 #"("
0 0 15 3 6 #"define"
@ -3707,8 +3654,7 @@
0 0 14 3 7 #"matrix?"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 19 #"matrix-augment M N)"
0 0 17 3 22 #"; (matrix-augment M N)"
0 0 22 29 1 #"\n"
0 0 17 3 18 #"; Return [M N]."
0 0 22 29 1 #"\n"
@ -4760,9 +4706,7 @@
0 0 14 3 7 #"matrix?"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 2 #"; "
0 0 17 3 1 #"("
0 0 17 3 15 #"matrix-add M N)"
0 0 17 3 18 #"; (matrix-add M N)"
0 0 22 29 1 #"\n"
0 0 17 3 16 #"; Return M+N."
0 0 22 29 1 #"\n"
@ -5372,10 +5316,7 @@
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 2 #"; "
0 0 17 3 1 #"("
0 0 17 3 17 #"matrix-swap-rows!"
0 0 17 3 1 #" "
0 0 17 3 6 #"M r s)"
0 0 17 3 25 #"(matrix-swap-rows! M r s)"
0 0 22 29 1 #"\n"
0 0 17 3 32 #"; Swap the rows r and s in M."
0 0 22 29 1 #"\n"
@ -5532,10 +5473,7 @@
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 2 #"; "
0 0 17 3 1 #"("
0 0 17 3 17 #"matrix-scale-row!"
0 0 17 3 1 #" "
0 0 17 3 6 #"M r a)"
0 0 17 3 25 #"(matrix-scale-row! M r a)"
0 0 22 29 1 #"\n"
0 0 17 3 43 #"; Multiply all elements in row r with a."
0 0 22 29 1 #"\n"
@ -5681,10 +5619,7 @@
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 22 #"matrix-add-scaled-row!"
0 0 17 3 1 #" "
0 0 17 3 1 #"M"
0 0 17 3 1 #" "
0 0 17 3 6 #"r a s)"
0 0 17 3 9 #" M r a s)"
0 0 22 29 1 #"\n"
0 0 17 3 34 #"; row t becomes row_r + a*row_s"
0 0 22 29 1 #"\n"
@ -5919,8 +5854,7 @@
0 0 14 3 12 #"row-vector/c"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 2 #"; "
0 0 17 3 17 #"(row-vector . xs)"
0 0 17 3 19 #"; (row-vector . xs)"
0 0 22 29 1 #"\n"
0 0 17 3 59
#"; Return row vector (1xn matrix) with elements from xs."
@ -6298,10 +6232,7 @@
0 0 14 3 5 #"nat/c"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 23 #"matrix-gauss-eliminate!"
0 0 17 3 1 #" "
0 0 17 3 26 #"M [unitize-pivot-row? #f])"
0 0 17 3 53 #"; (matrix-gauss-eliminate! M [unitize-pivot-row? #f])"
0 0 22 29 1 #"\n"
0 0 17 3 38 #"; Transform M to row echelon form."
0 0 22 29 1 #"\n"
@ -6940,9 +6871,6 @@
0 0 22 3 3 #")))"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 20 3 1 #"'"
0 0 14 3 3 #"foo"
0 0 22 29 1 #"\n"
0 0 22 3 1 #"("
0 0 14 3 17 #"column+null-space"
0 0 22 3 1 #" "
@ -8653,10 +8581,7 @@
0 0 14 3 14 #"matrix-inverse"
0 0 22 3 1 #" "
0 0 19 3 1 #"\""
0 0 19 3 6 #"matrix"
0 0 19 3 1 #" "
0 0 19 3 3 #"not"
0 0 19 3 8 #" square\""
0 0 19 3 18 #"matrix not square\""
0 0 22 3 2 #"))"
0 0 22 29 1 #"\n"
0 0 22 3 3 #" ("
@ -8843,10 +8768,7 @@
0 0 19 3 6 #"matrix"
0 0 19 3 1 #")"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 4 #"got:"
0 0 19 3 1 #" "
0 0 19 3 4 #"~a \""
0 0 19 3 10 #" got: ~a \""
0 0 22 3 1 #" "
0 0 14 3 1 #"b"
0 0 22 3 2 #"))"
@ -8882,10 +8804,7 @@
0 0 19 3 1 #" "
0 0 19 3 4 #"rows"
0 0 19 3 1 #" "
0 0 19 3 2 #"as"
0 0 19 3 1 #" "
0 0 19 3 3 #"the"
0 0 19 3 8 #" matrix\""
0 0 19 3 14 #"as the matrix\""
0 0 22 3 2 #"))"
0 0 22 29 1 #"\n"
0 0 22 3 3 #" ("
@ -9049,10 +8968,7 @@
0 0 19 3 6 #"matrix"
0 0 19 3 1 #")"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 4 #"got:"
0 0 19 3 1 #" "
0 0 19 3 4 #"~a \""
0 0 19 3 10 #" got: ~a \""
0 0 22 3 2 #" ("
0 0 14 3 5 #"first"
0 0 22 3 1 #" "
@ -9090,10 +9006,7 @@
0 0 19 3 1 #" "
0 0 19 3 4 #"rows"
0 0 19 3 1 #" "
0 0 19 3 2 #"as"
0 0 19 3 1 #" "
0 0 19 3 3 #"the"
0 0 19 3 8 #" matrix\""
0 0 19 3 14 #"as the matrix\""
0 0 22 3 2 #"))"
0 0 22 29 1 #"\n"
0 0 22 3 3 #" ("
@ -9189,8 +9102,6 @@
0 0 22 29 1 #"\n"
0 0 17 3 24 #"; (matrix-determinant M)"
0 0 22 29 1 #"\n"
0 0 17 3 45 #"; Return the inverse of a square matrix M."
0 0 22 29 1 #"\n"
0 0 22 3 1 #"("
0 0 15 3 6 #"define"
0 0 22 3 2 #" ("
@ -10407,10 +10318,7 @@
0 0 19 3 6 #"vector"
0 0 19 3 1 #" "
0 0 19 3 2 #"gv"
0 0 19 3 1 #","
0 0 19 3 1 #" "
0 0 19 3 4 #"got:"
0 0 19 3 4 #" ~a\""
0 0 19 3 10 #", got: ~a\""
0 0 22 3 1 #" "
0 0 14 3 2 #"gv"
0 0 22 3 4 #")]))"
@ -10998,8 +10906,7 @@
0 0 14 3 7 #"number?"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 17 #"vector-angle v w)"
0 0 17 3 20 #"; (vector-angle v w)"
0 0 22 29 1 #"\n"
0 0 17 3 47 #"; Return the unsigned angle between v and w."
0 0 22 29 1 #"\n"
@ -11575,8 +11482,7 @@
0 0 14 3 15 #"column-vector/c"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 36 #"projection-on-orthogonal-basis v bs)"
0 0 17 3 39 #"; (projection-on-orthogonal-basis v bs)"
0 0 22 29 1 #"\n"
0 0 17 3 64
#"; Project the basis v on the orthogonal basis vectors in bs."
@ -12113,9 +12019,7 @@
0 0 22 29 1 #"\n"
0 0 17 3 49 #"; Given a list ws of column vectors, produce "
0 0 22 29 1 #"\n"
0 0 17 3 8 #"; an"
0 0 17 3 1 #" "
0 0 17 3 36 #"orthogonal basis for the span of the"
0 0 17 3 45 #"; an orthogonal basis for the span of the"
0 0 22 29 1 #"\n"
0 0 17 3 20 #"; vectors in ws."
0 0 22 29 1 #"\n"
@ -12383,8 +12287,7 @@
0 0 14 3 8 #"matrix/c"
0 0 22 3 3 #")])"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 28 #"projection-on-subspace v ws)"
0 0 17 3 31 #"; (projection-on-subspace v ws)"
0 0 22 29 1 #"\n"
0 0 17 3 57 #"; Returns the projection of v on span{w_i}, w_i in ws."
0 0 22 29 1 #"\n"
@ -14423,8 +14326,7 @@
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 43 #"define b (column-vector 6.5 8.5 11.0 12.5))"
0 0 17 3 46 #"; (define b (column-vector 6.5 8.5 11.0 12.5))"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 6 #"define"
@ -14436,10 +14338,7 @@
0 0 17 3 1 #" "
0 0 17 3 1 #"1"
0 0 17 3 1 #" "
0 0 17 3 1 #"1"
0 0 17 3 1 #" "
0 0 17 3 1 #"1"
0 0 17 3 29 #" 1) (column-vector 2 4 5 6)))"
0 0 17 3 32 #"1 1 1) (column-vector 2 4 5 6)))"
0 0 22 29 1 #"\n"
0 0 17 3 30 #"; (projection-on-subspace b A)"
0 0 22 29 1 #"\n"
@ -14577,8 +14476,7 @@
0 0 17 3 65
#"; At that moment, the non-existance of a solution is known."
0 0 22 29 1 #"\n"
0 0 17 3 1 #";"
0 0 17 3 40 #"> (vector-in-span? (column-vector 7 6 1)"
0 0 17 3 41 #";> (vector-in-span? (column-vector 7 6 1)"
0 0 22 29 1 #"\n"
0 0 17 3 47 #"; (list (column-vector 1 2 3)"
0 0 22 29 1 #"\n"
@ -14611,22 +14509,15 @@
0 0 17 3 15 #"matrix-augment*"
0 0 17 3 2 #" ("
0 0 17 3 4 #"list"
0 0 17 3 2 #" ("
0 0 17 3 13 #"column-vector"
0 0 17 3 1 #" "
0 0 17 3 6 #"1 2 3)"
0 0 17 3 22 #" (column-vector 1 2 3)"
0 0 22 29 1 #"\n"
0 0 17 3 1 #";"
0 0 17 3 38 #" ("
0 0 17 3 13 #"column-vector"
0 0 17 3 1 #" "
0 0 17 3 8 #"-2 -5 2)"
0 0 17 3 60
#" (column-vector -2 -5 2)"
0 0 22 29 1 #"\n"
0 0 17 3 1 #";"
0 0 17 3 38 #" ("
0 0 17 3 13 #"column-vector"
0 0 17 3 1 #" "
0 0 17 3 9 #"1 2 -2)))"
0 0 17 3 61
#" (column-vector 1 2 -2)))"
0 0 22 29 1 #"\n"
0 0 17 3 1 #";"
0 0 17 3 15 #" ("
@ -14652,15 +14543,10 @@
0 0 17 3 1 #"3"
0 0 17 3 1 #" "
0 0 17 3 1 #"1"
0 0 17 3 1 #" "
0 0 17 3 1 #"'"
0 0 17 3 2 #"#("
0 0 17 3 7 #"7 6 1))"
0 0 17 3 11 #" '#(7 6 1))"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 1 #";"
0 0 17 3 1 #"("
0 0 17 3 21 #"define (is-basis? vs)"
0 0 17 3 23 #";(define (is-basis? vs)"
0 0 22 29 1 #"\n"
0 0 17 3 6 #"; ("
0 0 17 3 5 #"check"
@ -14669,15 +14555,10 @@
0 0 17 3 1 #" "
0 0 17 3 2 #"vs"
0 0 17 3 1 #" "
0 0 17 3 3 #"are"
0 0 17 3 1 #" "
0 0 17 3 1 #"a"
0 0 17 3 19 #" basis)) p. 122-123"
0 0 17 3 24 #"are a basis)) p. 122-123"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 1 #";"
0 0 17 3 1 #"("
0 0 17 3 32 #"define (reduce-span-to-basis vs)"
0 0 17 3 34 #";(define (reduce-span-to-basis vs)"
0 0 22 29 1 #"\n"
0 0 17 3 18 #"; ...) ; p. 138"
0 0 22 29 1 #"\n"
@ -14695,41 +14576,27 @@
0 0 17 3 8 #"; p. 148"
0 0 22 29 1 #"\n"
0 0 17 3 2 #";("
0 0 17 3 6 #"define"
0 0 17 3 2 #" ("
0 0 17 3 20 #"expand-span-to-basis"
0 0 17 3 18 #" vs) ...) ; p. 145"
0 0 17 3 46 #"define (expand-span-to-basis vs) ...) ; p. 145"
0 0 22 29 1 #"\n"
0 0 17 3 2 #";("
0 0 17 3 6 #"define"
0 0 17 3 2 #" ("
0 0 17 3 29 #"coordinated-relative-to-basis"
0 0 17 3 1 #" "
0 0 17 3 1 #"v"
0 0 17 3 18 #" bs) ...) ; p. 153"
0 0 17 3 49 #"coordinated-relative-to-basis v bs) ...) ; p. 153"
0 0 22 29 1 #"\n"
0 0 17 3 2 #";("
0 0 17 3 6 #"define"
0 0 17 3 2 #" ("
0 0 17 3 22 #"change-of-basis-matrix"
0 0 17 3 1 #" "
0 0 17 3 2 #"bs"
0 0 17 3 18 #" cs) ...) ; p. 157"
0 0 17 3 43 #"change-of-basis-matrix bs cs) ...) ; p. 157"
0 0 22 29 1 #"\n"
0 0 17 3 2 #";("
0 0 17 3 6 #"define"
0 0 17 3 2 #" ("
0 0 17 3 11 #"determinant"
0 0 17 3 14 #" M) ...) ; p ?"
0 0 17 3 33 #"define (determinant M) ...) ; p ?"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 13 #";;; Run tests"
0 0 22 29 1 #"\n"
0 0 17 3 28 #";(require (submod \".\" test))"
0 0 22 29 1 #"\n"
0 0 17 3 2 #";("
0 0 17 3 7 #"require"
0 0 17 3 19 #" (submod \".\" test))"
0 0 17 3 28 #";(require (submod \".\" test))"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 91
@ -14926,14 +14793,9 @@
0 0 17 3 1 #" "
0 0 17 3 5 #"100.0"
0 0 17 3 2 #" "
0 0 17 3 5 #"-100."
0 0 17 3 1 #" "
0 0 17 3 4 #"200."
0 0 17 3 7 #" 100.))"
0 0 17 3 17 #"-100. 200. 100.))"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 16 #"row-echelon-form"
0 0 17 3 3 #" M)"
0 0 17 3 22 #"; (row-echelon-form M)"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0 17 3 32 #"; Example from Trefethen and Bau"
@ -14945,16 +14807,10 @@
0 0 17 3 2 #" ("
0 0 17 3 5 #"range"
0 0 17 3 1 #" "
0 0 17 3 5 #"-128."
0 0 17 3 1 #" "
0 0 17 3 4 #"128."
0 0 17 3 6 #" 4.0))"
0 0 17 3 16 #"-128. 128. 4.0))"
0 0 22 29 1 #"\n"
0 0 17 3 2 #";("
0 0 17 3 6 #"define"
0 0 17 3 1 #" "
0 0 17 3 1 #"A"
0 0 17 3 18 #" (matrix-augment* "
0 0 17 3 26 #"define A (matrix-augment* "
0 0 22 29 1 #"\n"
0 0 17 3 13 #"; ("
0 0 17 3 4 #"list"
@ -14967,10 +14823,18 @@
0 0 17 3 2 #" ("
0 0 17 3 2 #"\316\273"
0 0 17 3 2 #" ("
0 0 17 3 1 #"x"
0 0 17 3 2 #") "
0 0 17 3 1 #"0"
0 0 17 3 6 #") xs))"
0 0 17 3 10 #"x) 0) xs))"
0 0 22 29 1 #"\n"
0 0 17 3 19 #"; ("
0 0 17 3 5 #"apply"
0 0 17 3 1 #" "
0 0 17 3 13 #"column-vector"
0 0 17 3 2 #" ("
0 0 17 3 3 #"map"
0 0 17 3 2 #" ("
0 0 17 3 2 #"\316\273"
0 0 17 3 2 #" ("
0 0 17 3 10 #"x) x) xs))"
0 0 22 29 1 #"\n"
0 0 17 3 19 #"; ("
0 0 17 3 5 #"apply"
@ -14982,9 +14846,10 @@
0 0 17 3 2 #"\316\273"
0 0 17 3 2 #" ("
0 0 17 3 1 #"x"
0 0 17 3 2 #") "
0 0 17 3 1 #"x"
0 0 17 3 6 #") xs))"
0 0 17 3 3 #") ("
0 0 17 3 1 #"*"
0 0 17 3 1 #" "
0 0 17 3 10 #"x x)) xs))"
0 0 22 29 1 #"\n"
0 0 17 3 19 #"; ("
0 0 17 3 5 #"apply"
@ -15001,38 +14866,14 @@
0 0 17 3 1 #" "
0 0 17 3 1 #"x"
0 0 17 3 1 #" "
0 0 17 3 1 #"x"
0 0 17 3 7 #")) xs))"
0 0 22 29 1 #"\n"
0 0 17 3 19 #"; ("
0 0 17 3 5 #"apply"
0 0 17 3 1 #" "
0 0 17 3 13 #"column-vector"
0 0 17 3 2 #" ("
0 0 17 3 3 #"map"
0 0 17 3 2 #" ("
0 0 17 3 2 #"\316\273"
0 0 17 3 2 #" ("
0 0 17 3 1 #"x"
0 0 17 3 3 #") ("
0 0 17 3 1 #"*"
0 0 17 3 1 #" "
0 0 17 3 1 #"x"
0 0 17 3 1 #" "
0 0 17 3 1 #"x"
0 0 17 3 1 #" "
0 0 17 3 1 #"x"
0 0 17 3 10 #")) xs)))))"
0 0 17 3 13 #"x x)) xs)))))"
0 0 22 29 1 #"\n"
0 0 17 3 3 #"; ("
0 0 17 3 13 #"define-values"
0 0 17 3 2 #" ("
0 0 17 3 1 #"Q"
0 0 17 3 1 #" "
0 0 17 3 1 #"R"
0 0 17 3 3 #") ("
0 0 17 3 9 #"matrix-QR"
0 0 17 3 4 #" A))"
0 0 17 3 17 #"R) (matrix-QR A))"
0 0 22 29 1 #"\n"
0 0 22 29 1 #"\n"
0 0

View File

@ -1,3 +1,7 @@
The epsilon algorithm and related topics
by P.R. Graves-Morrisa, D.E. Robertsb, A. Salamc
http://www.sciencedirect.com/science/article/pii/S0377042700003551
COMPUTER ALGEBRA Algorithms Systems and Applications
by Richard Liska, Ladislav Drska, Jiri Limpouch, Milan Sinor, Michael Wester, Franz Winkler
http://inst.cs.berkeley.edu/~cs282/sp02/readings/liska.pdf