Advertisement
Guest User

Untitled

a guest
Feb 27th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. (defclass r-vector-sfp (generic-vector)
  2. ()
  3. (:default-initargs
  4. :segment-width 4
  5. :element-type 'single-float
  6. :initial-element 0.0)
  7. (:documentation "Vector with single-float elements"))
  8.  
  9. (defmethod initialize-instance :after ((vector r-vector-sfp) &key)
  10. (setf (slot-value vector 'segments)
  11. (map-into (make-array (number-of-segments vector))
  12. (lambda () (make-array (segment-width vector)
  13. :element-type (element-type vector)
  14. :initial-element (initial-element vector))))))
  15. ;;;
  16.  
  17. (defmethod (setf vref-seg) ((value single-float) (vector r-vector-sfp) &optional indexes)
  18. (declare
  19. (type (element-type vector) value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement