1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright © 2026 Mikhail Hogrefe
//
// This file is part of Malachite.
//
// Malachite is free software: you can redistribute it and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published by the Free Software Foundation; either version
// 3 of the License, or (at your option) any later version. See <https://www.gnu.org/licenses/>.
/// Implementations of [`EntrywiseMax`](malachite_base::num::arithmetic::traits::EntrywiseMax) and
/// [`EntrywiseMaxAssign`](malachite_base::num::arithmetic::traits::EntrywiseMaxAssign), which take
/// the larger of each pair of corresponding elements of two vectors.
/// Implementations of [`EntrywiseMin`](malachite_base::num::arithmetic::traits::EntrywiseMin) and
/// [`EntrywiseMinAssign`](malachite_base::num::arithmetic::traits::EntrywiseMinAssign), which take
/// the smaller of each pair of corresponding elements of two vectors.
/// Equality of [`NaturalVector`](super::NaturalVector)s and
/// [`UnsignedVector`](malachite_base::unsigned_vector::UnsignedVector)s.
///
/// # partial_eq
/// ```
/// use core::str::FromStr;
/// use malachite_base::unsigned_vector::UnsignedVector;
/// use malachite_nz::natural_vector::NaturalVector;
///
/// assert!(
/// NaturalVector::from_str("()").unwrap() == UnsignedVector::<u8>::from_str("()").unwrap()
/// );
/// assert!(
/// NaturalVector::from_str("(3, 255)").unwrap()
/// == UnsignedVector::<u8>::from_str("(3, 255)").unwrap()
/// );
/// assert!(
/// NaturalVector::from_str("(3, 256)").unwrap()
/// != UnsignedVector::<u8>::from_str("(3, 0)").unwrap()
/// );
/// assert!(
/// NaturalVector::from_str("(1, 0)").unwrap()
/// != UnsignedVector::<u32>::from_str("(1)").unwrap()
/// );
///
/// assert!(
/// UnsignedVector::<u16>::from_str("(1, 2)").unwrap()
/// == NaturalVector::from_str("(1, 2)").unwrap()
/// );
/// assert!(
/// UnsignedVector::<u128>::from_str("(1, 2)").unwrap()
/// != NaturalVector::from_str("(2, 1)").unwrap()
/// );
/// ```
/// Implementations of [`Ord`] and [`PartialOrd`] for
/// [`ShortlexNaturalVector`](super::ShortlexNaturalVector) and
/// [`ShortlexNaturalVectorRef`](super::ShortlexNaturalVectorRef), comparing two vectors by
/// dimension and then lexicographically.