1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
| | commit 9920bf86604b536c735b6478488a3cb89413e000
Author: Guillaume Le Vaillant <glv@posteo.net>
Date: Tue Dec 1 09:38:41 2020 +0100
Fix some type declarations
This allows compiling with SBCL 2.0.11 which is less tolerant with wrong type
declarations.
diff --git a/som/src/lvq_pak.lisp b/som/src/lvq_pak.lisp
index 1a062cc..4006ed6 100644
--- a/som/src/lvq_pak.lisp
+++ b/som/src/lvq_pak.lisp
@@ -53,7 +53,7 @@
(current :accessor entries-current :initarg :current :initform 0
:documentation "index of current data-entry inside data-entries")
(entries :accessor entries-entries :initarg :entries :initform nil
- :type #-ccl cons #+ccl list
+ :type #-ccl (or null cons) #+ccl list
:documentation "list of data-entries")
(num-loaded :accessor entries-num-loaded :initarg :num-loaded :initform nil
:documentation "number of lines loaded in entries list")
diff --git a/statistics/src/rand/rand.lisp b/statistics/src/rand/rand.lisp
index 3cd806a..c8f9952 100644
--- a/statistics/src/rand/rand.lisp
+++ b/statistics/src/rand/rand.lisp
@@ -154,7 +154,7 @@
(xn (make-array (1+ n) :element-type 'double-float)))
(declare (type double-float r v d)
(type fixnum k n n-minus-1)
- (type (vector double-float *) xn))
+ (type (simple-array double-float (*)) xn))
;; build xn
(setf (aref xn n) (* v (exp (/ (* r r) 2))))
(setf (aref xn (1- n)) r)
@@ -233,8 +233,8 @@
(base (expt 2 (- +bit-operation-m+ k 1))))
(declare (type double-float r v d)
(type fixnum k n n-minus-1 base)
- (type (vector double-float *) wn fn)
- (type (vector fixnum *) kn))
+ (type (simple-array double-float (*)) wn fn)
+ (type (simple-array fixnum (*)) kn))
;; build arrays
(setf (aref wn (- n 1)) (/ (* v (exp (/ (* r r) 2))) base))
(setf (aref wn (- n 2)) (/ r base))
@@ -347,8 +347,8 @@
(base (expt 2 (- +bit-operation-m+ k))))
(declare (type double-float r v d)
(type fixnum k n n-minus-1 base)
- (type (vector double-float *) wn fn)
- (type (vector fixnum *) kn))
+ (type (simple-array double-float (*)) wn fn)
+ (type (simple-array fixnum (*)) kn))
;; build arrays
(setf (aref wn (- n 1)) (/ (* v (exp (/ (* r r) 2))) base))
(setf (aref wn (- n 2)) (/ r base))
@@ -546,8 +546,8 @@
(base (expt 2 (- +bit-operation-m+ k 1))))
(declare (type double-float r v tr1 tr2)
(type fixnum k n n-minus-1 base)
- (type (vector double-float *) wn fn)
- (type (vector fixnum *) kn))
+ (type (simple-array double-float (*)) wn fn)
+ (type (simple-array fixnum (*)) kn))
;; build arrays
(setf (aref wn (- n 1)) (/ (* v (+ 1 (* r r))) base))
(setf (aref wn (- n 2)) (/ r base))
@@ -663,8 +663,8 @@
(base (expt 2 (- +bit-operation-m+ k))))
(declare (type double-float r v)
(type fixnum k n n-minus-1 base)
- (type (vector double-float *) wn fn)
- (type (vector fixnum *) kn))
+ (type (simple-array double-float (*)) wn fn)
+ (type (simple-array fixnum (*)) kn))
;; build arrays
(setf (aref wn (- n 1)) (/ (* v (exp r)) base))
(setf (aref wn (- n 2)) (/ r base))
@@ -804,8 +804,8 @@
(base (expt 2 (- +bit-operation-m+ k 1))))
(declare (type double-float r v)
(type fixnum k n n-minus-1 base)
- (type (vector double-float *) wn fn)
- (type (vector fixnum *) kn))
+ (type (simple-array double-float (*)) wn fn)
+ (type (simple-array fixnum (*)) kn))
;; build arrays
(setf (aref wn (- n 1)) (/ (* v (exp r)) base))
(setf (aref wn (- n 2)) (/ r base))
@@ -2083,8 +2083,8 @@
(base (expt 2 (- +bit-operation-m+ k 1))))
(declare (type double-float r v tr)
(type fixnum k n n-minus-1 base)
- (type (vector double-float *) wn fn)
- (type (vector fixnum *) kn))
+ (type (simple-array double-float (*)) wn fn)
+ (type (simple-array fixnum (*)) kn))
;; build arrays
(setf (aref wn (- n 1)) (/ (* (expt (+ 1d0 tr) 2) v) tr base))
(setf (aref wn (- n 2)) (/ r base))
@@ -2383,7 +2383,7 @@
ans)))
(declare (type double-float s a d)
(type vector tix)
- (type (vector fixnum *) si))
+ (type (simple-array fixnum (*)) si))
(values tix si)))
(defun binomial-table-lookup (tix si)
@@ -2415,7 +2415,7 @@
(b (expt 2 k)))
(declare (type double-float s a)
(type fixnum nsq k b)
- (type (vector double-float *) pbins))
+ (type (simple-array double-float (*)) pbins))
;; build pbins
(setf (aref pbins 0) (int-power (- 1d0 probability) size))
(loop for i from 1 to size do
@@ -2438,7 +2438,7 @@
do (incf j tx)) :initial-element -1 :element-type 'fixnum))
(thetan 0d0))
(declare (type double-float w thetan)
- (type (vector fixnum *) table))
+ (type (simple-array fixnum (*)) table))
(loop with j = 0
for x from 0
for pbin across pbins
@@ -2454,8 +2454,8 @@
(vi (make-array nsq :element-type 'double-float
:initial-contents (loop for i from 0 to size collect (dfloat (/ (+ i 1) nsq)))))
(c (dfloat (/ nsq))))
- (declare (type (vector fixnum *) ki)
- (type (vector double-float *) vi)
+ (declare (type (simple-array fixnum (*)) ki)
+ (type (simple-array double-float (*)) vi)
(type double-float c))
(loop repeat size do
(let ((maxp 0)
@@ -2658,7 +2658,7 @@
(thetan 0d0)
(sum 0d0))
(declare (type double-float w thetan sum)
- (type (vector fixnum *) table))
+ (type (simple-array fixnum (*)) table))
(loop with j = 0
for x from 0
for pgeo across pgeos
@@ -2675,8 +2675,8 @@
(vi (make-array nsq :element-type 'double-float
:initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
(c (dfloat (/ nsq))))
- (declare (type (vector fixnum *) ki)
- (type (vector double-float *) vi)
+ (declare (type (simple-array fixnum (*)) ki)
+ (type (simple-array double-float (*)) vi)
(type double-float c))
(loop repeat (1- nsq) do
(let ((maxp 0)
@@ -2911,7 +2911,7 @@
(sum 0d0))
(declare (type double-float w thetan sum pl pu)
(type fixnum nsq d)
- (type (vector fixnum *) table))
+ (type (simple-array fixnum (*)) table))
(unless (= xl 0)
(setf pps (subseq pps xl)))
(loop with j = 0
@@ -2930,8 +2930,8 @@
(vi (make-array nsq :element-type 'double-float
:initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
(c (dfloat (/ nsq))))
- (declare (type (vector fixnum *) ki)
- (type (vector double-float *) vi)
+ (declare (type (simple-array fixnum (*)) ki)
+ (type (simple-array double-float (*)) vi)
(type double-float c))
(loop repeat (1- nsq) do
(let ((maxp 0)
@@ -3174,7 +3174,7 @@
(k 7)
(b (expt 2 k)))
(declare (type fixnum a1 a2 nsq k b)
- (type (vector double-float *) phs))
+ (type (simple-array double-float (*)) phs))
;; build phs
(setf (aref phs 0)
(/ (dfloat (the fixnum (* (combination successes a1) (combination (- elements successes) (- samples a1)))))
@@ -3200,7 +3200,7 @@
(table (make-array b :initial-element -1 :element-type 'fixnum))
(thetan 0d0))
(declare (type double-float w thetan)
- (type (vector fixnum *) table))
+ (type (simple-array fixnum (*)) table))
(loop with j = 0
for x from a1
for i from 0
@@ -3217,8 +3217,8 @@
(vi (make-array nsq :element-type 'double-float
:initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
(c (dfloat (/ nsq))))
- (declare (type (vector fixnum *) ki)
- (type (vector double-float *) vi)
+ (declare (type (simple-array fixnum (*)) ki)
+ (type (simple-array double-float (*)) vi)
(type double-float c))
(loop repeat (1- nsq) do
(let ((maxp 0)
@@ -3442,7 +3442,7 @@
(sum 0d0))
(declare (type double-float w thetan sum pl pu)
(type fixnum nsq d)
- (type (vector fixnum *) table))
+ (type (simple-array fixnum (*)) table))
(unless (= xl 0)
(setf pnbs (subseq pnbs xl)))
(loop with j = 0
@@ -3461,8 +3461,8 @@
(vi (make-array nsq :element-type 'double-float
:initial-contents (loop for i from 0 below nsq collect (dfloat (/ (+ i 1) nsq)))))
(c (dfloat (/ nsq))))
- (declare (type (vector fixnum *) ki)
- (type (vector double-float *) vi)
+ (declare (type (simple-array fixnum (*)) ki)
+ (type (simple-array double-float (*)) vi)
(type double-float c))
(loop repeat (1- nsq) do
(let ((maxp 0)
diff --git a/time-series/src/ts-read-data.lisp b/time-series/src/ts-read-data.lisp
index 09ad933..a692514 100644
--- a/time-series/src/ts-read-data.lisp
+++ b/time-series/src/ts-read-data.lisp
@@ -5,7 +5,7 @@
((frequency :initarg :frequency
:accessor ts-freq
:initform nil
- :type number)
+ :type (or null number))
(start :initarg :start :accessor ts-start :initform nil)
(end :initarg :end :accessor ts-end :initform nil)
(ts-type :initarg :ts-type :accessor ts-type :initform nil)
diff --git a/time-series/src/ts-state-space-model.lisp b/time-series/src/ts-state-space-model.lisp
index 4dbf56a..ad9e5cc 100644
--- a/time-series/src/ts-state-space-model.lisp
+++ b/time-series/src/ts-state-space-model.lisp
@@ -348,8 +348,8 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(eval-when (:execute :compile-toplevel :load-toplevel)
(defclass trend-model (gaussian-stsp-model)
- ((diff-k :initarg :diff-k :initform nil :type integer :accessor diff-k)
- (tau^2 :initarg :tau^2 :initform nil :type number :accessor tau^2)
+ ((diff-k :initarg :diff-k :initform nil :type (or null integer) :accessor diff-k)
+ (tau^2 :initarg :tau^2 :initform nil :type (or null number) :accessor tau^2)
(aic :initarg :aic :initform +nan+ :type number))
(:documentation "- parent: gaussian-stsp-model
- accessors:
@@ -492,9 +492,9 @@
; seasonal model ;
;;;;;;;;;;;;;;;;;;
(defclass seasonal-model (gaussian-stsp-model)
- ((s-deg :initarg :s-deg :initform nil :type fixnum :accessor s-deg)
- (s-freq :initarg :s-freq :initform nil :type fixnum :accessor s-freq)
- (tau^2 :initarg :tau^2 :initform nil :type number :accessor tau^2))
+ ((s-deg :initarg :s-deg :initform nil :type (or null fixnum) :accessor s-deg)
+ (s-freq :initarg :s-freq :initform nil :type (or null fixnum) :accessor s-freq)
+ (tau^2 :initarg :tau^2 :initform nil :type (or null number) :accessor tau^2))
(:documentation "- parent: gaussian-stsp-model
- accessors
- s-deg : Degree for seasonal model
@@ -593,8 +593,8 @@
; seasonal-adjustment-model ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass seasonal-adjustment-model (gaussian-stsp-model)
- ((trend :initarg :trend :initform nil :type trend-model :accessor trend-model)
- (seasonal :initarg :seasonal :initform nil :type seasonal-model :accessor seasonal-model))
+ ((trend :initarg :trend :initform nil :type (or null trend-model) :accessor trend-model)
+ (seasonal :initarg :seasonal :initform nil :type (or null seasonal-model) :accessor seasonal-model))
(:documentation "Standard seasonal adjustment model ( Trend + Seasonal )
- parent: gaussian-stsp-model
- accessors
|