#include <SequentialPartitionGenerator.h>
Public Types | |
typedef std::vector< int > | Partition |
Public Member Functions | |
Partition | next_partition () |
SequentialPartitionGenerator (int n, int k, int pmin=1) | |
SequentialPartitionGenerator (int n, int k, int pmin, int pmax) | |
Private Member Functions | |
bool | first_part (Partition &p, int k, int n, int pmin, int pmax) const |
bool | next_part (Partition &p) const |
Private Attributes | |
int | n_first |
int | n_next |
int | the_k |
int | the_n |
Partition | the_part |
int | the_pmax |
int | the_pmin |
Class to compute partitions of size k of an integer n.
Definition at line 10 of file SequentialPartitionGenerator.h.
typedef std::vector<int> SequentialPartitionGenerator::Partition |
Definition at line 12 of file SequentialPartitionGenerator.h.
SequentialPartitionGenerator::SequentialPartitionGenerator | ( | int | n, |
int | k, | ||
int | pmin = 1 |
||
) |
Definition at line 3 of file SequentialPartitionGenerator.cc.
SequentialPartitionGenerator::SequentialPartitionGenerator | ( | int | n, |
int | k, | ||
int | pmin, | ||
int | pmax | ||
) |
Definition at line 6 of file SequentialPartitionGenerator.cc.
|
private |
Definition at line 20 of file SequentialPartitionGenerator.cc.
References popcon2dropbox::copy(), first_part(), i, min(), n_first, and createTree::pp.
Referenced by first_part(), and next_part().
|
private |
Definition at line 46 of file SequentialPartitionGenerator.cc.
References popcon2dropbox::copy(), first_part(), i, gen::k, gen::n, n_next, createTree::pp, the_k, the_n, the_pmax, and the_pmin.
Referenced by next_partition().
SequentialPartitionGenerator::Partition SequentialPartitionGenerator::next_partition | ( | ) |
Get the next partition, in a well-defined series of partition
Definition at line 9 of file SequentialPartitionGenerator.cc.
References relativeConstraints::empty, next_part(), and the_part.
|
mutableprivate |
Definition at line 34 of file SequentialPartitionGenerator.h.
Referenced by first_part().
|
mutableprivate |
Definition at line 35 of file SequentialPartitionGenerator.h.
Referenced by next_part().
|
private |
Definition at line 30 of file SequentialPartitionGenerator.h.
Referenced by next_part().
|
private |
Definition at line 29 of file SequentialPartitionGenerator.h.
Referenced by next_part().
|
private |
Definition at line 33 of file SequentialPartitionGenerator.h.
Referenced by next_partition().
|
private |
Definition at line 32 of file SequentialPartitionGenerator.h.
Referenced by next_part().
|
private |
Definition at line 31 of file SequentialPartitionGenerator.h.
Referenced by next_part().