Regina 7.3 Calculation Engine
Classes | Namespaces | Macros | Typedefs | Functions
integer.h File Reference

Provides arbitrary-precision and fixed-precision integer types. More...

#include <climits>
#include <cstdint>
#include <cstddef>
#include <tuple>
#include <gmp.h>
#include "regina-core.h"
#include "utilities/exception.h"
#include "utilities/intutils.h"
#include "utilities/tightencoding.h"

Classes

class  regina::IntegerBase< supportInfinity >
 Represents an arbitrary precision integer. More...
 
class  regina::NativeInteger< bytes >
 A wrapper class for a native, fixed-precision integer type of the given size. More...
 

Namespaces

namespace  regina
 Contains the entire Regina calculation engine.
 
namespace  regina::detail
 Contains implementation details and common functionality for Regina's dimension-agnostic classes.
 

Macros

#define mpz_cmp_si_cpp(z, si)
 An internal copy of the GMP signed comparison optimisations. More...
 

Typedefs

using regina::LargeInteger = IntegerBase< true >
 LargeInteger is a type alias for IntegerBase<true>, which offers arbitrary precision integers with support for infinity. More...
 
using regina::Integer = IntegerBase< false >
 Integer is a type alias for IntegerBase<false>, which offers arbitrary precision integers without support for infinity. More...
 
using regina::NativeLong = NativeInteger< sizeof(long)>
 NativeLong is a type alias for the NativeInteger template class whose underlying integer type is a native long. More...
 

Functions

mpz_ptr regina::detail::mpz_from_ll (long long value)
 Returns a raw GMP integer holding the given value. More...
 
mpz_ptr regina::detail::mpz_from_ull (unsigned long long value)
 Returns a raw GMP integer holding the given value. More...
 
template<bool supportInfinity>
void regina::swap (IntegerBase< supportInfinity > &a, IntegerBase< supportInfinity > &b) noexcept
 Swaps the contents of the given integers. More...
 
template<bool supportInfinity>
std::ostream & regina::operator<< (std::ostream &out, const IntegerBase< supportInfinity > &i)
 Writes the given integer to the given output stream. More...
 
template<bool supportInfinity>
IntegerBase< supportInfinity > regina::operator+ (long lhs, const IntegerBase< supportInfinity > &rhs)
 Adds the given native integer to the given large integer. More...
 
template<bool supportInfinity>
IntegerBase< supportInfinity > regina::operator* (long lhs, const IntegerBase< supportInfinity > &rhs)
 Multiplies the given native integer with the given large integer. More...
 
template<bool supportInfinity>
void regina::tightEncode (std::ostream &out, IntegerBase< supportInfinity > value)
 Writes the tight encoding of the given arbitrary precision integer to the given output stream. More...
 
template<bool supportInfinity>
std::string regina::tightEncoding (IntegerBase< supportInfinity > value)
 Returns the tight encoding of the given arbitrary precision integer. More...
 
template<int bytes>
void regina::swap (NativeInteger< bytes > &a, NativeInteger< bytes > &b) noexcept
 Swaps the contents of the given integers. More...
 
template<int bytes>
std::ostream & regina::operator<< (std::ostream &out, const NativeInteger< bytes > &i)
 Writes the given integer to the given output stream. More...
 

Detailed Description

Provides arbitrary-precision and fixed-precision integer types.


Copyright © 1999-2023, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).