2017 © Pedro Peláez
 

library cartesian-product

Memory efficient Cartesian Product implementation

image

th3n3rd/cartesian-product

Memory efficient Cartesian Product implementation

  • Saturday, May 30, 2015
  • by th3n3rd
  • Repository
  • 1 Watchers
  • 7 Stars
  • 7,124 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 6 % Grown

The README.md

Cartesian Product

Latest Version Software License Build Status HHVM Status Total Downloads, (*1)

Memory efficient Cartesian Product implementation., (*2)

It uses iterators in order to store only a specific tuple at time being able to compute even large combinations without affecting the memory footprint., (*3)

Install

Via Composer, (*4)

``` bash $ composer require th3n3rd/cartesian-product, (*5)


## Usage ```php use Nerd\CartesianProduct\CartesianProduct; $cartesianProduct = new CartesianProduct(); $cartesianProduct ->appendSet(array('a', 'b', 'c')) ->appendSet(array('d', 'e')) ->appendSet(array('f', 'g', 'h')) ->appendSet(array('i', 'j')) ->appendSet(array('k', 'l')) ->appendSet(array('m', 'n')) ->appendSet(array('o')) ->appendSet(array('p')) ->appendSet(array('q', 'r', 's', 't')) ->appendSet(array('u', 'v', 'w')) ->appendSet(array('x', 'y')) ->appendSet(array('z')) ; foreach ($cartesianProduct as $index => $product) { printf("[%s] (%s)\n", $index, implode(',', $product)); } // or (not recommended) $result = $cartesianProduct->compute(); foreach ($result as $index => $product) { printf("[%s] (%s)\n", $index, implode(',', $product)); }

Testing

bash $ phpunit, (*6)

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

30/05 2015

dev-master

9999999-dev

Memory efficient Cartesian Product implementation

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Marco Garofalo

cartesian product

30/05 2015

v0.3.0

0.3.0.0

Memory efficient Cartesian Product implementation

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Marco Garofalo

cartesian product

30/05 2015

v0.2.0

0.2.0.0

Memory efficient Cartesian Product implementation

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Marco Garofalo

cartesian product

18/04 2015

v0.1.0

0.1.0.0

Memory efficient Cartesian Product implementation

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Marco Garofalo