Macro malachite_base::lex_unique_tuples
source ยท macro_rules! lex_unique_tuples { ( ($($vis:tt)*), $struct: ident, $k: expr, $out_t: ty, $fn: ident, [$($i: expr),*] ) => { ... }; }
Expand description
Defines lexicographic unique tuple generators.
Malachite provides lex_unique_pairs
, but you can also define lex_unique_triples
,
lex_unique_quadruples
, and so on, in your program using the code below. The documentation for
lex_unique_pairs
describes these other functions as well.
See usage examples here.
use malachite_base::iterators::iterator_cache::IteratorCache;
use malachite_base::lex_unique_tuples;
use malachite_base::vecs::exhaustive::{unique_indices, UniqueIndices};
lex_unique_tuples!(
(pub(crate)),
LexUniqueTriples,
3,
(I::Item, I::Item, I::Item),
lex_unique_triples,
[0, 1, 2]
);
lex_unique_tuples!(
(pub(crate)),
LexUniqueQuadruples,
4,
(I::Item, I::Item, I::Item, I::Item),
lex_unique_quadruples,
[0, 1, 2, 3]
);
lex_unique_tuples!(
(pub(crate)),
LexUniqueQuintuples,
5,
(I::Item, I::Item, I::Item, I::Item, I::Item),
lex_unique_quintuples,
[0, 1, 2, 3, 4]
);
lex_unique_tuples!(
(pub(crate)),
LexUniqueSextuples,
6,
(I::Item, I::Item, I::Item, I::Item, I::Item, I::Item),
lex_unique_sextuples,
[0, 1, 2, 3, 4, 5]
);
lex_unique_tuples!(
(pub(crate)),
LexUniqueSeptuples,
7,
(
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item
),
lex_unique_septuples,
[0, 1, 2, 3, 4, 5, 6]
);
lex_unique_tuples!(
(pub(crate)),
LexUniqueOctuples,
8,
(
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item
),
lex_unique_octuples,
[0, 1, 2, 3, 4, 5, 6, 7]
);