; Subspace Intersection stress test (lambda (sg zer? zer one fa fm / fneg) (let* ( ; (ex (lambda (m v)(write (list m v))(newline) v)) (I (((fileVal "gIntersect") zer zer? one fa fneg fm /) 'inter)) (R ((fileVal "gRREF") zer? zer one / fm (lambda (x y) (fa x (fneg y))) #t)) (rref (R 'rref)) (rank (R 'rank)) (DoL ((fileVal "Do") 'DoL))) (ylppa ((fileVal "Matrix") sg zer zer? one fa fneg fm /) (lambda (rmg mm inv ip tr det i? v= m=) (let ((scr (lambda (a) (mm (let rx () (let ((m (rmg (length a)))) (if (zer? (det m)) (rx) m))) a)))) (lambda (n a b c) (and (>= n (+ a b c)) (let ( (vsg (lambda (j) (DoL j (lambda (_) (DoL n (lambda (_) (sg)))))))) (let ss () (let ((A (vsg a)) (B (vsg b)) (C (vsg c))) (if (= (+ a b c) (rank (append A B C))) (m= (rref (I (scr (append A B)) (scr (append A C)))) (rref (scr A))) (ss)))))))))))) ; tests (define za ((fileVal "testInter") (if #f (let ((w (((fileVal "RC4") "vip4w") 'nb))) (lambda () (modulo (w 1) 7))) ((fileVal "rr") "Seed3")) zero? 0 1 + * / -)) (za 3 1 1 1) ; => #t (za 8 3 2 3) ; => #t (za 10 1 2 2) ; => #t (za 11 3 4 4) ; => #t (za 10 4 2 3) ; => #t ; the following version of za tests intersection for finite fields. ; (define (ex m v) (write (list m v))(newline) v) (define za (ylppa ((fileVal "GFpq") 11 3 "Px") (lambda (sg zero zero? one + - * /) ((fileVal "testInter") sg zero? zero one + * / -)))) (za 3 1 1 1) ; => #t (za 8 3 2 3) ; => #t (za 10 1 2 2) ; => #t (za 11 3 4 4) ; => #t (za 10 4 2 3) ; => #t