- Require ruby >= 2.0.0.
- Switched to using
require_relative
to improve load-times. - Added
# frozen_string_literal: true
to all files.
- Fixed a bug in {Combinatorics::Choose.cardinality} for when
0
is given and0
was returned instead of1
.
- Fixed a typo in the gemspec, which incorrectly set
required_rubygems_version
to the same value asrequired_ruby_version
.
- Avoid warnings on JRuby by checking for
::Generator
before::Enumerator::Generator
incombinatorics/generator
. - Raise a
NameError
when theGenerator
class cannot be found incombinatorics/generator
. - Replaced ore-tasks with rubygems-tasks.
- Fixed a typo in the gemspec.
- Added {Math.sigma}.
- Added {Math.pi}.
- Added {Math.factorial}.
- Added {Math.subfactorial}.
- Added {Combinatorics::CartesianProduct}.
- Added {Combinatorics::Choose}.
- Added {Combinatorics::Derange}.
- Added {Combinatorics::Permute}.
- Added {Combinatorics::PowerSet}.
- Do not call
enum_for
onEnumerator
objects passed to {Array#comprehension}. - Improved {Array#comprehension} benchmarks.
- Added [benchmark results] (see {file:Benchmarks.md}).
-
Added {Combinatorics::Generator} which auto-detects the
Generator
class. -
Added {Combinatorics::Enumerator} which auto-detects the
Enumerator
class. -
Better detection of when enumerable values passed to {Array#comprehension} reach their last value. This allows using
Generator
objects that yield different values for each cycle:multiplier = 0 gen = Generator.new { |g| multiplier += 1 5.times { |i| g.yield (i * multiplier) } } [[1,2], gen].comprehension.to_a # => [[1,0],[1,1],[1,2],[1,3],[1,4],[2,0],[2,2],[2,4],[2,6],[2,8]]
-
Added a benchmark for {Array#comprehension} (see the benchmarks directory).
- Added {Range#&}.
- Added {Range#upto}.
- Added {Range#downto}.
- Initial release:
- Adds
powerset
to {Array} and {Set}. - Adds Haskell/Python style list comprehensions via {Array#comprehension}.
- Adds