Empirical
Classes | Namespaces
combos.h File Reference

Tools to step through combinations of items. More...

#include <iostream>
#include "../base/assert.h"
#include "../base/vector.h"

Go to the source code of this file.

Classes

class  emp::ComboIDs
 

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 

Detailed Description

Tools to step through combinations of items.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2017

Step through all combinations of size K from a set of N values. For ComboIDs just return the indecies (the specific of the container don't matter). Other versions will directly wrapper containers.

Todo:

Allow a minimum and maximum combo size, not just a fixed combo size. If no sizes are specifed, all sizes should be explored (all possible combinations).

Create a ComboGenerator template to take a container and generate all combinations

Create a combos function that will build a ComboGenerator for the container type passed in.