21 template<
typename IntegerType>
23 bool operator()(
const std::pair<IntegerType, IntegerType>& p1,
const std::pair<IntegerType, IntegerType>& p2)
const {
24 return (p1.first < p2.first) || (p1.first == p2.first && p1.second < p2.second);
31 template<
typename IntegerType>
38 const IntegerType
mPK;
73 const IntegerType&
size() const noexcept {
77 IntegerType
modulo(
const IntegerType& n)
const {
94 return os <<
"GF(" << rhs.
mP <<
"^" << rhs.
mK <<
")";
98 template<
typename IntegerType>
114 assert(newit.second);
115 return newit.first->second.get();
117 return it->second.get();
carl is the main namespace for the library.
cln::cl_I mod(const cln::cl_I &a, const cln::cl_I &b)
Calculate the remainder of the integer division.
Interval< Number > pow(const Interval< Number > &i, Integer exp)
bool operator()(const std::pair< IntegerType, IntegerType > &p1, const std::pair< IntegerType, IntegerType > &p2) const
friend bool operator==(const GaloisField &lhs, const GaloisField &rhs)
IntegerType symmetric_modulo(const IntegerType &n) const
BaseIntType p() const noexcept
Returns the p from Z_{p^k}.
const IntegerType mMaxValue
const IntegerType & size() const noexcept
friend std::ostream & operator<<(std::ostream &os, const GaloisField &rhs)
BaseIntType k() const noexcept
Returns the k from Z_{p^k}.
const IntegerType mModulus
GaloisField(BaseIntType p, BaseIntType k=1)
Creating the field Z_{p^k}.
IntegerType modulo(const IntegerType &n) const
const GaloisField< IntegerType > * field(BaseIntType p, BaseIntType k=1)
typename GaloisField< IntegerType >::BaseIntType BaseIntType
std::map< std::pair< BaseIntType, BaseIntType >, std::unique_ptr< GaloisField< IntegerType > >, IntegerPairCompare< unsigned > > mGaloisFields
Base class that implements a singleton.