File tree Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Expand file tree Collapse file tree 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 13
13
* avcodec\_ receive\_ frame
14
14
* avcodec\_ send\_ packet
15
15
* codec deprecated (ffmpeg.c: 271, 377, 417)
16
+ * Wayland support
16
17
* check new lintian tag required
17
18
* argmin, argmax
18
19
* argwhere (mask coordinates)
Original file line number Diff line number Diff line change 25
25
<hypercomplex<>>
26
26
<hypercomplex<float>> <meta<hypercomplex<float>>> <hypercomplex<float<single>>> <meta<hypercomplex<float<single>>>>
27
27
<hypercomplex<double>> <meta<hypercomplex<double>>> <hypercomplex<float<double>>> <meta<hypercomplex<float<double>>>>)
28
- #:re-export (real-part imag-part equal?))
28
+ #:re-export (real-part imag-part equal? + ))
29
29
30
30
31
31
(define-class <hypercomplex> ()
74
74
(hypercomplex (reduce coerce #f (cons b (base a)))))
75
75
(define-method (coerce (a <meta<scalar>>) (b <meta<hypercomplex<>>>))
76
76
(hypercomplex (reduce coerce #f (cons a (base b)))))
77
+
78
+ (define-method (+ (a <hypercomplex<>>) (b <hypercomplex<>>))
79
+ (hypercomplex (+ (real-part a) (real-part b))
80
+ (+ (imag-part a) (imag-part b))
81
+ (+ (jmag-part a) (jmag-part b))
82
+ (+ (kmag-part a) (kmag-part b))))
83
+ (define-method (+ (a <hypercomplex<>>) (b <complex<>>))
84
+ (hypercomplex (+ (real-part a) (real-part b)) (+ (imag-part a) (imag-part b)) (jmag-part a) (kmag-part a)))
85
+ (define-method (+ (a <complex<>>) (b <hypercomplex<>>))
86
+ (hypercomplex (+ (real-part a) (real-part b)) (+ (imag-part a) (imag-part b)) (jmag-part b) (kmag-part b)))
87
+ (define-method (+ (a <hypercomplex<>>) (b <scalar>))
88
+ (hypercomplex (+ (real-part a) b) (imag-part a) (jmag-part a) (kmag-part a)))
89
+ (define-method (+ (a <scalar>) (b <hypercomplex<>>))
90
+ (hypercomplex (+ a (real-part b)) (imag-part b) (jmag-part b) (kmag-part b)))
Original file line number Diff line number Diff line change 95
95
(test-eq " coerce real and hypercomplex type"
96
96
(hypercomplex <double>) (coerce <double> (hypercomplex <float>))))
97
97
98
+ (test-group " hypercomplex plus"
99
+ (test-equal " hypercomplex plus hypercomplex"
100
+ (make-hypercomplex 2.0 3.0 5.0 7.0 ) ((jit (list (hypercomplex <float>) (hypercomplex <float>)) +)
101
+ (make-hypercomplex 1 2 3 4 ) (make-hypercomplex 1 1 2 3 )))
102
+ (test-equal " hypercomplex plus complex"
103
+ (make-hypercomplex 2.0 3.0 5.0 7.0 ) ((jit (list (hypercomplex <float>) (complex <float>)) +)
104
+ (make-hypercomplex 1 2 5 7 ) 1+i))
105
+ (test-equal " complex plus hypercomplex"
106
+ (make-hypercomplex 2.0 3.0 5.0 7.0 ) ((jit (list (complex <float>) (hypercomplex <float>)) +)
107
+ 1+i (make-hypercomplex 1 2 5 7 )))
108
+ (test-equal " hypercomplex plus real"
109
+ (make-hypercomplex 2.0 3.0 5.0 7.0 ) ((jit (list (hypercomplex <float>) <float>) +)
110
+ (make-hypercomplex 1 3 5 7 ) 1 ))
111
+ (test-equal " real plus hypercomplex"
112
+ (make-hypercomplex 2.0 3.0 5.0 7.0 ) ((jit (list <float> (hypercomplex <float>)) +)
113
+ 1 (make-hypercomplex 1 3 5 7 ))))
114
+
98
115
(test-end " aiscm hypercomplex" )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ tmux select-pane -t0
5
5
tmux send-keys " make repl -j 4" C-m
6
6
tmux select-pane -t1
7
7
tmux send-keys " cd tests" C-m
8
- tmux send-keys " ./guard.sh core " C-m
8
+ tmux send-keys " ./guard.sh hypercomplex " C-m
9
9
tmux select-pane -t2
10
10
tmux send-keys " nvim" C-m
11
11
sleep 1
You can’t perform that action at this time.
0 commit comments