Function malachite_base::tuples::exhaustive::lex_pairs
source · pub const fn lex_pairs<X: Clone, I: Iterator<Item = X>, Y: Clone, J: Iterator<Item = Y>>(
xs: I,
ys: J,
) -> LexPairs<X, I, Y, J> ⓘ
Expand description
This documentation applies not only to lex_pairs
, but also to lex_triples
,
lex_quadruples
, and so on. See lex_tuples
for more information.
Generates all $n$-tuples with elements from $n$ iterators, in lexicographic order.
The order is lexicographic with respect to the order of the element iterators.
All of ys
, zs
, … (but not necessarily xs
) must be finite. If xs
is finite, the
output length is the product of the lengths of all the input iterators. If xs
is
infinite, the output is also infinite.
If any of xs
, ys
, zs
, … is empty, the output is also empty.
§Examples
See here.