Ruby implementation of multiset. Unlike ordinary set(see Ruby documentation for "set" library), multiset can contain two or more same items.
Set[:a,:b,:c,:b,:b,:c] => #<Set: {:b, :c, :a}>
Multiset[:a,:b,:c,:b,:b,:c] => #<Multiset:#3 :b, #2 :c, #1 :a>
Multiset#map, Multiset#map_with, and so on are added. Be careful that new Multiset#map is NOT equal to conventional Multiset#map(=Enumerable#map)!!
Multiset#classify and Multiset#classify_with returns an instance of Multimap.
The library is available via Rubygems. Use the command
gem install multiset
.gem file is available at http://rubygems.org/gems/multiset.
[Old versions]
*This program is distributed under MIT License (0.3.* or after) / BSD license (0.2.* or before).
[Reverse reference] (Added on 2008/3/1)
email to main(at-mark)hhiro.net .