Module malachite_base::unions::exhaustive
source · Expand description
Iterators that generate unions without repetition.
§lex_union2s
use itertools::Itertools;
use malachite_base::bools::exhaustive::exhaustive_bools;
use malachite_base::unions::exhaustive::lex_union2s;
use malachite_base::unions::Union2;
let u2s = lex_union2s(exhaustive_bools(), 0..4).collect_vec();
assert_eq!(
u2s.as_slice(),
&[
Union2::A(false),
Union2::A(true),
Union2::B(0),
Union2::B(1),
Union2::B(2),
Union2::B(3)
]
);
§exhaustive_union2s
use itertools::Itertools;
use malachite_base::bools::exhaustive::exhaustive_bools;
use malachite_base::unions::exhaustive::exhaustive_union2s;
use malachite_base::unions::Union2;
let u2s = exhaustive_union2s(exhaustive_bools(), 0..4).collect_vec();
assert_eq!(
u2s.as_slice(),
&[
Union2::A(false),
Union2::B(0),
Union2::A(true),
Union2::B(1),
Union2::B(2),
Union2::B(3)
]
);
Structs§
- This documentation applies not only to
ExhaustiveUnion2s
, but also toExhaustiveUnion3s
,ExhaustiveUnion4s
, and so on. Seeexhaustive_unions
for more information. - This documentation applies not only to
LexUnion2s
, but also toLexUnion3s
,LexUnion4s
, and so on. Seeexhaustive_unions
for more information.
Functions§
- This documentation applies not only to
exhaustive_union2s
, but also toexhaustive_union3s
,exhaustive_union4s
, and so on. Seeexhaustive_unions
for more information. - This documentation applies not only to
lex_union2s
, but also tolex_union3s
,lex_union4s
, and so on. Seeexhaustive_unions
for more information.