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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// TODO: Allow explicit returns in a more fine-grained way.
extern crate test;
const MAX_PROBABILISTIC_REPETITIONS: usize = 30;
const DEFAULT_PROBABILISTIC_REPETITIONS: usize = 30;
const RANDOM_TEST_INSTANCE_COUNT: usize = 10;
/// Contains [`unstable_sealed::UnstableSealed`] to mark a trait "sealed" on stable.
/// Contains [`computation::ComputationController`] to observe long-running computations.
/// Contains the core traits of the library - [`ring::RingBase`] and [`ring::RingStore`].
/// A collection of all number-theoretic algorithms that are currently implemented in
/// this crate.
/// Contains the trait [`delegate::DelegateRing`] that simplifies implementing the
/// newtype-pattern for rings.
/// Contains the trait [`divisibility::DivisibilityRing`] for rings that provide information
/// about divisibility of their elements.
/// Contains the trait [`field::Field`] for rings that are fields.
/// Contains the traits [`group::AbelianGroupBase`] and [`group::AbelianGroupStore`], which (in
/// analogue to [`ring::RingBase`] and [`ring::RingStore`]) model groups. These are much less
/// central to this library than the ring traits, however.
/// Contains the trait [`homomorphism::Homomorphism`], [`homomorphism::CanHomFrom`] and
/// others that are the foundation of the homomorphism framework, that enables mapping
/// elements between different rings.
/// Contains the trait [`integer::IntegerRing`] for rings that represent the ring of integers `Z`.
/// Contains implementations of various iterators and combinators, like [`iters::powerset()`]
/// or [`iters::multi_cartesian_product`].
/// Contains the trait [`local::PrincipalLocalRing`] for principal ideal rings that additionally are
/// local, i.e. they have a unique maximal ideal (which then is generated by a single element).
/// Contains the core of `feanor-math`'s (currently) minimalistic approach to matrices. In
/// particular, we use [`matrix::Submatrix`] and [`matrix::SubmatrixMut`] for matrices that don't
/// own their data.
/// Contains the trait [`ordered::OrderedRing`] for rings with a total ordering that is compatible
/// with the ring operations.
/// Contains the trait [`pid::PrincipalIdealRing`] for rings in whom every ideal is principal.
/// Also contains [`pid::EuclideanRing`], which is the simplest way how a ring can become a
/// principal idea ring.
/// Provides the ring implementation [`primitive_int::StaticRing`] that represents the integer ring
/// with arithmetic given by the primitive integer types ``i8` to `i128`.
/// Contains the two traits [`reduce_lift::poly_eval::EvalPolyLocallyRing`] and
/// [`reduce_lift::poly_factor_gcd::PolyGCDLocallyDomain`] that formalize the assumptions required
/// to perform certain computations over a ring modulo prime ideals, and then reconstruct the
/// element from the resulting congruences.
/// A collection of various more complicated ring traits and implementations, in particular
/// arbitrary-precision integer rings, the integer quotients `Z/nZ` or polynomial rings.
/// Contains different traits for sequences of elements, namely [`seq::VectorView`] and
/// [`seq::VectorFn`]. They all have some functional overlap with [`ExactSizeIterator`], but differ
/// in how they allow access to the elements of the sequence.
/// Contains the trait [`serialization::SerializableElementRing`] for rings whose elements can be
/// serialized by using `serde`.
///
/// It also contains some utilities to simplify this, since it is usually not possible to use
/// `#[derive(Serialize, Deserialize)]` to implement serialization - the reason is that
/// serialization and deserialization usually require access to the ring. Hence, we need to use
/// [`serde::de::DeserializeSeed`], but this is incompatible with `#[derive]`
/// Contains a workaround for specialization.
/// Ccontains the struct [`wrapper::RingElementWrapper`] that contains an element together with its
/// ring, and thus can provide ring operations without explicit access to the ring.
///
/// Using this is for example necessary if you want to use elements of a
/// [`crate::ring::HashableElRing`]-ring as elements in a [`std::collections::HashSet`].
/// ```rust
/// # use feanor_math::ring::*;
/// # use feanor_math::homomorphism::*;
/// # use feanor_math::wrapper::*;
/// # use feanor_math::integer::*;
/// # use std::collections::HashSet;
///
/// let mut set = HashSet::new();
/// set.insert(RingElementWrapper::new(
/// BigIntRing::RING,
/// BigIntRing::RING.int_hom().map(3),
/// ));
/// assert!(set.contains(&RingElementWrapper::new(
/// BigIntRing::RING,
/// BigIntRing::RING.int_hom().map(3)
/// )));
/// ```