(funcall test tree bitvector)))
(defun check-equivalency (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop
for start = 0 then (1+ x)
for x = (position 1 bitvector :start start)
finally (return t)))
(defun check-selection (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(unless (zerop (trees:size tree))
(loop for start = 0 then (1+ x)
for x = (position 1 bitvector :start start)
finally (return t))))
(defun check-forward-position-t (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop for start = 0 then (1+ x)
for x = (position 1 bitvector :start start)
for i from 0
finally (return t)))
(defun check-forward-position-nil (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop for start = 0 then (1+ x)
for x = (position 0 bitvector :start start)
while x
finally (return t)))
(defun check-backward-position-t (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop for end = nil then x
for x = (position 1 bitvector :from-end t :end end)
for i downfrom (1- (trees:size tree))
finally (return t)))
(defun check-backward-position-nil (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop for end = nil then x
for x = (position 0 bitvector :from-end t :end end)
while x
finally (return t)))
(defun check-forward-iteration (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop with iter = (trees::make-iterator tree :forwardp t)
for start = 0 then (1+ x)
for x = (position 1 bitvector :start start)
finally (return t)))
(defun check-backward-iteration (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop with iter = (trees::make-iterator tree :forwardp nil)
for end = nil then y
for y = (position 1 bitvector :from-end t :end end)
finally (return t)))
(defun check-dotree (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(let ((new (bit-xor bitvector bitvector)))
(trees:dotree (x tree)
(setf (aref new x) 1))
t))
(defun check-reduce (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop with tree-sum = (trees:reduce tree #'+)
for start = 0 then (1+ x)
for x = (position 1 bitvector :start start)
(return t)))
(defun check-reduce-from-end (tree bitvector)
+ (declare (type simple-bit-vector bitvector))
(loop with tree-diff = (trees:reduce tree #'- :initial-value 0 :from-end t)
for start = 0 then (1+ x)
for x = (position 1 bitvector :start start)