Home

Awesome

Last modified: 2013-10-09 20:48:28 tkych

Version: 0.1.01

cl-intset

cl-intset is a library for non-negative integer sets. It implements sets using bitsets.

Depends-on

Installation

  1. SHELL$ git clone https://github.com/tkych/cl-intset
  2. CL-REPL> (push #p"/path-to-cl-intset/cl-intset/" asdf:*central-registry*)
  3. CL-REPL> (ql:quickload :cl-intset) or (asdf:load-system :cl-intset)

Examples

intset and iset are nicknames of cl-intset package.

CL-REPL> (defvar iset1 (iset:make-intset))
ISET1

CL-REPL> (iset:intset->list iset1)
NIL

CL-REPL> (iset:insert 42 iset1)
#<CL-INTSET:INTSET {1007AC3EB3}>

CL-REPL> (iset:intset->list iset1)
(42)

CL-REPL> (dotimes (_ 10) (iset:insert 42 iset1))
NIL

CL-REPL> (iset:intset->list iset1)
(42)

CL-REPL> (defvar iset2 (iset:list->intset '(43 41 42 43 41 42)))
ISET2

CL-REPL> (iset:intset->list iset2)
(41 42 43)

CL-REPL> (iset:map 'iset:intset #'1+ iset2)
#<CL-INTSET:INTSET {1008049063}>

CL-REPL> (iset:map 'list #'1+ iset2)
(42 43 44)

Manual

[Type] INTSET

[Function] MAKE-INTSET => new-intset

[Function] INTSETP object => boolean

[Function] EMPTYP intset => boolean

[Function] SINGLETONP intset => boolean

[Function] COPY intset => new-intset

[Function] CLEAR intset => modified-intset

[Function] SIZE intset => non-negative-integer

[Function] MEMBERP non-negative-integer intset => boolean

[Function] SET-EQUAL intset1 intset2 => boolean

[Function] cl-intset:SUBSETP intset1 intset2 => boolean

[Function] PROPER-SUBSET-P intset1 intset2 => boolean

[Function] ADD non-negative-integer intset => new-intset

[Function] INSERT non-negative-integer intset => modified-intset

[Function] cl-intset:REMOVE non-negative-integer intset => new-intset

[Function] cl-intset:DELETE non-negative-integer intset => modified-intset

[Function] LIST->INTSET non-negative-integer-list => new-intset

[Function] INTSET->LIST intset &key desc? => non-negative-integer-list

[Function] cl-intset:INTERSECTION intset1 intset2 => new-intset

[Function] cl-intset:NINTERSECTION intset1 intset2 => modified-intset1

[Function] cl-intset:SET-DIFFERENCE intset1 intset2 => new-intset

[Function] cl-intset:NSET-DIFFERENCE intset1 intset2 => modified-intset1

[Function] cl-intset:UNION intset1 intset2 => new-intset

[Function] cl-intset:NUNION intset1 intset2 => modified-intset1

[Function] cl-intset:SET-EXCLUSIVE-OR intset1 intset2 => new-intset

[Function] cl-intset:NSET-EXCLUSIVE-OR intset1 intset2 => modified-intset1

[Function] cl-intset:RANDOM intset => non-negative-integer/null

[Function] cl-intset:MAP result-type function intset &key desc? => new-object

[Function] FOR-EACH function intset &key desc? => non-modified-intset

[Function] cl-intset:MAX intset => non-negative-integer/null

[Function] cl-intset:MIN intset => non-negative-integer/null

Author, License, Copyright