macro_rules! lex_ordered_unique_tuples { ( ($($vis:tt)*), $struct: ident, $k: expr, $out_t: ty, $fn: ident, [$($i: expr),*] ) => { ... }; }
Expand description
Defines lexicographic ordered unique tuple generators.
Malachite provides lex_ordered_unique_pairs
, but you can also define
lex_ordered_unique_triples
, lex_ordered_unique_quadruples
, and so on, in your program using
the code below. The documentation for lex_ordered_unique_pairs
describes these other
functions as well.
See usage examples here.
use malachite_base::iterators::iterator_cache::IteratorCache;
use malachite_base::lex_ordered_unique_tuples;
use malachite_base::vecs::exhaustive::fixed_length_ordered_unique_indices_helper;
use std::marker::PhantomData;
lex_ordered_unique_tuples!(
(pub(crate)),
LexOrderedUniqueTriples,
3,
(I::Item, I::Item, I::Item),
lex_ordered_unique_triples,
[0, 1, 2]
);
lex_ordered_unique_tuples!(
(pub(crate)),
LexOrderedUniqueQuadruples,
4,
(I::Item, I::Item, I::Item, I::Item),
lex_ordered_unique_quadruples,
[0, 1, 2, 3]
);
lex_ordered_unique_tuples!(
(pub(crate)),
LexOrderedUniqueQuintuples,
5,
(I::Item, I::Item, I::Item, I::Item, I::Item),
lex_ordered_unique_quintuples,
[0, 1, 2, 3, 4]
);
lex_ordered_unique_tuples!(
(pub(crate)),
LexOrderedUniqueSextuples,
6,
(I::Item, I::Item, I::Item, I::Item, I::Item, I::Item),
lex_ordered_unique_sextuples,
[0, 1, 2, 3, 4, 5]
);
lex_ordered_unique_tuples!(
(pub(crate)),
LexOrderedUniqueSeptuples,
7,
(
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item
),
lex_ordered_unique_septuples,
[0, 1, 2, 3, 4, 5, 6]
);
lex_ordered_unique_tuples!(
(pub(crate)),
LexOrderedUniqueOctuples,
8,
(
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item,
I::Item
),
lex_ordered_unique_octuples,
[0, 1, 2, 3, 4, 5, 6, 7]
);