Changeset 4267
 Timestamp:
 10/09/03 16:51:08 (19 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/j/src/org/armedbear/lisp/bitarrayops.lisp
r4265 r4267 2 2 ;;; 3 3 ;;; Copyright (C) 2003 Peter Graves 4 ;;; $Id: bitarrayops.lisp,v 1. 1 20031009 16:41:53piso Exp $4 ;;; $Id: bitarrayops.lisp,v 1.2 20031009 16:51:08 piso Exp $ 5 5 ;;; 6 6 ;;; This program is free software; you can redistribute it and/or … … 56 56 (error 'programerror "~S and ~S do not have the same dimensions" 57 57 bitarray1 bitarray2)) 58 (let* ((resultbitarray (pickresultarray resultbitarray bitarray1)) 59 (end3 (arraytotalsize resultbitarray))) 60 (do ((index1 0 (1+ index1)) 61 (index2 0 (1+ index2)) 62 (index3 0 (1+ index3))) 63 ((>= index3 end3) resultbitarray) 64 (setf (rowmajoraref resultbitarray index3) 65 (logand (,function (rowmajoraref bitarray1 index1) 66 (rowmajoraref bitarray2 index2)) 58 (let ((resultbitarray (pickresultarray resultbitarray bitarray1))) 59 (dotimes (i (arraytotalsize resultbitarray) resultbitarray) 60 (setf (rowmajoraref resultbitarray i) 61 (logand (,function (rowmajoraref bitarray1 i) 62 (rowmajoraref bitarray2 i)) 67 63 1)))))) 68 64 69 (defbitarrayop bitand logand)70 (defbitarrayop bitior logior)71 (defbitarrayop bitxor logxor)72 (defbitarrayop biteqv logeqv)73 (defbitarrayop bitnand lognand)74 (defbitarrayop bitnor lognor)65 (defbitarrayop bitand logand) 66 (defbitarrayop bitior logior) 67 (defbitarrayop bitxor logxor) 68 (defbitarrayop biteqv logeqv) 69 (defbitarrayop bitnand lognand) 70 (defbitarrayop bitnor lognor) 75 71 (defbitarrayop bitandc1 logandc1) 76 72 (defbitarrayop bitandc2 logandc2) 77 (defbitarrayop bitorc1 logorc1)78 (defbitarrayop bitorc2 logorc2)73 (defbitarrayop bitorc1 logorc1) 74 (defbitarrayop bitorc2 logorc2) 79 75 80 76 (defun bitnot (bitarray &optional resultbitarray) … … 83 79 BITARRAY is used. If RESULTBITARRAY is NIL or omitted, a new array is 84 80 created. Both arrays must have the same rank and dimensions." 85 (let* ((resultbitarray (pickresultarray resultbitarray bitarray)) 86 (dstend (arraytotalsize resultbitarray))) 87 (do ((srcindex 0 (1+ srcindex)) 88 (dstindex 0 (1+ dstindex))) 89 ((>= dstindex dstend) resultbitarray) 90 (setf (rowmajoraref resultbitarray dstindex) 91 (logxor (rowmajoraref bitarray srcindex) 1))))) 81 (let ((resultbitarray (pickresultarray resultbitarray bitarray))) 82 (dotimes (i (arraytotalsize resultbitarray) resultbitarray) 83 (setf (rowmajoraref resultbitarray i) 84 (logxor (rowmajoraref bitarray i) 1)))))
Note: See TracChangeset
for help on using the changeset viewer.