Regina Calculation Engine
Namespaces | Classes | Typedefs | Enumerations | Enumerator | Functions | Variables | Friends
Mathematical Support

Underlying mathematical gruntwork. More...

Namespaces

 regina::detail
 Contains implementation details and common functionality for Regina's dimension-agnostic classes.
 

Classes

class  regina::Cyclotomic
 Represents an element of a cyclotomic field. More...
 
class  regina::NativeInteger< bytes >
 A wrapper class for a native, fixed-precision integer type of the given size. More...
 
struct  regina::InfinityBase< supportInfinity >
 Internal base classes for use with IntegerBase, templated on whether we should support infinity as an allowed value. More...
 
class  regina::IntegerBase< supportInfinity >
 Represents an arbitrary precision integer. More...
 
class  regina::Laurent< T >
 Represents a single-variable Laurent polynomial with coefficients of type T. More...
 
class  regina::Laurent2< T >
 Represents a Laurent polynomial in the two variables x, y with coefficients of type T. More...
 
struct  regina::MatrixRingIdentities< T, ring >
 Provides additive and multiplicative identity constants for the Matrix class. More...
 
class  regina::Matrix< T, ring >
 Represents a matrix of elements of the given type T. More...
 
class  regina::Matrix2
 Represents a 2-by-2 integer matrix. More...
 
class  regina::Perm< n >
 Represents a permutation of {0,1,...,n-1}. More...
 
class  regina::Polynomial< T >
 Represents a single-variable polynomial with coefficients of type T. More...
 
class  regina::Primes
 A helper class for finding primes and factorising integers. More...
 
class  regina::Rational
 Represents an arbitrary precision rational number. More...
 
class  regina::Ray
 A fast class for storing a ray rooted at the origin that passes through an integer point. More...
 
class  regina::Perm< 2 >
 Represents a permutation of {0,1}. More...
 
class  regina::Perm< 3 >
 Represents a permutation of {0,1,2}. More...
 
class  regina::Perm< 4 >
 Represents a permutation of {0,1,2,3}. More...
 
class  regina::Perm< 5 >
 Represents a permutation of {0,1,2,3,4}. More...
 
class  regina::Vector< T >
 An optimised vector class of elements from a given ring T. More...
 

Typedefs

typedef Rational regina::Cyclotomic::Coefficient
 The type of each coefficient of the polynomial that is used to store a field element. More...
 
typedef Cyclotomic regina::NCyclotomic
 Deprecated typedef for backward compatibility. More...
 
typedef IntegerBase< true > regina::LargeInteger
 LargeInteger is a typedef for IntegerBase<true>, which offers arbitrary precision integers with support for infinity. More...
 
typedef IntegerBase< false > regina::Integer
 Integer is a typedef for IntegerBase<false>, which offers arbitrary precision integers without support for infinity. More...
 
typedef IntOfSize< bytes >::type regina::NativeInteger< bytes >::Native
 The native data type used to store this integer. More...
 
typedef NativeInteger< sizeof(long)> regina::NNativeLong
 NNativeLong is a typedef for the NativeInteger template class whose underlying integer type is a native long. More...
 
typedef Integer regina::NInteger
 Deprecated typedef for backward compatibility. More...
 
typedef LargeInteger regina::NLargeInteger
 Deprecated typedef for backward compatibility. More...
 
template<int bytes>
using regina::NNativeInteger = NativeInteger< bytes >
 Deprecated typedef for backward compatibility. More...
 
typedef T regina::Laurent< T >::Coefficient
 The type of each coefficient of the polynomial. More...
 
typedef T regina::Laurent2< T >::Coefficient
 The type of each coefficient of the polynomial. More...
 
typedef T regina::Matrix< T, ring >::Coefficient
 The type of each entry in the matrix. More...
 
template<class T >
using regina::MatrixRing = Matrix< T, true >
 Deprecated typedef for backward compatibility. More...
 
template<class T >
using regina::MatrixIntDomain = Matrix< T, true >
 Deprecated typedef for backward compatibility. More...
 
template<class T >
using regina::NMatrix = Matrix< T, false >
 Deprecated typedef for backward compatibility. More...
 
template<class T >
using regina::NMatrixRing = Matrix< T, true >
 Deprecated typedef for backward compatibility. More...
 
typedef MatrixInt regina::NMatrixInt
 Deprecated typedef for backward compatibility. More...
 
typedef Matrix2 regina::NMatrix2
 Deprecated typedef for backward compatibility. More...
 
typedef IntOfMinSize<(imageBits *n+7)/8 >::type regina::Perm< n >::Index
 Denotes a native signed integer type large enough to count all permutations on n elements. More...
 
typedef IntOfMinSize<(imageBits *n+7)/8 >::utype regina::Perm< n >::Code
 Indicates the native unsigned integer type used to store the internal permutation code. More...
 
template<int n>
using regina::NPerm = Perm< n >
 Deprecated typedef for backward compatibility. More...
 
typedef T regina::Polynomial< T >::Coefficient
 The type of each coefficient of the polynomial. More...
 
template<typename T >
using regina::NPolynomial = Polynomial< T >
 Deprecated typedef for backward compatibility. More...
 
typedef Primes regina::NPrimes
 Deprecated typedef for backward compatibility. More...
 
typedef Rational regina::NRational
 Deprecated typedef for backward compatibility. More...
 
typedef Ray regina::NRay
 Deprecated typedef for backward compatibility. More...
 
typedef int regina::Perm< 2 >::Index
 Denotes a native signed integer type large enough to count all permutations on two elements. More...
 
typedef uint8_t regina::Perm< 2 >::Code
 Indicates the native unsigned integer type used to store the internal permutation code. More...
 
typedef Perm< 2 > regina::NPerm2
 Deprecated typedef for backward compatibility. More...
 
typedef int regina::Perm< 3 >::Index
 Denotes a native signed integer type large enough to count all permutations on three elements. More...
 
typedef uint8_t regina::Perm< 3 >::Code
 Indicates the native unsigned integer type used to store the internal permutation code. More...
 
typedef Perm< 3 > regina::NPerm3
 Deprecated typedef for backward compatibility. More...
 
typedef int regina::Perm< 4 >::Index
 Denotes a native signed integer type large enough to count all permutations on four elements. More...
 
typedef uint8_t regina::Perm< 4 >::Code
 Indicates the native unsigned integer type used to store the internal permutation code. More...
 
typedef Perm< 4 > regina::NPerm4
 Deprecated typedef for backward compatibility. More...
 
typedef int regina::Perm< 5 >::Index
 Denotes a native signed integer type large enough to count all permutations on five elements. More...
 
typedef uint16_t regina::Perm< 5 >::Code
 Indicates the native unsigned integer type used to store the internal permutation code. More...
 
typedef Perm< 5 > regina::NPerm5
 Deprecated typedef for backward compatibility. More...
 
template<class T >
using regina::NVector = Vector< T >
 Deprecated typedef for backward compatibility. More...
 

Enumerations

enum  {
  regina::Perm< 3 >::code012 = 0, regina::Perm< 3 >::code021 = 1, regina::Perm< 3 >::code120 = 2, regina::Perm< 3 >::code102 = 3,
  regina::Perm< 3 >::code201 = 4, regina::Perm< 3 >::code210 = 5
}
 

Functions

template<class R >
bool regina::isZero (R x)
 Deprecated routine for managing floating-point roundoff errors. More...
 
template<class R >
bool regina::isNonZero (R x)
 Deprecated routine for managing floating-point roundoff errors. More...
 
template<class R >
bool regina::isPositive (R x)
 Deprecated routine for managing floating-point roundoff errors. More...
 
template<class R >
bool regina::isNegative (R x)
 Deprecated routine for managing floating-point roundoff errors. More...
 
template<class R >
bool regina::isNonNegative (R x)
 Deprecated routine for managing floating-point roundoff errors. More...
 
template<class R >
bool regina::isNonPositive (R x)
 Deprecated routine for managing floating-point roundoff errors. More...
 
int regina::binomSmall (int n, int k)
 Returns the binomial coefficient n choose k in constant time for small arguments (n ≤ 16). More...
 
long regina::binomMedium (int n, int k)
 Returns the binomial coefficient n choose k in linear time for medium-sized arguments (n ≤ 29). More...
 
 regina::Cyclotomic::Cyclotomic ()
 Creates an uninitialised field element. More...
 
 regina::Cyclotomic::Cyclotomic (size_t field)
 Creates the zero element of the given cyclotomic field. More...
 
 regina::Cyclotomic::Cyclotomic (size_t field, int value)
 Creates the given integer element within the given cyclotomic field. More...
 
 regina::Cyclotomic::Cyclotomic (size_t field, const Rational &value)
 Creates the given rational element within the given cyclotomic field. More...
 
 regina::Cyclotomic::Cyclotomic (const Cyclotomic &value)
 Creates a copy of the given field element, within the same cyclotomic field. More...
 
 regina::Cyclotomic::Cyclotomic (Cyclotomic &&value) noexcept
 Moves the contents of the given field element to this new field element. More...
 
 regina::Cyclotomic::Cyclotomic (size_t field, std::initializer_list< Rational > coefficients)
 Creates a new field element from a hard-coded sequence of coefficients. More...
 
 regina::Cyclotomic::~Cyclotomic ()
 Destroys this field element. More...
 
void regina::Cyclotomic::init (size_t field)
 Initialises this to be the zero element of the given cyclotomic field. More...
 
size_t regina::Cyclotomic::field () const
 Returns the order n of the underlying cyclotomic field to which this element belongs. More...
 
size_t regina::Cyclotomic::degree () const
 Returns the degree of the polynomial that defines the underlying cyclotomic field. More...
 
const Rationalregina::Cyclotomic::operator[] (size_t exp) const
 Returns an individual rational coefficient of the polynomial representation of this field element. More...
 
Rationalregina::Cyclotomic::operator[] (size_t exp)
 Offers access to an individual rational coefficient of the polynomial representation of this field element. More...
 
Polynomial< Rational > * regina::Cyclotomic::polynomial () const
 Returns the full polynomial representation of this field element. More...
 
std::complex< double > regina::Cyclotomic::evaluate (size_t whichRoot=1) const
 Returns the value of this cyclotomic field element as a complex number. More...
 
bool regina::Cyclotomic::operator== (const Cyclotomic &rhs) const
 Tests whether or not this and the given argument are the same element of the same cyclotomic field. More...
 
bool regina::Cyclotomic::operator!= (const Cyclotomic &rhs) const
 Tests whether or not this and the given argument are the same element of the same cyclotomic field. More...
 
Cyclotomicregina::Cyclotomic::operator= (const Cyclotomic &value)
 Sets this to a copy of the given field element. More...
 
Cyclotomicregina::Cyclotomic::operator= (Cyclotomic &&value) noexcept
 Moves the contents of the given field element to this field element. More...
 
Cyclotomicregina::Cyclotomic::operator= (const Rational &scalar)
 Sets this field element to the given rational. More...
 
void regina::Cyclotomic::negate ()
 Negates this field element. More...
 
void regina::Cyclotomic::invert ()
 Inverts this field element. More...
 
Cyclotomic regina::Cyclotomic::inverse () const
 Returns the inverse of this field element. More...
 
Cyclotomicregina::Cyclotomic::operator*= (const Rational &scalar)
 Multiplies this field element by the given rational. More...
 
Cyclotomicregina::Cyclotomic::operator/= (const Rational &scalar)
 Divides this field element by the given rational. More...
 
Cyclotomicregina::Cyclotomic::operator+= (const Cyclotomic &other)
 Adds the given field element to this. More...
 
Cyclotomicregina::Cyclotomic::operator-= (const Cyclotomic &other)
 Subtracts the given field element from this. More...
 
Cyclotomicregina::Cyclotomic::operator*= (const Cyclotomic &other)
 Multiplies this by the given field element. More...
 
Cyclotomicregina::Cyclotomic::operator/= (const Cyclotomic &other)
 Divides this by the given field element. More...
 
static const Polynomial< Integer > & regina::Cyclotomic::cyclotomic (size_t n)
 Returns the nth cyclotomic polynomial Φ_n. More...
 
void regina::Cyclotomic::writeTextShort (std::ostream &out, bool utf8=false, const char *variable=nullptr) const
 Writes this field element to the given output stream, using the given variable name instead of x. More...
 
std::string regina::Cyclotomic::str (const char *variable) const
 Returns this field element as a human-readable string, using the given variable name instead of x. More...
 
std::string regina::Cyclotomic::utf8 (const char *variable) const
 Returns this field element as a human-readable string using unicode characters, using the given variable name instead of x. More...
 
Cyclotomic regina::operator* (Cyclotomic elt, const Rational &scalar)
 Multiplies the given field element by the given rational. More...
 
Cyclotomic regina::operator* (const Rational &scalar, Cyclotomic elt)
 Multiplies the given field element by the given rational. More...
 
Cyclotomic regina::operator/ (Cyclotomic elt, const Rational &scalar)
 Divides the given field element by the given rational. More...
 
Cyclotomic regina::operator+ (const Cyclotomic &lhs, const Cyclotomic &rhs)
 Adds the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator+ (Cyclotomic &&lhs, const Cyclotomic &rhs)
 Adds the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator+ (const Cyclotomic &lhs, Cyclotomic &&rhs)
 Adds the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator+ (Cyclotomic &&lhs, Cyclotomic &&rhs)
 Adds the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator- (Cyclotomic arg)
 Returns the negative of the given field element. More...
 
Cyclotomic regina::operator- (const Cyclotomic &lhs, const Cyclotomic &rhs)
 Subtracts the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator- (Cyclotomic &&lhs, const Cyclotomic &rhs)
 Subtracts the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator- (const Cyclotomic &lhs, Cyclotomic &&rhs)
 Subtracts the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator- (Cyclotomic &&lhs, Cyclotomic &&rhs)
 Subtracts the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator* (const Cyclotomic &lhs, const Cyclotomic &rhs)
 Multiplies the two given cyclotomic field elements. More...
 
Cyclotomic regina::operator/ (const Cyclotomic &lhs, const Cyclotomic &rhs)
 Divides the two given cyclotomic field elements. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase ()
 Initialises this integer to zero. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (int value)
 Initialises this integer to the given value. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (unsigned value)
 Initialises this integer to the given value. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (long value)
 Initialises this integer to the given value. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (unsigned long value)
 Initialises this integer to the given value. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (const IntegerBase< supportInfinity > &value)
 Initialises this integer to the given value. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (const IntegerBase<! supportInfinity > &value)
 Initialises this integer to the given value. More...
 
template<int bytes>
 regina::IntegerBase< supportInfinity >::IntegerBase (const NativeInteger< bytes > &value)
 Initialises this integer to the given value. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (Long value)
 Initialises this to the given Python arbitrary-precision integer. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (double value)
 Initialises this integer to the truncation of the given real number. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (const char *value, int base=10, bool *valid=nullptr)
 Initialises this integer to the given value which is represented as a string of digits in a given base. More...
 
 regina::IntegerBase< supportInfinity >::IntegerBase (const std::string &value, int base=10, bool *valid=nullptr)
 Initialises this integer to the given value which is represented as a string of digits in a given base. More...
 
 regina::IntegerBase< supportInfinity >::~IntegerBase ()
 Destroys this integer. More...
 
bool regina::IntegerBase< supportInfinity >::isNative () const
 Returns whether we are currently working with a native C/C++ long, or whether we have switched to GMP large integer arithmetic for this integer. More...
 
bool regina::IntegerBase< supportInfinity >::isZero () const
 Returns whether or not this integer is zero. More...
 
int regina::IntegerBase< supportInfinity >::sign () const
 Returns the sign of this integer. More...
 
bool regina::IntegerBase< supportInfinity >::isInfinite () const
 Returns whether this integer is infinity. More...
 
void regina::IntegerBase< supportInfinity >::makeInfinite ()
 Sets this integer to be infinity. More...
 
long regina::IntegerBase< supportInfinity >::longValue () const
 Returns the value of this integer as a long. More...
 
template<int bytes>
IntOfSize< bytes >::type regina::IntegerBase< supportInfinity >::nativeValue () const
 Returns the value of this integer as a native integer of some fixed byte length. More...
 
std::string regina::IntegerBase< supportInfinity >::stringValue (int base=10) const
 Returns the value of this integer as a string in the given base. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (const IntegerBase &value)
 Sets this integer to the given value. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (const IntegerBase<! supportInfinity > &value)
 Sets this integer to the given value. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (int value)
 Sets this integer to the given value. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (unsigned value)
 Sets this integer to the given value. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (long value)
 Sets this integer to the given value. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (unsigned long value)
 Sets this integer to the given value. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (const char *value)
 Sets this integer to the given value which is represented as a string of digits in base 10. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator= (const std::string &value)
 Sets this integer to the given value which is represented as a string of digits in base 10. More...
 
void regina::IntegerBase< supportInfinity >::swap (IntegerBase &other)
 Swaps the values of this and the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator== (const IntegerBase &rhs) const
 Determines if this is equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator== (const IntegerBase<! supportInfinity > &rhs) const
 Determines if this is equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator== (long rhs) const
 Determines if this is equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator!= (const IntegerBase &rhs) const
 Determines if this is not equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator!= (const IntegerBase<! supportInfinity > &rhs) const
 Determines if this is not equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator!= (long rhs) const
 Determines if this is not equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator< (const IntegerBase &rhs) const
 Determines if this is less than the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator< (long rhs) const
 Determines if this is less than the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator> (const IntegerBase &rhs) const
 Determines if this is greater than the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator> (long rhs) const
 Determines if this is greater than the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator<= (const IntegerBase &rhs) const
 Determines if this is less than or equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator<= (long rhs) const
 Determines if this is less than or equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator>= (const IntegerBase &rhs) const
 Determines if this is greater than or equal to the given integer. More...
 
bool regina::IntegerBase< supportInfinity >::operator>= (long rhs) const
 Determines if this is greater than or equal to the given integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator++ ()
 The preincrement operator. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator++ (int)
 The postincrement operator. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator-- ()
 The predecrement operator. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator-- (int)
 The postdecrement operator. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator+ (const IntegerBase &other) const
 Adds this to the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator+ (long other) const
 Adds this to the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator- (const IntegerBase &other) const
 Subtracts the given integer from this and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator- (long other) const
 Subtracts the given integer from this and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator* (const IntegerBase &other) const
 Multiplies this by the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator* (long other) const
 Multiplies this by the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator/ (const IntegerBase &other) const
 Divides this by the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator/ (long other) const
 Divides this by the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::divExact (const IntegerBase &other) const
 Divides this by the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::divExact (long other) const
 Divides this by the given integer and returns the result. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator% (const IntegerBase &other) const
 Determines the remainder when this integer is divided by the given integer. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator% (long other) const
 Determines the remainder when this integer is divided by the given integer. More...
 
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::divisionAlg (const IntegerBase< supportInfinity > &divisor, IntegerBase< supportInfinity > &remainder) const
 Uses the division algorithm to obtain a quotient and remainder when dividing by the given integer. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::operator- () const
 Determines the negative of this integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator+= (const IntegerBase &other)
 Adds the given integer to this. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator+= (long other)
 Adds the given integer to this. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator-= (const IntegerBase &other)
 Subtracts the given integer from this. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator-= (long other)
 Subtracts the given integer from this. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator*= (const IntegerBase &other)
 Multiplies the given integer by this. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator*= (long other)
 Multiplies the given integer by this. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator/= (const IntegerBase &other)
 Divides this by the given integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator/= (long other)
 Divides this by the given integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::divByExact (const IntegerBase &other)
 Divides this by the given integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::divByExact (long other)
 Divides this by the given integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator%= (const IntegerBase &other)
 Reduces this integer modulo the given integer. More...
 
IntegerBaseregina::IntegerBase< supportInfinity >::operator%= (long other)
 Reduces this integer modulo the given integer. More...
 
void regina::IntegerBase< supportInfinity >::negate ()
 Negates this integer. More...
 
void regina::IntegerBase< supportInfinity >::raiseToPower (unsigned long exp)
 Raises this integer to the power of the given exponent. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::abs () const
 Determines the absolute value of this integer. More...
 
void regina::IntegerBase< supportInfinity >::gcdWith (const IntegerBase &other)
 Sets this integer to be the greatest common divisor of this and the given integer. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::gcd (const IntegerBase &other) const
 Determines the greatest common divisor of this and the given integer. More...
 
void regina::IntegerBase< supportInfinity >::lcmWith (const IntegerBase &other)
 Sets this integer to be the lowest common multiple of this and the given integer. More...
 
IntegerBase regina::IntegerBase< supportInfinity >::lcm (const IntegerBase &other) const
 Determines the lowest common multiple of this and the given integer. More...
 
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::gcdWithCoeffs (const IntegerBase< supportInfinity > &other, IntegerBase< supportInfinity > &u, IntegerBase< supportInfinity > &v) const
 Determines the greatest common divisor of this and the given integer and finds the smallest coefficients with which these integers combine to give their gcd. More...
 
int regina::IntegerBase< supportInfinity >::legendre (const IntegerBase< supportInfinity > &p) const
 Returns the Legendre symbol (a/p), where a is this integer and p is an odd prime. More...
 
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::randomBoundedByThis () const
 Generate a pseudo-random integer that is uniformly distributed in the interval [0,*this). More...
 
static IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::randomBinary (unsigned long n)
 Generate a pseudo-random integer that is uniformly distributed in the interval [0,2^n). More...
 
static IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::randomCornerBinary (unsigned long n)
 Generate a pseudo-random integer that is distributed in the interval [0,2^n), with a tendency to have long strings of 0s and 1s in its binary expansion. More...
 
void regina::IntegerBase< supportInfinity >::setRaw (mpz_srcptr fromData)
 Set this to a copy of the given raw GMP integer. More...
 
mpz_srcptr regina::IntegerBase< supportInfinity >::rawData () const
 Returns the raw GMP data that describes this integer. More...
 
mpz_ptr regina::IntegerBase< supportInfinity >::rawData ()
 Returns the raw GMP data that describes this integer. More...
 
void regina::IntegerBase< supportInfinity >::makeLarge ()
 Converts this integer to use a GMP large integer representation, regardless of whether this is actually necessary. More...
 
void regina::IntegerBase< supportInfinity >::tryReduce ()
 Converts this integer to use a native C/C++ long representation, if this is possible. 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...
 
 regina::NativeInteger< bytes >::NativeInteger ()
 Initialises this integer to zero. More...
 
 regina::NativeInteger< bytes >::NativeInteger (Native value)
 Initialises this integer to the given value. More...
 
 regina::NativeInteger< bytes >::NativeInteger (const NativeInteger< bytes > &value)
 Initialises this integer to the given value. More...
 
template<bool supportInfinity>
 regina::NativeInteger< bytes >::NativeInteger (const IntegerBase< supportInfinity > &value)
 Initialises this integer to the given value. More...
 
bool regina::NativeInteger< bytes >::isZero () const
 Returns whether or not this integer is zero. More...
 
int regina::NativeInteger< bytes >::sign () const
 Returns the sign of this integer. More...
 
Native regina::NativeInteger< bytes >::nativeValue () const
 Returns the value of this integer in its native type. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator= (const NativeInteger &value)
 Sets this integer to the given value. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator= (Native value)
 Sets this integer to the given value. More...
 
void regina::NativeInteger< bytes >::swap (NativeInteger &other)
 Swaps the values of this and the given integer. More...
 
bool regina::NativeInteger< bytes >::operator== (const NativeInteger &rhs) const
 Determines if this is equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator== (Native rhs) const
 Determines if this is equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator!= (const NativeInteger &rhs) const
 Determines if this is not equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator!= (Native rhs) const
 Determines if this is not equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator< (const NativeInteger &rhs) const
 Determines if this is less than the given integer. More...
 
bool regina::NativeInteger< bytes >::operator< (Native rhs) const
 Determines if this is less than the given integer. More...
 
bool regina::NativeInteger< bytes >::operator> (const NativeInteger &rhs) const
 Determines if this is greater than the given integer. More...
 
bool regina::NativeInteger< bytes >::operator> (Native rhs) const
 Determines if this is greater than the given integer. More...
 
bool regina::NativeInteger< bytes >::operator<= (const NativeInteger &rhs) const
 Determines if this is less than or equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator<= (Native rhs) const
 Determines if this is less than or equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator>= (const NativeInteger &rhs) const
 Determines if this is greater than or equal to the given integer. More...
 
bool regina::NativeInteger< bytes >::operator>= (Native rhs) const
 Determines if this is greater than or equal to the given integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator++ ()
 The preincrement operator. More...
 
NativeInteger regina::NativeInteger< bytes >::operator++ (int)
 The postincrement operator. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator-- ()
 The predecrement operator. More...
 
NativeInteger regina::NativeInteger< bytes >::operator-- (int)
 The postdecrement operator. More...
 
NativeInteger regina::NativeInteger< bytes >::operator+ (const NativeInteger &other) const
 Adds this to the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator+ (Native other) const
 Adds this to the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator- (const NativeInteger &other) const
 Subtracts the given integer from this and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator- (Native other) const
 Subtracts the given integer from this and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator* (const NativeInteger &other) const
 Multiplies this by the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator* (Native other) const
 Multiplies this by the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator/ (const NativeInteger &other) const
 Divides this by the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator/ (Native other) const
 Divides this by the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::divExact (const NativeInteger &other) const
 Divides this by the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::divExact (Native other) const
 Divides this by the given integer and returns the result. More...
 
NativeInteger regina::NativeInteger< bytes >::operator% (const NativeInteger &other) const
 Determines the remainder when this integer is divided by the given integer. More...
 
NativeInteger regina::NativeInteger< bytes >::operator% (Native other) const
 Determines the remainder when this integer is divided by the given integer. More...
 
NativeInteger< bytes > regina::NativeInteger< bytes >::divisionAlg (const NativeInteger< bytes > &divisor, NativeInteger< bytes > &remainder) const
 Uses the division algorithm to obtain a quotient and remainder when dividing by the given integer. More...
 
NativeInteger regina::NativeInteger< bytes >::operator- () const
 Determines the negative of this integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator+= (const NativeInteger &other)
 Adds the given integer to this. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator+= (Native other)
 Adds the given integer to this. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator-= (const NativeInteger &other)
 Subtracts the given integer from this. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator-= (Native other)
 Subtracts the given integer from this. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator*= (const NativeInteger &other)
 Multiplies the given integer by this. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator*= (Native other)
 Multiplies the given integer by this. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator/= (const NativeInteger &other)
 Divides this by the given integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator/= (Native other)
 Divides this by the given integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::divByExact (const NativeInteger &other)
 Divides this by the given integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::divByExact (Native other)
 Divides this by the given integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator%= (const NativeInteger &other)
 Reduces this integer modulo the given integer. More...
 
NativeIntegerregina::NativeInteger< bytes >::operator%= (Native other)
 Reduces this integer modulo the given integer. More...
 
void regina::NativeInteger< bytes >::negate ()
 Negates this integer. More...
 
void regina::NativeInteger< bytes >::gcdWith (const NativeInteger &other)
 Sets this integer to be the greatest common divisor of this and the given integer. More...
 
NativeInteger regina::NativeInteger< bytes >::gcd (const NativeInteger &other) const
 Determines the greatest common divisor of this and the given integer. 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...
 
 regina::Laurent< T >::Laurent ()
 Creates the zero polynomial. More...
 
 regina::Laurent< T >::Laurent (long exponent)
 Creates the polynomial x^d for the given exponent d. More...
 
 regina::Laurent< T >::Laurent (const Laurent< T > &value)
 Creates a new copy of the given polynomial. More...
 
template<typename U >
 regina::Laurent< T >::Laurent (const Laurent< U > &value)
 Creates a new copy of the given polynomial. More...
 
 regina::Laurent< T >::Laurent (Laurent< T > &&value) noexcept
 Moves the contents of the given polynomial to this new polynomial. More...
 
template<typename iterator >
 regina::Laurent< T >::Laurent (long minExp, iterator begin, iterator end)
 Creates a new polynomial from the given sequence of coefficients. More...
 
 regina::Laurent< T >::Laurent (long minExp, std::initializer_list< T > coefficients)
 Creates a new polynomial from a hard-coded sequence of coefficients. More...
 
 regina::Laurent< T >::~Laurent ()
 Destroys this polynomial. More...
 
void regina::Laurent< T >::init ()
 Sets this to become the zero polynomial. More...
 
void regina::Laurent< T >::init (long exponent)
 Sets this to become the polynomial x^d for the given exponent d. More...
 
template<typename iterator >
void regina::Laurent< T >::init (long minExp, iterator begin, iterator end)
 Sets this to become the polynomial described by the given sequence of coefficients. More...
 
long regina::Laurent< T >::minExp () const
 Returns the smallest exponent that appears in this polynomial with a non-zero coefficient. More...
 
long regina::Laurent< T >::maxExp () const
 Returns the largest exponent that appears in this polynomial with a non-zero coefficient. More...
 
bool regina::Laurent< T >::isZero () const
 Returns whether this is the zero polynomial. More...
 
const T & regina::Laurent< T >::operator[] (long exp) const
 Returns the given coefficient of this polynomial. More...
 
void regina::Laurent< T >::set (long exp, const T &value)
 Changes the given coefficient of this polynomial. More...
 
bool regina::Laurent< T >::operator== (const Laurent< T > &rhs) const
 Tests whether this and the given polynomial are equal. More...
 
bool regina::Laurent< T >::operator!= (const Laurent< T > &rhs) const
 Tests whether this and the given polynomial are not equal. More...
 
Laurentregina::Laurent< T >::operator= (const Laurent< T > &value)
 Sets this to be a copy of the given polynomial. More...
 
template<typename U >
Laurentregina::Laurent< T >::operator= (const Laurent< U > &value)
 Sets this to be a copy of the given polynomial. More...
 
Laurentregina::Laurent< T >::operator= (Laurent< T > &&value) noexcept
 Moves the contents of the given polynomial to this polynomial. More...
 
void regina::Laurent< T >::swap (Laurent< T > &other)
 Swaps the contents of this and the given polynomial. More...
 
void regina::Laurent< T >::shift (long s)
 Multiplies this polynomial by x^s for some integer s. More...
 
void regina::Laurent< T >::scaleUp (long k)
 Multiplies all exponents in this polynomial by k for some integer k. More...
 
void regina::Laurent< T >::scaleDown (long k)
 Divides all exponents in this polynomial by k for some integer k. More...
 
void regina::Laurent< T >::negate ()
 Negates this polynomial. More...
 
Laurentregina::Laurent< T >::operator*= (const T &scalar)
 Multiplies this polynomial by the given constant. More...
 
Laurentregina::Laurent< T >::operator/= (const T &scalar)
 Divides this polynomial by the given constant. More...
 
Laurentregina::Laurent< T >::operator+= (const Laurent< T > &other)
 Adds the given polynomial to this. More...
 
Laurentregina::Laurent< T >::operator-= (const Laurent< T > &other)
 Subtracts the given polynomial from this. More...
 
Laurentregina::Laurent< T >::operator*= (const Laurent< T > &other)
 Multiplies this by the given polynomial. More...
 
void regina::Laurent< T >::writeTextShort (std::ostream &out, bool utf8=false, const char *variable=nullptr) const
 Writes this polynomial to the given output stream, using the given variable name instead of x. More...
 
std::string regina::Laurent< T >::str (const char *variable) const
 Returns this polynomial as a human-readable string, using the given variable name instead of x. More...
 
std::string regina::Laurent< T >::utf8 (const char *variable) const
 Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x. More...
 
template<typename T >
Laurent< T > regina::operator* (Laurent< T > poly, const typename Laurent< T >::Coefficient &scalar)
 Multiplies the given polynomial by the given scalar constant. More...
 
template<typename T >
Laurent< T > regina::operator* (const typename Laurent< T >::Coefficient &scalar, Laurent< T > poly)
 Multiplies the given polynomial by the given scalar constant. More...
 
template<typename T >
Laurent< T > regina::operator/ (Laurent< T > poly, const typename Laurent< T >::Coefficient &scalar)
 Divides the given polynomial by the given scalar constant. More...
 
template<typename T >
Laurent< T > regina::operator+ (const Laurent< T > &lhs, const Laurent< T > &rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator+ (Laurent< T > &&lhs, const Laurent< T > &rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator+ (const Laurent< T > &lhs, Laurent< T > &&rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator+ (Laurent< T > &&lhs, Laurent< T > &&rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator- (Laurent< T > arg)
 Returns the negative of the given polynomial. More...
 
template<typename T >
Laurent< T > regina::operator- (const Laurent< T > &lhs, const Laurent< T > &rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator- (Laurent< T > &&lhs, const Laurent< T > &rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator- (const Laurent< T > &lhs, Laurent< T > &&rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator- (Laurent< T > &&lhs, Laurent< T > &&rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent< T > regina::operator* (const Laurent< T > &lhs, const Laurent< T > &rhs)
 Multiplies the two given polynomials. More...
 
 regina::Laurent2< T >::Laurent2 ()=default
 Creates the zero polynomial. More...
 
 regina::Laurent2< T >::Laurent2 (long xExp, long yExp)
 Creates the polynomial x^d y^e for the given exponents d and e. More...
 
 regina::Laurent2< T >::Laurent2 (const Laurent2< T > &value)
 Creates a new copy of the given polynomial. More...
 
 regina::Laurent2< T >::Laurent2 (Laurent2< T > &&value) noexcept=default
 Moves the contents of the given polynomial to this new polynomial. More...
 
 regina::Laurent2< T >::Laurent2 (const Laurent2< T > &toShift, long xShift, long yShift)
 Creates a copy of the given polynomial with all terms multiplied by x^d y^e for some integers d and e. More...
 
template<typename U >
 regina::Laurent2< T >::Laurent2 (const Laurent2< U > &value)
 Creates a new copy of the given polynomial. More...
 
 regina::Laurent2< T >::Laurent2 (std::initializer_list< std::tuple< long, long, T >> coefficients)
 Creates a new polynomial from a hard-coded collection of non-zero coefficients. More...
 
void regina::Laurent2< T >::init ()
 Sets this to become the zero polynomial. More...
 
void regina::Laurent2< T >::init (long xExp, long yExp)
 Sets this to become the polynomial x^d y^e for the given exponents d and e. More...
 
bool regina::Laurent2< T >::isZero () const
 Returns whether this is the zero polynomial. More...
 
const T & regina::Laurent2< T >::operator() (long xExp, long yExp) const
 Returns the given coefficient of this polynomial. More...
 
void regina::Laurent2< T >::set (long xExp, long yExp, const T &value)
 Changes the given coefficient of this polynomial. More...
 
bool regina::Laurent2< T >::operator== (const Laurent2< T > &rhs) const
 Tests whether this and the given polynomial are equal. More...
 
bool regina::Laurent2< T >::operator!= (const Laurent2< T > &rhs) const
 Tests whether this and the given polynomial are not equal. More...
 
Laurent2regina::Laurent2< T >::operator= (const Laurent2< T > &value)
 Sets this to be a copy of the given polynomial. More...
 
template<typename U >
Laurent2regina::Laurent2< T >::operator= (const Laurent2< U > &value)
 Sets this to be a copy of the given polynomial. More...
 
Laurent2regina::Laurent2< T >::operator= (Laurent2< T > &&value) noexcept=default
 Moves the contents of the given polynomial to this polynomial. More...
 
void regina::Laurent2< T >::swap (Laurent2< T > &other)
 Swaps the contents of this and the given polynomial. More...
 
void regina::Laurent2< T >::negate ()
 Negates this polynomial. More...
 
Laurent2regina::Laurent2< T >::operator*= (const T &scalar)
 Multiplies this polynomial by the given constant. More...
 
Laurent2regina::Laurent2< T >::operator/= (const T &scalar)
 Divides this polynomial by the given constant. More...
 
Laurent2regina::Laurent2< T >::operator+= (const Laurent2< T > &other)
 Adds the given polynomial to this. More...
 
Laurent2regina::Laurent2< T >::operator-= (const Laurent2< T > &other)
 Subtracts the given polynomial from this. More...
 
Laurent2regina::Laurent2< T >::operator*= (const Laurent2< T > &other)
 Multiplies this by the given polynomial. More...
 
void regina::Laurent2< T >::writeTextShort (std::ostream &out, bool utf8=false, const char *varX=nullptr, const char *varY=nullptr) const
 Writes this polynomial to the given output stream, using the given variable names instead of x and y. More...
 
std::string regina::Laurent2< T >::str (const char *varX, const char *varY=nullptr) const
 Returns this polynomial as a human-readable string, using the given variable names instead of x and y. More...
 
std::string regina::Laurent2< T >::utf8 (const char *varX, const char *varY=nullptr) const
 Returns this polynomial as a human-readable string using unicode characters, using the given variable names instead of x and y. More...
 
template<typename T >
Laurent2< T > regina::operator* (Laurent2< T > poly, const typename Laurent2< T >::Coefficient &scalar)
 Multiplies the given polynomial by the given scalar constant. More...
 
template<typename T >
Laurent2< T > regina::operator* (const typename Laurent2< T >::Coefficient &scalar, Laurent2< T > poly)
 Multiplies the given polynomial by the given scalar constant. More...
 
template<typename T >
Laurent2< T > regina::operator/ (Laurent2< T > poly, const typename Laurent2< T >::Coefficient &scalar)
 Divides the given polynomial by the given scalar constant. More...
 
template<typename T >
Laurent2< T > regina::operator+ (const Laurent2< T > &lhs, const Laurent2< T > &rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator+ (Laurent2< T > &&lhs, const Laurent2< T > &rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator+ (const Laurent2< T > &lhs, Laurent2< T > &&rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator+ (Laurent2< T > &&lhs, Laurent2< T > &&rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator- (Laurent2< T > arg)
 Returns the negative of the given polynomial. More...
 
template<typename T >
Laurent2< T > regina::operator- (const Laurent2< T > &lhs, const Laurent2< T > &rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator- (Laurent2< T > &&lhs, const Laurent2< T > &rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator- (const Laurent2< T > &lhs, Laurent2< T > &&rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator- (Laurent2< T > &&lhs, Laurent2< T > &&rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Laurent2< T > regina::operator* (const Laurent2< T > &lhs, const Laurent2< T > &rhs)
 Multiplies the two given polynomials. More...
 
 regina::Matrix< T, ring >::Matrix (unsigned long rows, unsigned long cols)
 Creates a new matrix of the given size. More...
 
 regina::Matrix< T, ring >::Matrix (const Matrix &src)
 Creates a new matrix that is a clone of the given matrix. More...
 
 regina::Matrix< T, ring >::Matrix (Matrix &&src) noexcept
 Moves the given matrix into this new matrix. More...
 
 regina::Matrix< T, ring >::~Matrix ()
 Destroys this matrix. More...
 
Matrixregina::Matrix< T, ring >::operator= (const Matrix &src)
 Copies the given matrix into this matrix. More...
 
Matrixregina::Matrix< T, ring >::operator= (Matrix &&src) noexcept
 Moves the given matrix into this matrix. More...
 
void regina::Matrix< T, ring >::initialise (const T &value)
 Sets every entry in the matrix to the given value. More...
 
void regina::Matrix< T, ring >::initialise (List allValues)
 A Python-only routine that fills the matrix with the given set of elements. More...
 
unsigned long regina::Matrix< T, ring >::rows () const
 Returns the number of rows in this matrix. More...
 
unsigned long regina::Matrix< T, ring >::columns () const
 Returns the number of columns in this matrix. More...
 
T & regina::Matrix< T, ring >::entry (unsigned long row, unsigned long column)
 Returns the entry at the given row and column. More...
 
const T & regina::Matrix< T, ring >::entry (unsigned long row, unsigned long column) const
 Returns the entry at the given row and column. More...
 
bool regina::Matrix< T, ring >::operator== (const Matrix &other) const
 Determines whether this and the given matrix are identical. More...
 
bool regina::Matrix< T, ring >::operator!= (const Matrix &other) const
 Determines whether this and the given matrix are different. More...
 
void regina::Matrix< T, ring >::writeMatrix (std::ostream &out) const
 Writes a complete representation of the matrix to the given output stream. More...
 
void regina::Matrix< T, ring >::swapRows (unsigned long first, unsigned long second)
 Swaps the elements of the two given rows in the matrix. More...
 
void regina::Matrix< T, ring >::swapColumns (unsigned long first, unsigned long second)
 Swaps the elements of the two given columns in the matrix. More...
 
void regina::Matrix< T, ring >::writeTextShort (std::ostream &out) const
 Writes a short text representation of this object to the given output stream. More...
 
void regina::Matrix< T, ring >::writeTextLong (std::ostream &out) const
 Writes a detailed text representation of this object to the given output stream. More...
 
 regina::Matrix< T, ring >::REGINA_ENABLE_FOR_RING_STATIC (Matrix) identity(unsigned long size)
 Returns an identity matrix of the given size. More...
 
void regina::Matrix< T, ring >::makeIdentity ()
 Turns this matrix into an identity matrix. More...
 
bool regina::Matrix< T, ring >::isIdentity () const
 Determines whether this matrix is a square identity matrix. More...
 
bool regina::Matrix< T, ring >::isZero () const
 Determines whether this is the zero matrix. More...
 
void regina::Matrix< T, ring >::addRow (unsigned long source, unsigned long dest)
 Adds the given source row to the given destination row. More...
 
void regina::Matrix< T, ring >::addRow (unsigned long source, unsigned long dest, T copies)
 Adds the given number of copies of the given source row to the given destination row. More...
 
void regina::Matrix< T, ring >::addCol (unsigned long source, unsigned long dest)
 Adds the given source column to the given destination column. More...
 
void regina::Matrix< T, ring >::addCol (unsigned long source, unsigned long dest, T copies)
 Adds the given number of copies of the given source column to the given destination column. More...
 
void regina::Matrix< T, ring >::multRow (unsigned long row, T factor)
 Multiplies the given row by the given factor. More...
 
void regina::Matrix< T, ring >::multCol (unsigned long column, T factor)
 Multiplies the given column by the given factor. More...
 
Matrix regina::Matrix< T, ring >::operator* (const Matrix &other) const
 Multiplies this by the given matrix, and returns the result. More...
 
Matrix regina::Matrix< T, ring >::multiplyAs (const Matrix &other) const
 Deprecated alias for the multiplication operator. More...
 
regina::Matrix< T, ring >::det () const
 Evaluates the determinant of the matrix. More...
 
 regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER (void) divRowExact(unsigned long row
 Divides all elements of the given row by the given integer. More...
 
 regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER (T) gcdRow(unsigned long row)
 Computes the greatest common divisor of all elements of the given row. More...
 
 regina::Matrix2::Matrix2 ()
 Initialises to the zero matrix. More...
 
 regina::Matrix2::Matrix2 (const Matrix2 &cloneMe)
 Initialises to a copy of the given matrix. More...
 
 regina::Matrix2::Matrix2 (const long values[2][2])
 Initialises to the given integer values. More...
 
 regina::Matrix2::Matrix2 (long val00, long val01, long val10, long val11)
 Initialises to the given integer values. More...
 
Matrix2regina::Matrix2::operator= (const Matrix2 &cloneMe)
 Sets this matrix to be a copy of the given matrix. More...
 
Matrix2regina::Matrix2::operator= (const long values[2][2])
 Sets the elements of this matrix to the given integer values. More...
 
const long * regina::Matrix2::operator[] (unsigned row) const
 Returns a single row of this matrix. More...
 
long * regina::Matrix2::operator[] (unsigned row)
 Returns a single row of this matrix. More...
 
Matrix2 regina::Matrix2::operator* (const Matrix2 &other) const
 Calculates the matrix product of this and the given matrix. More...
 
Matrix2 regina::Matrix2::operator* (long scalar) const
 Calculates the scalar product of this matrix and the given integer. More...
 
Matrix2 regina::Matrix2::operator+ (const Matrix2 &other) const
 Calculates the sum of two matrices. More...
 
Matrix2 regina::Matrix2::operator- (const Matrix2 &other) const
 Calculates the difference of two matrices. More...
 
Matrix2 regina::Matrix2::operator- () const
 Determines the negative of this matrix. More...
 
Matrix2 regina::Matrix2::transpose () const
 Returns the transpose of this matrix. More...
 
Matrix2 regina::Matrix2::inverse () const
 Calculates the inverse of this matrix. More...
 
Matrix2regina::Matrix2::operator+= (const Matrix2 &other)
 Adds the given matrix to this. More...
 
Matrix2regina::Matrix2::operator-= (const Matrix2 &other)
 Subtracts the given matrix from this. More...
 
Matrix2regina::Matrix2::operator*= (const Matrix2 &other)
 Multiplies this by the given matrix. More...
 
Matrix2regina::Matrix2::operator*= (long scalar)
 Multiplies this by the given scalar. More...
 
void regina::Matrix2::negate ()
 Negates this matrix. More...
 
bool regina::Matrix2::invert ()
 Inverts this matrix. More...
 
bool regina::Matrix2::operator== (const Matrix2 &compare) const
 Determines if this is equal to the given matrix. More...
 
bool regina::Matrix2::operator!= (const Matrix2 &compare) const
 Determines if this is not equal to the given matrix. More...
 
long regina::Matrix2::determinant () const
 Returns the determinant of this matrix. More...
 
bool regina::Matrix2::isIdentity () const
 Determines if this is the 2x2 identity matrix. More...
 
bool regina::Matrix2::isZero () const
 Determines if this is the 2x2 zero matrix. More...
 
std::ostream & regina::operator<< (std::ostream &out, const Matrix2 &mat)
 Writes the given matrix to the given output stream. More...
 
bool regina::simpler (const Matrix2 &m1, const Matrix2 &m2)
 Determines whether the first given matrix is more aesthetically pleasing than the second. More...
 
bool regina::simpler (const Matrix2 &pair1first, const Matrix2 &pair1second, const Matrix2 &pair2first, const Matrix2 &pair2second)
 Determines whether the first given pair of matrices is more aesthetically pleasing than the second pair. More...
 
void regina::smithNormalForm (MatrixInt &matrix)
 Transforms the given integer matrix into Smith normal form. More...
 
void regina::smithNormalForm (MatrixInt &matrix, MatrixInt &rowSpaceBasis, MatrixInt &rowSpaceBasisInv, MatrixInt &colSpaceBasis, MatrixInt &colSpaceBasisInv)
 A Smith normal form algorithm that also returns change of basis matrices. More...
 
void regina::metricalSmithNormalForm (MatrixInt &matrix, MatrixInt *rowSpaceBasis=0, MatrixInt *rowSpaceBasisInv=0, MatrixInt *colSpaceBasis=0, MatrixInt *colSpaceBasisInv=0)
 An alternative Smith normal form algorithm that also returns change of basis matrices. More...
 
unsigned regina::rowBasis (MatrixInt &matrix)
 Find a basis for the row space of the given matrix. More...
 
unsigned regina::rowBasisAndOrthComp (MatrixInt &input, MatrixInt &complement)
 Finds a basis for the row space of the given matrix, as well as an "incremental" basis for its orthogonal complement. More...
 
void regina::columnEchelonForm (MatrixInt &M, MatrixInt &R, MatrixInt &Ri, const std::vector< unsigned > &rowList)
 Transforms a given matrix into column echelon form with respect to a collection of rows. More...
 
std::unique_ptr< MatrixIntregina::preImageOfLattice (const MatrixInt &hom, const std::vector< Integer > &sublattice)
 Given a homomorphism from Z^n to Z^k and a sublattice of Z^k, compute the preimage of this sublattice under this homomorphism. More...
 
std::unique_ptr< MatrixIntregina::torsionAutInverse (const MatrixInt &input, const std::vector< Integer > &invF)
 Given an automorphism of an abelian group, this procedure computes the inverse automorphism. More...
 
long regina::reducedMod (long k, long modBase)
 Reduces k modulo modBase to give the smallest possible absolute value. More...
 
long regina::gcd (long a, long b)
 Calculates the greatest common divisor of two signed integers. More...
 
long regina::gcdWithCoeffs (long a, long b, long &u, long &v)
 Calculates the greatest common divisor of two given integers and finds the smallest coefficients with which these integers combine to give their gcd. More...
 
long regina::lcm (long a, long b)
 Calculates the lowest common multiple of two signed integers. More...
 
unsigned long regina::modularInverse (unsigned long n, unsigned long k)
 Calculates the multiplicative inverse of one integer modulo another. More...
 
constexpr char regina::digit (int i)
 Returns the character used to express the integer i in a permutation. More...
 
constexpr int64_t regina::factorial (int n)
 Returns the factorial of n. More...
 
 regina::Perm< n >::Perm ()
 Creates the identity permutation. More...
 
 regina::Perm< n >::Perm (int a, int b)
 Creates the transposition of a and b. More...
 
 regina::Perm< n >::Perm (const int *image)
 Creates a permutation mapping i to image[i] for each 0 ≤ i < n. More...
 
 regina::Perm< n >::Perm (const int *a, const int *b)
 Creates a permutation mapping (a[0], ..., a[n-1]) to (b[0], ..., b[n-1]) respectively. More...
 
 regina::Perm< n >::Perm (const Perm< n > &cloneMe)=default
 Creates a permutation that is a clone of the given permutation. More...
 
Code regina::Perm< n >::permCode () const
 Returns the internal code representing this permutation. More...
 
void regina::Perm< n >::setPermCode (Code code)
 Sets this permutation to that represented by the given internal code. More...
 
static Perm regina::Perm< n >::fromPermCode (Code code)
 Creates a permutation from the given internal code. More...
 
static bool regina::Perm< n >::isPermCode (Code newCode)
 Determines whether the given integer is a valid internal permutation code. More...
 
Permregina::Perm< n >::operator= (const Perm &cloneMe)=default
 Sets this permutation to be equal to the given permutation. More...
 
Perm regina::Perm< n >::operator* (const Perm &q) const
 Returns the composition of this permutation with the given permutation. More...
 
Perm regina::Perm< n >::inverse () const
 Finds the inverse of this permutation. More...
 
Perm regina::Perm< n >::reverse () const
 Finds the reverse of this permutation. More...
 
int regina::Perm< n >::sign () const
 Determines the sign of this permutation. More...
 
int regina::Perm< n >::operator[] (int source) const
 Determines the image of the given integer under this permutation. More...
 
int regina::Perm< n >::preImageOf (int image) const
 Determines the preimage of the given integer under this permutation. More...
 
bool regina::Perm< n >::operator== (const Perm &other) const
 Determines if this is equal to the given permutation. More...
 
bool regina::Perm< n >::operator!= (const Perm &other) const
 Determines if this differs from the given permutation. More...
 
int regina::Perm< n >::compareWith (const Perm &other) const
 Lexicographically compares the images of (0,1,...,n-1) under this and the given permutation. More...
 
bool regina::Perm< n >::isIdentity () const
 Determines if this is the identity permutation. More...
 
static Perm regina::Perm< n >::atIndex (Index i)
 Returns the ith permutation on n elements, where permutations are numbered lexicographically beginning at 0. More...
 
Index regina::Perm< n >::index () const
 Returns the lexicographical index of this permutation. More...
 
static Perm regina::Perm< n >::rand (bool even=false)
 Returns a random permutation on n elements. More...
 
template<class URBG >
static Perm regina::Perm< n >::rand (URBG &&gen, bool even=false)
 Returns a random permutation on n elements, using the given uniform random bit generator. More...
 
std::string regina::Perm< n >::str () const
 Returns a string representation of this permutation. More...
 
std::string regina::Perm< n >::trunc (unsigned len) const
 Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More...
 
void regina::Perm< n >::clear (unsigned from)
 Resets the images of all integers from from onwards to the identity map. More...
 
template<int k>
static Perm regina::Perm< n >::extend (Perm< k > p)
 Extends a k-element permutation to an n-element permutation, where 2 ≤ k < n. More...
 
template<int k>
static Perm regina::Perm< n >::contract (Perm< k > p)
 Restricts a k-element permutation to an n-element permutation, where k > n. More...
 
template<int n>
std::ostream & regina::operator<< (std::ostream &out, const Perm< n > &p)
 Writes a string representation of the given permutation to the given output stream. More...
 
 regina::Polynomial< T >::Polynomial ()
 Creates the zero polynomial. More...
 
 regina::Polynomial< T >::Polynomial (size_t degree)
 Creates the polynomial x^d for the given degree d. More...
 
 regina::Polynomial< T >::Polynomial (const Polynomial< T > &value)
 Creates a new copy of the given polynomial. More...
 
template<typename U >
 regina::Polynomial< T >::Polynomial (const Polynomial< U > &value)
 Creates a new copy of the given polynomial. More...
 
 regina::Polynomial< T >::Polynomial (Polynomial< T > &&value) noexcept
 Moves the contents of the given polynomial to this new polynomial. More...
 
template<typename iterator >
 regina::Polynomial< T >::Polynomial (iterator begin, iterator end)
 Creates a new polynomial from the given sequence of coefficients. More...
 
 regina::Polynomial< T >::Polynomial (std::initializer_list< T > coefficients)
 Creates a new polynomial from a hard-coded sequence of coefficients. More...
 
 regina::Polynomial< T >::~Polynomial ()
 Destroys this polynomial. More...
 
void regina::Polynomial< T >::init ()
 Sets this to become the zero polynomial. More...
 
void regina::Polynomial< T >::init (size_t degree)
 Sets this to become the polynomial x^d for the given degree d. More...
 
template<typename iterator >
void regina::Polynomial< T >::init (iterator begin, iterator end)
 Sets this to become the polynomial described by the given sequence of coefficients. More...
 
size_t regina::Polynomial< T >::degree () const
 Returns the degree of this polynomial. More...
 
bool regina::Polynomial< T >::isZero () const
 Returns whether this is the zero polynomial. More...
 
bool regina::Polynomial< T >::isMonic () const
 Returns whether this polynomial is monic. More...
 
const T & regina::Polynomial< T >::leading () const
 Returns the leading coefficient of this polynomial. More...
 
const T & regina::Polynomial< T >::operator[] (size_t exp) const
 Returns the given coefficient of this polynomial. More...
 
void regina::Polynomial< T >::set (size_t exp, const T &value)
 Changes the given coefficient of this polynomial. More...
 
bool regina::Polynomial< T >::operator== (const Polynomial< T > &rhs) const
 Tests whether this and the given polynomial are equal. More...
 
bool regina::Polynomial< T >::operator!= (const Polynomial< T > &rhs) const
 Tests whether this and the given polynomial are not equal. More...
 
Polynomialregina::Polynomial< T >::operator= (const Polynomial< T > &value)
 Sets this to be a copy of the given polynomial. More...
 
template<typename U >
Polynomialregina::Polynomial< T >::operator= (const Polynomial< U > &value)
 Sets this to be a copy of the given polynomial. More...
 
Polynomialregina::Polynomial< T >::operator= (Polynomial< T > &&value) noexcept
 Moves the contents of the given polynomial to this polynomial. More...
 
void regina::Polynomial< T >::swap (Polynomial< T > &other)
 Swaps the contents of this and the given polynomial. More...
 
void regina::Polynomial< T >::negate ()
 Negates this polynomial. More...
 
Polynomialregina::Polynomial< T >::operator*= (const T &scalar)
 Multiplies this polynomial by the given constant. More...
 
Polynomialregina::Polynomial< T >::operator/= (const T &scalar)
 Divides this polynomial by the given constant. More...
 
Polynomialregina::Polynomial< T >::operator+= (const Polynomial< T > &other)
 Adds the given polynomial to this. More...
 
Polynomialregina::Polynomial< T >::operator-= (const Polynomial< T > &other)
 Subtracts the given polynomial from this. More...
 
Polynomialregina::Polynomial< T >::operator*= (const Polynomial< T > &other)
 Multiplies this by the given polynomial. More...
 
Polynomialregina::Polynomial< T >::operator/= (const Polynomial< T > &other)
 Divides this by the given polynomial. More...
 
void regina::Polynomial< T >::divisionAlg (const Polynomial< T > &divisor, Polynomial< T > &quotient, Polynomial< T > &remainder) const
 Divides this by the given divisor, and extracts both the quotient and the remainder. More...
 
template<typename U >
void regina::Polynomial< T >::gcdWithCoeffs (const Polynomial< U > &other, Polynomial< T > &gcd, Polynomial< T > &u, Polynomial< T > &v) const
 Calculates the greatest common divisor of this and the given polynomial, and finds a linear combination of these polynomials that gives this gcd. More...
 
void regina::Polynomial< T >::writeTextShort (std::ostream &out, bool utf8=false, const char *variable=0) const
 Writes this polynomial to the given output stream, using the given variable name instead of x. More...
 
std::string regina::Polynomial< T >::str (const char *variable) const
 Returns this polynomial as a human-readable string, using the given variable name instead of x. More...
 
std::string regina::Polynomial< T >::utf8 (const char *variable) const
 Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x. More...
 
template<typename T >
Polynomial< T > regina::operator* (Polynomial< T > poly, const typename Polynomial< T >::Coefficient &scalar)
 Multiplies the given polynomial by the given scalar constant. More...
 
template<typename T >
Polynomial< T > regina::operator* (const typename Polynomial< T >::Coefficient &scalar, Polynomial< T > poly)
 Multiplies the given polynomial by the given scalar constant. More...
 
template<typename T >
Polynomial< T > regina::operator/ (Polynomial< T > poly, const typename Polynomial< T >::Coefficient &scalar)
 Divides the given polynomial by the given scalar constant. More...
 
template<typename T >
Polynomial< T > regina::operator+ (const Polynomial< T > &lhs, const Polynomial< T > &rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator+ (Polynomial< T > &&lhs, const Polynomial< T > &rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator+ (const Polynomial< T > &lhs, Polynomial< T > &&rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator+ (Polynomial< T > &&lhs, Polynomial< T > &&rhs)
 Adds the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator- (Polynomial< T > arg)
 Returns the negative of the given polynomial. More...
 
template<typename T >
Polynomial< T > regina::operator- (const Polynomial< T > &lhs, const Polynomial< T > &rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator- (Polynomial< T > &&lhs, const Polynomial< T > &rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator- (const Polynomial< T > &lhs, Polynomial< T > &&rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator- (Polynomial< T > &&lhs, Polynomial< T > &&rhs)
 Subtracts the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator* (const Polynomial< T > &lhs, const Polynomial< T > &rhs)
 Multiplies the two given polynomials. More...
 
template<typename T >
Polynomial< T > regina::operator/ (Polynomial< T > lhs, const Polynomial< T > &rhs)
 Divides the two given polynomials. More...
 
static unsigned long regina::Primes::size ()
 Returns the number of primes (or suspected primes) currently stored. More...
 
static Integer regina::Primes::prime (unsigned long which, bool autoGrow=true)
 Returns the requested prime (or suspected prime). More...
 
static std::vector< Integerregina::Primes::primeDecomp (const Integer &n)
 Returns the prime factorisation of the given integer as a list of individual primes (or suspected primes). More...
 
static std::vector< std::pair< Integer, unsigned long > > regina::Primes::primePowerDecomp (const Integer &n)
 Returns the prime factorisation of the given integer as a list of prime powers (or suspected prime powers). More...
 
 regina::Rational::Rational ()
 Initialises to 0/1. More...
 
 regina::Rational::Rational (const Rational &value)
 Initialises to the given rational value. More...
 
template<bool supportInfinity>
 regina::Rational::Rational (const IntegerBase< supportInfinity > &value)
 Initialises to the given integer value. More...
 
 regina::Rational::Rational (long value)
 Initialises to the given integer value. More...
 
template<bool supportInfinity>
 regina::Rational::Rational (const IntegerBase< supportInfinity > &newNum, const IntegerBase< supportInfinity > &newDen)
 Initialises to newNum/newDen. More...
 
 regina::Rational::Rational (long newNum, unsigned long newDen)
 Initialises to newNum/newDen. More...
 
 regina::Rational::~Rational ()
 Destroys this rational. More...
 
Rationalregina::Rational::operator= (const Rational &value)
 Sets this rational to the given rational value. More...
 
template<bool supportInfinity>
Rationalregina::Rational::operator= (const IntegerBase< supportInfinity > &value)
 Sets this rational to the given integer value. More...
 
Rationalregina::Rational::operator= (long value)
 Sets this rational to the given integer value. More...
 
void regina::Rational::swap (Rational &other)
 Swaps the values of this and the given rational. More...
 
Integer regina::Rational::numerator () const
 Returns the numerator of this rational. More...
 
Integer regina::Rational::denominator () const
 Returns the denominator of this rational. More...
 
Rational regina::Rational::operator* (const Rational &r) const
 Calculates the product of two rationals. More...
 
Rational regina::Rational::operator/ (const Rational &r) const
 Calculates the ratio of two rationals. More...
 
Rational regina::Rational::operator+ (const Rational &r) const
 Calculates the sum of two rationals. More...
 
Rational regina::Rational::operator- (const Rational &r) const
 Calculates the difference of two rationals. More...
 
Rational regina::Rational::operator- () const
 Determines the negative of this rational. More...
 
Rational regina::Rational::inverse () const
 Calculates the inverse of this rational. More...
 
Rational regina::Rational::abs () const
 Determines the absolute value of this rational. More...
 
Rationalregina::Rational::operator+= (const Rational &other)
 Adds the given rational to this. More...
 
Rationalregina::Rational::operator-= (const Rational &other)
 Subtracts the given rational from this. More...
 
Rationalregina::Rational::operator*= (const Rational &other)
 Multiplies the given rational by this. More...
 
Rationalregina::Rational::operator/= (const Rational &other)
 Divides this by the given rational. More...
 
void regina::Rational::negate ()
 Negates this rational. More...
 
void regina::Rational::invert ()
 Inverts this rational. More...
 
bool regina::Rational::operator== (const Rational &compare) const
 Determines if this is equal to the given rational. More...
 
bool regina::Rational::operator!= (const Rational &compare) const
 Determines if this is not equal to the given rational. More...
 
bool regina::Rational::operator< (const Rational &compare) const
 Determines if this is less than the given rational. More...
 
bool regina::Rational::operator> (const Rational &compare) const
 Determines if this is greater than the given rational. More...
 
bool regina::Rational::operator<= (const Rational &compare) const
 Determines if this is less than or equal to the given rational. More...
 
bool regina::Rational::operator>= (const Rational &compare) const
 Determines if this is greater than or equal to the given rational. More...
 
double regina::Rational::doubleApprox (bool *inRange=0) const
 Attempts to convert this rational to a real number. More...
 
std::string regina::Rational::TeX () const
 Returns this rational as written using TeX formatting. More...
 
std::ostream & regina::Rational::writeTeX (std::ostream &out) const
 Writes this rational in TeX format to the given output stream. More...
 
std::ostream & regina::operator<< (std::ostream &out, const Rational &rat)
 Writes the given rational to the given output stream. More...
 
 regina::Ray::Ray (size_t length)
 Creates a new ray all of whose coordinates are initialised to zero. More...
 
 regina::Ray::Ray (const Vector< LargeInteger > &cloneMe)
 Creates a new ray that is a clone of the given ray. More...
 
void regina::Ray::scaleDown ()
 Scales this vector down by the greatest common divisor of all its elements. More...
 
void regina::Ray::negate ()
 Negates every element of this vector. More...
 
 regina::Perm< 2 >::Perm ()
 Creates the identity permutation. More...
 
 regina::Perm< 2 >::Perm (int a, int b)
 Creates the transposition of a and b. More...
 
 regina::Perm< 2 >::Perm (const int *image)
 Creates a permutation mapping i to image[i] for each i = 0,1. More...
 
 regina::Perm< 2 >::Perm (const int *a, const int *b)
 Creates a permutation mapping (a[0], a[1]) to (b[0], b[1]) respectively. More...
 
 regina::Perm< 2 >::Perm (const Perm< 2 > &cloneMe)=default
 Creates a permutation that is a clone of the given permutation. More...
 
Code regina::Perm< 2 >::permCode () const
 Returns the internal code representing this permutation. More...
 
void regina::Perm< 2 >::setPermCode (Code code)
 Sets this permutation to that represented by the given internal code. More...
 
static Perm< 2 > regina::Perm< 2 >::fromPermCode (Code code)
 Creates a permutation from the given internal code. More...
 
static bool regina::Perm< 2 >::isPermCode (Code code)
 Determines whether the given integer is a valid internal permutation code. More...
 
Perm< 2 > & regina::Perm< 2 >::operator= (const Perm< 2 > &cloneMe)=default
 Sets this permutation to be equal to the given permutation. More...
 
Perm< 2 > regina::Perm< 2 >::operator* (const Perm< 2 > &q) const
 Returns the composition of this permutation with the given permutation. More...
 
Perm< 2 > regina::Perm< 2 >::inverse () const
 Finds the inverse of this permutation. More...
 
Perm< 2 > regina::Perm< 2 >::reverse () const
 Finds the reverse of this permutation. More...
 
int regina::Perm< 2 >::sign () const
 Determines the sign of this permutation. More...
 
int regina::Perm< 2 >::operator[] (int source) const
 Determines the image of the given integer under this permutation. More...
 
int regina::Perm< 2 >::preImageOf (int image) const
 Determines the preimage of the given integer under this permutation. More...
 
bool regina::Perm< 2 >::operator== (const Perm< 2 > &other) const
 Determines if this is equal to the given permutation. More...
 
bool regina::Perm< 2 >::operator!= (const Perm< 2 > &other) const
 Determines if this differs from the given permutation. More...
 
int regina::Perm< 2 >::compareWith (const Perm< 2 > &other) const
 Lexicographically compares the images of (0,1) under this and the given permutation. More...
 
bool regina::Perm< 2 >::isIdentity () const
 Determines if this is the identity permutation. More...
 
static Perm regina::Perm< 2 >::atIndex (Index i)
 Returns the ith permutation on two elements, where permutations are numbered lexicographically beginning at 0. More...
 
static Perm regina::Perm< 2 >::rand (bool even=false)
 Returns a random permutation on two elements. More...
 
template<class URBG >
static Perm regina::Perm< 2 >::rand (URBG &&gen, bool even=false)
 Returns a random permutation on two elements, using the given uniform random bit generator. More...
 
Index regina::Perm< 2 >::index () const
 Returns the lexicographical index of this permutation. More...
 
std::string regina::Perm< 2 >::str () const
 Returns a string representation of this permutation. More...
 
std::string regina::Perm< 2 >::trunc (unsigned len) const
 Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More...
 
void regina::Perm< 2 >::clear (unsigned from)
 Resets the images of all integers from from onwards to the identity map. More...
 
int regina::Perm< 2 >::S2Index () const
 Returns the index of this permutation in the Perm<2>::S2 array. More...
 
int regina::Perm< 2 >::SnIndex () const
 Returns the index of this permutation in the Perm<2>::S2 array. More...
 
int regina::Perm< 2 >::orderedS2Index () const
 Returns the index of this permutation in the Perm<2>::orderedS2 array. More...
 
int regina::Perm< 2 >::orderedSnIndex () const
 Returns the index of this permutation in the Perm<2>::orderedS2 array. More...
 
template<int k>
static Perm< 2 > regina::Perm< 2 >::contract (Perm< k > p)
 Restricts a k-element permutation to an 2-element permutation, where k > 2. More...
 
 regina::Perm< 3 >::Perm ()
 Creates the identity permutation. More...
 
 regina::Perm< 3 >::Perm (int a, int b)
 Creates the transposition of a and b. More...
 
 regina::Perm< 3 >::Perm (int a, int b, int c)
 Creates a permutation mapping (0,1,2) to (a,b,c) respectively. More...
 
 regina::Perm< 3 >::Perm (const int *image)
 Creates a permutation mapping i to image[i] for each i = 0,1,2. More...
 
 regina::Perm< 3 >::Perm (const int *a, const int *b)
 Creates a permutation mapping (a[0], ..., a[2]) to (b[0], ..., b[2]) respectively. More...
 
 regina::Perm< 3 >::Perm (const Perm< 3 > &cloneMe)=default
 Creates a permutation that is a clone of the given permutation. More...
 
Code regina::Perm< 3 >::permCode () const
 Returns the internal code representing this permutation. More...
 
void regina::Perm< 3 >::setPermCode (Code code)
 Sets this permutation to that represented by the given internal code. More...
 
static Perm< 3 > regina::Perm< 3 >::fromPermCode (Code code)
 Creates a permutation from the given internal code. More...
 
static bool regina::Perm< 3 >::isPermCode (Code code)
 Determines whether the given integer is a valid internal permutation code. More...
 
Perm< 3 > & regina::Perm< 3 >::operator= (const Perm< 3 > &cloneMe)=default
 Sets this permutation to be equal to the given permutation. More...
 
Perm< 3 > regina::Perm< 3 >::operator* (const Perm< 3 > &q) const
 Returns the composition of this permutation with the given permutation. More...
 
Perm< 3 > regina::Perm< 3 >::inverse () const
 Finds the inverse of this permutation. More...
 
Perm< 3 > regina::Perm< 3 >::reverse () const
 Finds the reverse of this permutation. More...
 
int regina::Perm< 3 >::sign () const
 Determines the sign of this permutation. More...
 
int regina::Perm< 3 >::operator[] (int source) const
 Determines the image of the given integer under this permutation. More...
 
int regina::Perm< 3 >::preImageOf (int image) const
 Determines the preimage of the given integer under this permutation. More...
 
bool regina::Perm< 3 >::operator== (const Perm< 3 > &other) const
 Determines if this is equal to the given permutation. More...
 
bool regina::Perm< 3 >::operator!= (const Perm< 3 > &other) const
 Determines if this differs from the given permutation. More...
 
int regina::Perm< 3 >::compareWith (const Perm< 3 > &other) const
 Lexicographically compares the images of (0,1,2) under this and the given permutation. More...
 
bool regina::Perm< 3 >::isIdentity () const
 Determines if this is the identity permutation. More...
 
static Perm regina::Perm< 3 >::atIndex (Index i)
 Returns the ith permutation on three elements, where permutations are numbered lexicographically beginning at 0. More...
 
static Perm regina::Perm< 3 >::rand (bool even=false)
 Returns a random permutation on three elements. More...
 
template<class URBG >
static Perm regina::Perm< 3 >::rand (URBG &&gen, bool even=false)
 Returns a random permutation on three elements, using the given uniform random bit generator. More...
 
Index regina::Perm< 3 >::index () const
 Returns the lexicographical index of this permutation. More...
 
std::string regina::Perm< 3 >::str () const
 Returns a string representation of this permutation. More...
 
std::string regina::Perm< 3 >::trunc (unsigned len) const
 Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More...
 
std::string regina::Perm< 3 >::trunc2 () const
 Returns a string representation of this permutation with only the images of 0 and 1. More...
 
void regina::Perm< 3 >::clear (unsigned from)
 Resets the images of all integers from from onwards to the identity map. More...
 
int regina::Perm< 3 >::S3Index () const
 Returns the index of this permutation in the Perm<3>::S3 array. More...
 
int regina::Perm< 3 >::SnIndex () const
 Returns the index of this permutation in the Perm<3>::S3 array. More...
 
REGINA_INLINE_REQUIRED int regina::Perm< 3 >::orderedS3Index () const
 Returns the index of this permutation in the Perm<3>::orderedS3 array. More...
 
int regina::Perm< 3 >::orderedSnIndex () const
 Returns the index of this permutation in the Perm<3>::orderedS3 array. More...
 
template<int k>
static Perm< 3 > regina::Perm< 3 >::extend (Perm< k > p)
 Extends a k-element permutation to an 3-element permutation. More...
 
template<int k>
static Perm< 3 > regina::Perm< 3 >::contract (Perm< k > p)
 Restricts a k-element permutation to an 3-element permutation, where k > 3. More...
 
 regina::Perm< 4 >::Perm ()
 Creates the identity permutation. More...
 
 regina::Perm< 4 >::Perm (int a, int b)
 Creates the transposition of a and b. More...
 
 regina::Perm< 4 >::Perm (int a, int b, int c, int d)
 Creates a permutation mapping (0,1,2,3) to (a,b,c,d) respectively. More...
 
 regina::Perm< 4 >::Perm (const int *image)
 Creates a permutation mapping i to image[i] for each i = 0,1,2,3. More...
 
 regina::Perm< 4 >::Perm (const int *a, const int *b)
 Creates a permutation mapping (a[0], ..., a[3]) to (b[0], ..., b[3]) respectively. More...
 
 regina::Perm< 4 >::Perm (int a0, int a1, int b0, int b1, int c0, int c1, int d0, int d1)
 Creates a permutation mapping (a0,b0,c0,d0) to (a1,b1,c1,d1) respectively. More...
 
 regina::Perm< 4 >::Perm (const Perm< 4 > &cloneMe)=default
 Creates a permutation that is a clone of the given permutation. More...
 
Code regina::Perm< 4 >::permCode () const
 Returns the first-generation code representing this permutation. More...
 
Code regina::Perm< 4 >::permCode2 () const
 Returns the second-generation code representing this permutation. More...
 
void regina::Perm< 4 >::setPermCode (Code code)
 Sets this permutation to that represented by the given first-generation permutation code. More...
 
void regina::Perm< 4 >::setPermCode2 (Code code)
 Sets this permutation to that represented by the given second-generation permutation code. More...
 
static Perm< 4 > regina::Perm< 4 >::fromPermCode (Code code)
 Creates a permutation from the given first-generation permutation code. More...
 
static Perm< 4 > regina::Perm< 4 >::fromPermCode2 (Code code)
 Creates a permutation from the given second-generation permutation code. More...
 
static bool regina::Perm< 4 >::isPermCode (Code code)
 Determines whether the given character is a valid first-generation permutation code. More...
 
static bool regina::Perm< 4 >::isPermCode2 (Code code)
 Determines whether the given character is a valid second-generation permutation code. More...
 
Perm< 4 > & regina::Perm< 4 >::operator= (const Perm< 4 > &cloneMe)=default
 Sets this permutation to be equal to the given permutation. More...
 
Perm< 4 > regina::Perm< 4 >::operator* (const Perm< 4 > &q) const
 Returns the composition of this permutation with the given permutation. More...
 
Perm< 4 > regina::Perm< 4 >::inverse () const
 Finds the inverse of this permutation. More...
 
Perm< 4 > regina::Perm< 4 >::reverse () const
 Finds the reverse of this permutation. More...
 
int regina::Perm< 4 >::sign () const
 Determines the sign of this permutation. More...
 
int regina::Perm< 4 >::operator[] (int source) const
 Determines the image of the given integer under this permutation. More...
 
int regina::Perm< 4 >::preImageOf (int image) const
 Determines the preimage of the given integer under this permutation. More...
 
bool regina::Perm< 4 >::operator== (const Perm< 4 > &other) const
 Determines if this is equal to the given permutation. More...
 
bool regina::Perm< 4 >::operator!= (const Perm< 4 > &other) const
 Determines if this differs from the given permutation. More...
 
int regina::Perm< 4 >::compareWith (const Perm< 4 > &other) const
 Lexicographically compares the images of (0,1,2,3) under this and the given permutation. More...
 
bool regina::Perm< 4 >::isIdentity () const
 Determines if this is the identity permutation. More...
 
static Perm regina::Perm< 4 >::atIndex (Index i)
 Returns the ith permutation on four elements, where permutations are numbered lexicographically beginning at 0. More...
 
Index regina::Perm< 4 >::index () const
 Returns the lexicographical index of this permutation. More...
 
static Perm regina::Perm< 4 >::rand (bool even=false)
 Returns a random permutation on four elements. More...
 
template<class URBG >
static Perm regina::Perm< 4 >::rand (URBG &&gen, bool even=false)
 Returns a random permutation on four elements, using the given uniform random bit generator. More...
 
std::string regina::Perm< 4 >::str () const
 Returns a string representation of this permutation. More...
 
std::string regina::Perm< 4 >::trunc (unsigned len) const
 Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More...
 
std::string regina::Perm< 4 >::trunc2 () const
 Returns a string representation of this permutation with only the images of 0 and 1. More...
 
std::string regina::Perm< 4 >::trunc3 () const
 Returns a string representation of this permutation with only the images of 0, 1 and 2 included. More...
 
void regina::Perm< 4 >::clear (unsigned from)
 Resets the images of all integers from from onwards to the identity map. More...
 
int regina::Perm< 4 >::S4Index () const
 Returns the index of this permutation in the Perm<4>::S4 array. More...
 
int regina::Perm< 4 >::SnIndex () const
 Returns the index of this permutation in the Perm<4>::S4 array. More...
 
REGINA_INLINE_REQUIRED int regina::Perm< 4 >::orderedS4Index () const
 Returns the index of this permutation in the Perm<4>::orderedS4 array. More...
 
int regina::Perm< 4 >::orderedSnIndex () const
 Returns the index of this permutation in the Perm<4>::orderedS4 array. More...
 
template<int k>
static Perm< 4 > regina::Perm< 4 >::extend (Perm< k > p)
 Extends a k-element permutation to a 4-element permutation, where 2 ≤ k < 4. More...
 
template<int k>
static Perm< 4 > regina::Perm< 4 >::contract (Perm< k > p)
 Restricts a k-element permutation to an 4-element permutation, where k > 4. More...
 
 regina::Perm< 5 >::Perm ()
 Creates the identity permutation. More...
 
 regina::Perm< 5 >::Perm (int a, int b)
 Creates the transposition of a and b. More...
 
 regina::Perm< 5 >::Perm (int a, int b, int c, int d, int e)
 Creates a permutation mapping (0,1,2,3,4) to (a,b,c,d,e) respectively. More...
 
 regina::Perm< 5 >::Perm (const int *image)
 Creates a permutation mapping i to image[i] for each i = 0,1,2,3,4. More...
 
 regina::Perm< 5 >::Perm (const int *a, const int *b)
 Creates a permutation mapping (a[0], ..., a[4]) to (b[0], ..., b[4]) respectively. More...
 
 regina::Perm< 5 >::Perm (int a0, int a1, int b0, int b1, int c0, int c1, int d0, int d1, int e0, int e1)
 Creates a permutation mapping (a0,b0,c0,d0,e0) to (a1,b1,c1,d1,e1) respectively. More...
 
 regina::Perm< 5 >::Perm (const Perm< 5 > &cloneMe)=default
 Creates a permutation that is a clone of the given permutation. More...
 
Code regina::Perm< 5 >::permCode () const
 Returns the internal code representing this permutation. More...
 
void regina::Perm< 5 >::setPermCode (Code newCode)
 Sets this permutation to that represented by the given internal code. More...
 
static Perm< 5 > regina::Perm< 5 >::fromPermCode (Code newCode)
 Creates a permutation from the given internal code. More...
 
static bool regina::Perm< 5 >::isPermCode (Code newCode)
 Determines whether the given integer is a valid internal permutation code. More...
 
Perm< 5 > & regina::Perm< 5 >::operator= (const Perm< 5 > &cloneMe)=default
 Sets this permutation to be equal to the given permutation. More...
 
Perm< 5 > regina::Perm< 5 >::operator* (const Perm< 5 > &q) const
 Returns the composition of this permutation with the given permutation. More...
 
Perm< 5 > regina::Perm< 5 >::inverse () const
 Finds the inverse of this permutation. More...
 
Perm< 5 > regina::Perm< 5 >::reverse () const
 Finds the reverse of this permutation. More...
 
int regina::Perm< 5 >::sign () const
 Determines the sign of this permutation. More...
 
REGINA_INLINE_REQUIRED int regina::Perm< 5 >::operator[] (int source) const
 Determines the image of the given integer under this permutation. More...
 
int regina::Perm< 5 >::preImageOf (int image) const
 Determines the preimage of the given integer under this permutation. More...
 
bool regina::Perm< 5 >::operator== (const Perm< 5 > &other) const
 Determines if this is equal to the given permutation. More...
 
bool regina::Perm< 5 >::operator!= (const Perm< 5 > &other) const
 Determines if this differs from the given permutation. More...
 
int regina::Perm< 5 >::compareWith (const Perm< 5 > &other) const
 Lexicographically compares the images of (0,1,2,3,4) under this and the given permutation. More...
 
bool regina::Perm< 5 >::isIdentity () const
 Determines if this is the identity permutation. More...
 
static Perm regina::Perm< 5 >::atIndex (Index i)
 Returns the ith permutation on five elements, where permutations are numbered lexicographically beginning at 0. More...
 
Index regina::Perm< 5 >::index () const
 Returns the lexicographical index of this permutation. More...
 
static Perm regina::Perm< 5 >::rand (bool even=false)
 Returns a random permutation on five elements. More...
 
template<class URBG >
static Perm regina::Perm< 5 >::rand (URBG &&gen, bool even=false)
 Returns a random permutation on five elements, using the given uniform random bit generator. More...
 
std::string regina::Perm< 5 >::str () const
 Returns a string representation of this permutation. More...
 
std::string regina::Perm< 5 >::trunc (unsigned len) const
 Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More...
 
std::string regina::Perm< 5 >::trunc2 () const
 Returns a string representation of this permutation with only the images of 0 and 1. More...
 
std::string regina::Perm< 5 >::trunc3 () const
 Returns a string representation of this permutation with only the images of 0, 1 and 2. More...
 
std::string regina::Perm< 5 >::trunc4 () const
 Returns a string representation of this permutation with only the images of 0, 1, 2 and 3. More...
 
void regina::Perm< 5 >::clear (unsigned from)
 Resets the images of all integers from from onwards to the identity map. More...
 
int regina::Perm< 5 >::S5Index () const
 Returns the index of this permutation in the Perm<5>::S5 array. More...
 
int regina::Perm< 5 >::SnIndex () const
 Returns the index of this permutation in the Perm<5>::S5 array. More...
 
int regina::Perm< 5 >::orderedS5Index () const
 Returns the index of this permutation in the Perm<5>::orderedS5 array. More...
 
int regina::Perm< 5 >::orderedSnIndex () const
 Returns the index of this permutation in the Perm<5>::orderedS5 array. More...
 
template<int k>
static Perm< 5 > regina::Perm< 5 >::extend (Perm< k > p)
 Extends a k-element permutation to a 5-element permutation, where 2 ≤ k < 5. More...
 
template<int k>
static Perm< 5 > regina::Perm< 5 >::contract (Perm< k > p)
 Restricts a k-element permutation to an 5-element permutation, where k > 5. More...
 
 regina::Vector< T >::Vector (size_t newVectorSize)
 Creates a new vector. More...
 
 regina::Vector< T >::Vector (size_t newVectorSize, const T &initValue)
 Creates a new vector and initialises every element to the given value. More...
 
 regina::Vector< T >::Vector (const Vector< T > &cloneMe)
 Creates a new vector that is a clone of the given vector. More...
 
 regina::Vector< T >::~Vector ()
 Destroys this vector. More...
 
size_t regina::Vector< T >::size () const
 Returns the number of elements in the vector. More...
 
const T & regina::Vector< T >::operator[] (size_t index) const
 Returns the element at the given index in the vector. More...
 
void regina::Vector< T >::setElement (size_t index, const T &value)
 Sets the element at the given index in the vector to the given value. More...
 
bool regina::Vector< T >::operator== (const Vector< T > &compare) const
 Determines if this vector is equal to the given vector. More...
 
Vector< T > & regina::Vector< T >::operator= (const Vector< T > &cloneMe)
 Sets this vector equal to the given vector. More...
 
void regina::Vector< T >::operator+= (const Vector< T > &other)
 Adds the given vector to this vector. More...
 
void regina::Vector< T >::operator-= (const Vector< T > &other)
 Subtracts the given vector from this vector. More...
 
void regina::Vector< T >::operator*= (const T &factor)
 Multiplies this vector by the given scalar. More...
 
regina::Vector< T >::operator* (const Vector< T > &other) const
 Calculates the dot product of this vector and the given vector. More...
 
void regina::Vector< T >::negate ()
 Negates every element of this vector. More...
 
regina::Vector< T >::norm () const
 Returns the norm of this vector. More...
 
regina::Vector< T >::elementSum () const
 Returns the sum of all elements of this vector. More...
 
void regina::Vector< T >::addCopies (const Vector< T > &other, const T &multiple)
 Adds the given multiple of the given vector to this vector. More...
 
void regina::Vector< T >::subtractCopies (const Vector< T > &other, const T &multiple)
 Subtracts the given multiple of the given vector to this vector. More...
 
template<class T >
std::ostream & regina::operator<< (std::ostream &out, const Vector< T > &vector)
 Writes the given vector to the given output stream. More...
 

Variables

const double regina::epsilon
 Deprecated constant for managing floating-point roundoff errors. More...
 
const int *const regina::detail::binomSmall_ [17]
 A lookup table that stores (n choose k) for all n16. More...
 
static const IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::zero
 Globally available zero. More...
 
static const IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::one
 Globally available one. More...
 
static const IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::infinity
 Globally available infinity. More...
 
static const T regina::MatrixRingIdentities< T, ring >::zero
 The additive identity in the underlying ring. More...
 
static const T regina::MatrixRingIdentities< T, ring >::one
 The multiplicative identity in the underlying ring. More...
 
const T & regina::Matrix< T, ring >::divBy
 
static constexpr int regina::Perm< n >::imageBits = regina::bitsRequired(n)
 Indicates the number of bits used by the permutation code to store the image of a single integer. More...
 
static constexpr Index regina::Perm< n >::nPerms = factorial(n)
 The total number of permutations on n elements. More...
 
static constexpr Index regina::Perm< n >::nPerms_1 = factorial(n-1)
 The total number of permutations on n-1 elements. More...
 
static const Rational regina::Rational::zero
 Globally available zero. More...
 
static const Rational regina::Rational::one
 Globally available one. More...
 
static const Rational regina::Rational::infinity
 Globally available infinity. More...
 
static const Rational regina::Rational::undefined
 Globally available undefined. More...
 
static const Index regina::Perm< 2 >::nPerms = 2
 The total number of permutations on two elements. More...
 
static const Index regina::Perm< 2 >::nPerms_1 = 1
 The total number of permutations on one element. More...
 
static const Perm< 2 > regina::Perm< 2 >::S2 [2]
 Contains all possible permutations of two elements. More...
 
static const Perm< 2 > * regina::Perm< 2 >::Sn
 A dimension-agnostic alias for Perm<2>::S2. More...
 
static const unsigned regina::Perm< 2 >::invS2 [2]
 Contains the inverses of the permutations in the array S2. More...
 
static const unsigned * regina::Perm< 2 >::invSn
 A dimension-agnostic alias for Perm<2>::invS2. More...
 
static const Perm< 2 > * regina::Perm< 2 >::orderedS2
 Contains all possible permutations of two elements in lexicographical order. More...
 
static const Perm< 2 > * regina::Perm< 2 >::orderedSn
 A dimension-agnostic alias for Perm<2>::orderedS2. More...
 
static const Perm< 2 > * regina::Perm< 2 >::S1
 Contains all possible permutations of one element. More...
 
static const Perm< 2 > * regina::Perm< 2 >::Sn_1
 A dimension-agnostic alias for Perm<2>::S1. More...
 
static const Index regina::Perm< 3 >::nPerms = 6
 The total number of permutations on three elements. More...
 
static const Index regina::Perm< 3 >::nPerms_1 = 2
 The total number of permutations on two elements. More...
 
static const Perm< 3 > regina::Perm< 3 >::S3 [6]
 Contains all possible permutations of three elements. More...
 
static const Perm< 3 > * regina::Perm< 3 >::Sn
 A dimension-agnostic alias for Perm<3>::S3. More...
 
static const unsigned regina::Perm< 3 >::invS3 [6]
 Contains the inverses of the permutations in the array S3. More...
 
static const unsigned * regina::Perm< 3 >::invSn
 A dimension-agnostic alias for Perm<3>::invS3. More...
 
static const Perm< 3 > regina::Perm< 3 >::orderedS3 [6]
 Contains all possible permutations of three elements in lexicographical order. More...
 
static const Perm< 3 > * regina::Perm< 3 >::orderedSn
 A dimension-agnostic alias for Perm<3>::orderedS3. More...
 
static const Perm< 3 > regina::Perm< 3 >::S2 [2]
 Contains all possible permutations of two elements. More...
 
static const Perm< 3 > * regina::Perm< 3 >::Sn_1
 A dimension-agnostic alias for Perm<3>::S2. More...
 
static const Index regina::Perm< 4 >::nPerms = 24
 The total number of permutations on four elements. More...
 
static const Index regina::Perm< 4 >::nPerms_1 = 6
 The total number of permutations on three elements. More...
 
static const Perm< 4 > regina::Perm< 4 >::S4 [24]
 Contains all possible permutations of four elements. More...
 
static const Perm< 4 > * regina::Perm< 4 >::Sn
 A dimension-agnostic alias for Perm<4>::S4. More...
 
static const unsigned regina::Perm< 4 >::invS4 [24]
 Contains the inverses of the permutations in the array S4. More...
 
static const unsigned * regina::Perm< 4 >::invSn
 A dimension-agnostic alias for Perm<4>::invS4. More...
 
static const Perm< 4 > regina::Perm< 4 >::orderedS4 [24]
 Contains all possible permutations of four elements in lexicographical order. More...
 
static const Perm< 4 > * regina::Perm< 4 >::orderedSn
 A dimension-agnostic alias for Perm<4>::orderedS4. More...
 
static const Perm< 4 > regina::Perm< 4 >::S3 [6]
 Contains all possible permutations of three elements. More...
 
static const Perm< 4 > * regina::Perm< 4 >::Sn_1
 A dimension-agnostic alias for Perm<4>::S3. More...
 
static const Perm< 4 > regina::Perm< 4 >::orderedS3 [6]
 Contains all possible permutations of three elements in lexicographical order. More...
 
static const Perm< 4 > regina::Perm< 4 >::S2 [2]
 Contains all possible permutations of two elements. More...
 
static const Index regina::Perm< 5 >::nPerms = 120
 The total number of permutations on five elements. More...
 
static const Index regina::Perm< 5 >::nPerms_1 = 24
 The total number of permutations on four elements. More...
 
static const int regina::Perm< 5 >::imageBits = 3
 Indicates the number of bits used by the permutation code to store the image of a single integer. More...
 
static const Perm< 5 > regina::Perm< 5 >::S5 [120]
 Contains all possible permutations of five elements. More...
 
static const Perm< 5 > * regina::Perm< 5 >::Sn
 A dimension-agnostic alias for Perm<5>::S5. More...
 
static const Perm< 5 > regina::Perm< 5 >::orderedS5 [120]
 Contains all possible permutations of five elements in lexicographical order. More...
 
static const Perm< 5 > * regina::Perm< 5 >::orderedSn
 A dimension-agnostic alias for Perm<5>::orderedS5. More...
 
static const unsigned regina::Perm< 5 >::invS5 [120]
 Contains the inverses of the permutations in the array S5. More...
 
static const unsigned * regina::Perm< 5 >::invSn
 A dimension-agnostic alias for Perm<5>::invS5. More...
 
static const Perm< 5 > regina::Perm< 5 >::S4 [24]
 Contains all possible permutations of four elements. More...
 
static const Perm< 5 > * regina::Perm< 5 >::Sn_1
 A dimension-agnostic alias for Perm<5>::S4. More...
 
static const Perm< 5 > regina::Perm< 5 >::orderedS4 [24]
 Contains all possible permutations of four elements in lexicographical order. More...
 
static const Perm< 5 > regina::Perm< 5 >::S3 [6]
 Contains all possible permutations of three elements. More...
 
static const Perm< 5 > regina::Perm< 5 >::orderedS3 [6]
 Contains all possible permutations of three elements in lexicographical order. More...
 
static const Perm< 5 > regina::Perm< 5 >::S2 [2]
 Contains all possible permutations of two elements. More...
 
static T regina::Vector< T >::zero
 Zero in the underlying number system. More...
 
static T regina::Vector< T >::one
 One in the underlying number system. More...
 
static T regina::Vector< T >::minusOne
 Negative one in the underlying number system. More...
 
T * regina::Vector< T >::elements
 The internal array containing all vector elements. More...
 
T * regina::Vector< T >::end
 A pointer just beyond the end of the internal array. More...
 

Friends

template<int bytes>
class regina::IntegerBase< supportInfinity >::NativeInteger
 
class regina::Laurent2< T >::Link
 
Cyclotomic regina::Cyclotomic::operator+ (const Cyclotomic &, const Cyclotomic &)
 Adds the two given cyclotomic field elements. More...
 
Cyclotomic regina::Cyclotomic::operator- (const Cyclotomic &, const Cyclotomic &)
 Subtracts the two given cyclotomic field elements. More...
 
Cyclotomic regina::Cyclotomic::operator* (const Cyclotomic &, const Cyclotomic &)
 Multiplies the two given cyclotomic field elements. More...
 
template<bool supportInfinity_>
std::ostream & regina::IntegerBase< supportInfinity >::operator<< (std::ostream &out, const IntegerBase< supportInfinity_ > &large)
 
template<int bytes_>
std::ostream & regina::NativeInteger< bytes >::operator<< (std::ostream &out, const NativeInteger< bytes_ > &large)
 
template<typename U >
Laurent< U > regina::Laurent< T >::operator+ (const Laurent< U > &, const Laurent< U > &)
 
template<typename U >
Laurent< U > regina::Laurent< T >::operator+ (Laurent< U > &&, Laurent< U > &&)
 
template<typename U >
Laurent< U > regina::Laurent< T >::operator- (const Laurent< U > &, const Laurent< U > &)
 
template<typename U >
Laurent< U > regina::Laurent< T >::operator- (const Laurent< U > &, Laurent< U > &&)
 
template<typename U >
Laurent< U > regina::Laurent< T >::operator- (Laurent< U > &&, Laurent< U > &&)
 
template<typename U >
Laurent< U > regina::Laurent< T >::operator* (const Laurent< U > &, const Laurent< U > &)
 
template<typename U >
Laurent2< U > regina::Laurent2< T >::operator* (const Laurent2< U > &, const Laurent2< U > &)
 
std::ostream & regina::Matrix2::operator<< (std::ostream &out, const Matrix2 &mat)
 Writes the given matrix to the given output stream. More...
 
template<typename U >
Polynomial< U > regina::Polynomial< T >::operator+ (const Polynomial< U > &, const Polynomial< U > &)
 
template<typename U >
Polynomial< U > regina::Polynomial< T >::operator- (const Polynomial< U > &, const Polynomial< U > &)
 
template<typename U >
Polynomial< U > regina::Polynomial< T >::operator- (const Polynomial< U > &, Polynomial< U > &&)
 
template<typename U >
Polynomial< U > regina::Polynomial< T >::operator- (Polynomial< U > &&, Polynomial< U > &&)
 
template<typename U >
Polynomial< U > regina::Polynomial< T >::operator* (const Polynomial< U > &, const Polynomial< U > &)
 
std::ostream & regina::Rational::operator<< (std::ostream &out, const Rational &rat)
 Writes the given rational to the given output stream. More...
 

Detailed Description

Underlying mathematical gruntwork.

Typedef Documentation

◆ Code [1/5]

template<int n>
typedef IntOfMinSize<(imageBits * n + 7) / 8>::utype regina::Perm< n >::Code

Indicates the native unsigned integer type used to store the internal permutation code.

This typedef is present for all values of n, though its precise size depends on how the permutation code is constructed. In particular, this type is defined differently for n ≤ 4 than for n ≥ 5.

◆ Code [2/5]

typedef uint8_t regina::Perm< 2 >::Code

Indicates the native unsigned integer type used to store the internal permutation code.

◆ Code [3/5]

typedef uint8_t regina::Perm< 3 >::Code

Indicates the native unsigned integer type used to store the internal permutation code.

◆ Code [4/5]

typedef uint8_t regina::Perm< 4 >::Code

Indicates the native unsigned integer type used to store the internal permutation code.

◆ Code [5/5]

typedef uint16_t regina::Perm< 5 >::Code

Indicates the native unsigned integer type used to store the internal permutation code.

◆ Coefficient [1/5]

The type of each coefficient of the polynomial that is used to store a field element.

◆ Coefficient [2/5]

template<typename T >
typedef T regina::Laurent< T >::Coefficient

The type of each coefficient of the polynomial.

◆ Coefficient [3/5]

template<typename T >
typedef T regina::Laurent2< T >::Coefficient

The type of each coefficient of the polynomial.

◆ Coefficient [4/5]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
typedef T regina::Matrix< T, ring >::Coefficient

The type of each entry in the matrix.

◆ Coefficient [5/5]

template<typename T >
typedef T regina::Polynomial< T >::Coefficient

The type of each coefficient of the polynomial.

◆ Index [1/5]

template<int n>
typedef IntOfMinSize<(imageBits * n + 7) / 8>::type regina::Perm< n >::Index

Denotes a native signed integer type large enough to count all permutations on n elements.

In other words, this is a native signed integer type large enough to store (n!).

◆ Index [2/5]

typedef int regina::Perm< 2 >::Index

Denotes a native signed integer type large enough to count all permutations on two elements.

In other words, this is a native signed integer type large enough to store (2!).

◆ Index [3/5]

typedef int regina::Perm< 3 >::Index

Denotes a native signed integer type large enough to count all permutations on three elements.

In other words, this is a native signed integer type large enough to store (3!).

◆ Index [4/5]

typedef int regina::Perm< 4 >::Index

Denotes a native signed integer type large enough to count all permutations on four elements.

In other words, this is a native signed integer type large enough to store (4!).

◆ Index [5/5]

typedef int regina::Perm< 5 >::Index

Denotes a native signed integer type large enough to count all permutations on five elements.

In other words, this is a native signed integer type large enough to store (5!).

◆ Integer

typedef IntegerBase<false> regina::Integer

Integer is a typedef for IntegerBase<false>, which offers arbitrary precision integers without support for infinity.

Python:\n This typedef is available in Python.

◆ LargeInteger

LargeInteger is a typedef for IntegerBase<true>, which offers arbitrary precision integers with support for infinity.

Python:\n This typedef is available in Python.

◆ MatrixIntDomain

template<class T >
using regina::MatrixIntDomain = typedef Matrix<T, true>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class MatrixIntDomain has now been absorbed into the main Matrix class. The old MatrixIntDomain functionality is made available to Matrix only when T is one of Regina's own integer classes (Integer, LargeInteger, or NativeInteger).
Precondition
T is one of Regina's own integer classes (Integer, LargeInteger, or NativeInteger).

◆ MatrixRing

template<class T >
using regina::MatrixRing = typedef Matrix<T, true>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class MatrixRing has now been absorbed into the main Matrix class. The old MatrixRing functionality is made available to Matrix when the template parameter ring is true.

◆ Native

template<int bytes>
typedef IntOfSize<bytes>::type regina::NativeInteger< bytes >::Native

The native data type used to store this integer.

◆ NCyclotomic

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NCyclotomic has now been renamed to Cyclotomic.

◆ NInteger

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NInteger has now been renamed to Integer.

◆ NLargeInteger

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NLargeInteger has now been renamed to LargeInteger.

◆ NMatrix

template<class T >
using regina::NMatrix = typedef Matrix<T, false>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NMatrix has now been renamed to Matrix.

◆ NMatrix2

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NMatrix2 has now been renamed to Matrix2.

◆ NMatrixInt

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NMatrixInt has now been renamed to MatrixInt.

◆ NMatrixRing

template<class T >
using regina::NMatrixRing = typedef Matrix<T, true>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NMatrixRing was long ago renamed to MatrixRing, and has now been absorbed into the main Matrix class. You should set the extra template parameter ring for the Matrix class to true.

◆ NNativeInteger

template<int bytes>
using regina::NNativeInteger = typedef NativeInteger<bytes>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NNativeInteger has now been renamed to NativeInteger.

◆ NNativeLong

typedef NativeInteger<sizeof(long)> regina::NNativeLong

NNativeLong is a typedef for the NativeInteger template class whose underlying integer type is a native long.

Python:\n Not present.

◆ NPerm

template<int n>
using regina::NPerm = typedef Perm<n>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPerm has now been renamed to Perm.

◆ NPerm2

typedef Perm<2> regina::NPerm2

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPerm2 has now been renamed to Perm<2>.

◆ NPerm3

typedef Perm<3> regina::NPerm3

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPerm3 has now been renamed to Perm<3>.

◆ NPerm4

typedef Perm<4> regina::NPerm4

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPerm4 has now been renamed to Perm<4>.

◆ NPerm5

typedef Perm<5> regina::NPerm5

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPerm5 has now been renamed to Perm<5>.

◆ NPolynomial

template<typename T >
using regina::NPolynomial = typedef Polynomial<T>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPolynomial has now been renamed to Polynomial.

◆ NPrimes

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NPrimes has now been renamed to Primes.

◆ NRational

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NRational has now been renamed to Rational.

◆ NRay

typedef Ray regina::NRay

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NRay has now been renamed to Ray.

◆ NVector

template<class T >
using regina::NVector = typedef Vector<T>

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
The class NVector has now been renamed to Vector.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
code012 

The internal code for the permutation (0,1,2).

Python:\n Not present.
code021 

The internal code for the permutation (0,2,1).

Python:\n Not present.
code120 

The internal code for the permutation (1,2,0).

Python:\n Not present.
code102 

The internal code for the permutation (1,0,2).

Python:\n Not present.
code201 

The internal code for the permutation (2,0,1).

Python:\n Not present.
code210 

The internal code for the permutation (2,1,0).

Python:\n Not present.

Function Documentation

◆ abs() [1/2]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::abs
inline

Determines the absolute value of this integer.

This integer is not changed.

Returns
the absolute value of this integer.

◆ abs() [2/2]

Rational regina::Rational::abs ( ) const

Determines the absolute value of this rational.

This rational is not changed.

Returns
the absolute value of this rational.

◆ addCol() [1/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::addCol ( unsigned long  source,
unsigned long  dest 
)
inline

Adds the given source column to the given destination column.

This routine is only available when the template argument ring is true.

Precondition
The two given columns are distinct and between 0 and columns()-1 inclusive.
Parameters
sourcethe columns to add.
destthe column that will be added to.

◆ addCol() [2/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::addCol ( unsigned long  source,
unsigned long  dest,
copies 
)
inline

Adds the given number of copies of the given source column to the given destination column.

Note that copies is passed by value in case it is an element of the row to be changed.

This routine is only available when the template argument ring is true.

Precondition
The two given columns are distinct and between 0 and columns()-1 inclusive.
Parameters
sourcethe columns to add.
destthe column that will be added to.
copiesthe number of copies of source to add to dest.

◆ addCopies()

template<class T >
void regina::Vector< T >::addCopies ( const Vector< T > &  other,
const T &  multiple 
)
inline

Adds the given multiple of the given vector to this vector.

This behaves correctly in the case where other is this.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector a multiple of which will be added to this vector.
multiplethe multiple of other to be added to this vector.

◆ addRow() [1/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::addRow ( unsigned long  source,
unsigned long  dest 
)
inline

Adds the given source row to the given destination row.

This routine is only available when the template argument ring is true.

Precondition
The two given rows are distinct and between 0 and rows()-1 inclusive.
Parameters
sourcethe row to add.
destthe row that will be added to.

◆ addRow() [2/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::addRow ( unsigned long  source,
unsigned long  dest,
copies 
)
inline

Adds the given number of copies of the given source row to the given destination row.

Note that copies is passed by value in case it is an element of the row to be changed.

This routine is only available when the template argument ring is true.

Precondition
The two given rows are distinct and between 0 and rows()-1 inclusive.
Parameters
sourcethe row to add.
destthe row that will be added to.
copiesthe number of copies of source to add to dest.

◆ atIndex() [1/5]

template<int n>
Perm< n > regina::Perm< n >::atIndex ( Index  i)
static

Returns the ith permutation on n elements, where permutations are numbered lexicographically beginning at 0.

Lexicographical ordering treats each permutation p as the n-tuple (p[0], p[1], ..., p[n-1]).

Parameters
ithe lexicographical index of the permutation; this must be between 0 and n!-1 inclusive.
Returns
the ith permutation.

◆ atIndex() [2/5]

Perm< 2 > regina::Perm< 2 >::atIndex ( Index  i)
inlinestatic

Returns the ith permutation on two elements, where permutations are numbered lexicographically beginning at 0.

Lexicographical ordering treats each permutation p as the pair (p[0], p[1]).

The return value will be identical to orderedS2[i].

Parameters
ithe lexicographical index of the permutation; this must be 0 or 1.
Returns
the ith permutation.

◆ atIndex() [3/5]

Perm< 3 > regina::Perm< 3 >::atIndex ( Index  i)
inlinestatic

Returns the ith permutation on three elements, where permutations are numbered lexicographically beginning at 0.

Lexicographical ordering treats each permutation p as the 3-tuple (p[0], p[1], p[2]).

The return value will be identical to orderedS3[i].

Parameters
ithe lexicographical index of the permutation; this must be between 0 and 5 inclusive.
Returns
the ith permutation.

◆ atIndex() [4/5]

Perm< 4 > regina::Perm< 4 >::atIndex ( Index  i)
inlinestatic

Returns the ith permutation on four elements, where permutations are numbered lexicographically beginning at 0.

Lexicographical ordering treats each permutation p as the 4-tuple (p[0], p[1], p[2], p[3]).

The return value will be identical to orderedS4[i].

Parameters
ithe lexicographical index of the permutation; this must be between 0 and 23 inclusive.
Returns
the ith permutation.

◆ atIndex() [5/5]

Perm< 5 > regina::Perm< 5 >::atIndex ( Index  i)
inlinestatic

Returns the ith permutation on five elements, where permutations are numbered lexicographically beginning at 0.

Lexicographical ordering treats each permutation p as the 5-tuple (p[0], p[1], p[2], p[3], p[4]).

The return value will be identical to orderedS5[i].

Parameters
ithe lexicographical index of the permutation; this must be between 0 and 119 inclusive.
Returns
the ith permutation.

◆ binomMedium()

long regina::binomMedium ( int  n,
int  k 
)

Returns the binomial coefficient n choose k in linear time for medium-sized arguments (n ≤ 29).

This routine computes the binomial coefficient using the standard formula. It works entirely with native long integers; the constraint n ≤ 29 is designed to avoid overflow (since all intermediate results are guaranteed to stay below 2^31).

If n ≤ 16 then this routine will use the same constant-time lookup as binomSmall() (i.e., there is no penalty for calling this routine with very small arguments).

Parameters
nthe parameter n in (n choose k); this must be between 0 and 29 inclusive.
kthe parameter k in (n choose k); this must be between 0 and n inclusive.
Returns
the binomial coefficient n choose k.

◆ binomSmall()

int regina::binomSmall ( int  n,
int  k 
)
inline

Returns the binomial coefficient n choose k in constant time for small arguments (n ≤ 16).

This routine is very fast, since it uses a constant-time lookup. The trade-off is that it can only be used for n ≤ 16.

If you need a compile-time constant, you should use the constant FaceNumbering<n-1, k-1>::nFaces instead. This function is provided for situations where n and/or k are not known until runtime.

Note
The constraint n ≤ 16 is large enough for working with triangulations in Regina, since Regina restricts its triangulations to dimension ≤ 15 (where each simplex has 16 vertices).
Parameters
nthe parameter n in (n choose k); this must be between 0 and 16 inclusive.
kthe parameter k in (n choose k); this must be between 0 and n inclusive.
Returns
the binomial coefficient n choose k.

◆ clear() [1/5]

template<int n>
void regina::Perm< n >::clear ( unsigned  from)

Resets the images of all integers from from onwards to the identity map.

Specifically, for each i in the range from,...,n-1, this routine will ensure that image[i] == i. The images of 0,1,...,from-1 will not be altered.

Precondition
The images of from,...,n-1 are exactly from,...,n-1, but possibly in a different order.
Parameters
fromthe first integer whose image should be reset. This must be between 0 and n inclusive.

◆ clear() [2/5]

void regina::Perm< 2 >::clear ( unsigned  from)

Resets the images of all integers from from onwards to the identity map.

Specifically, for each i in the range from,...,1, this routine will ensure that image[i] == i. The images of 0,1,...,from-1 will not be altered.

Precondition
The images of from,...,1 are exactly from,...,1, but possibly in a different order.
Parameters
fromthe first integer whose image should be reset. This must be between 0 and 2 inclusive.

◆ clear() [3/5]

void regina::Perm< 3 >::clear ( unsigned  from)

Resets the images of all integers from from onwards to the identity map.

Specifically, for each i in the range from,...,2, this routine will ensure that image[i] == i. The images of 0,1,...,from-1 will not be altered.

Precondition
The images of from,...,2 are exactly from,...,2, but possibly in a different order.
Parameters
fromthe first integer whose image should be reset. This must be between 0 and 3 inclusive.

◆ clear() [4/5]

void regina::Perm< 4 >::clear ( unsigned  from)

Resets the images of all integers from from onwards to the identity map.

Specifically, for each i in the range from,...,3, this routine will ensure that image[i] == i. The images of 0,1,...,from-1 will not be altered.

Precondition
The images of from,...,3 are exactly from,...,3, but possibly in a different order.
Parameters
fromthe first integer whose image should be reset. This must be between 0 and 4 inclusive.

◆ clear() [5/5]

void regina::Perm< 5 >::clear ( unsigned  from)

Resets the images of all integers from from onwards to the identity map.

Specifically, for each i in the range from,...,4, this routine will ensure that image[i] == i. The images of 0,1,...,from-1 will not be altered.

Precondition
The images of from,...,4 are exactly from,...,4, but possibly in a different order.
Parameters
fromthe first integer whose image should be reset. This must be between 0 and 5 inclusive.

◆ columnEchelonForm()

void regina::columnEchelonForm ( MatrixInt M,
MatrixInt R,
MatrixInt Ri,
const std::vector< unsigned > &  rowList 
)

Transforms a given matrix into column echelon form with respect to a collection of rows.

Given the matrix M and the list rowList of rows from M, this algorithm puts M in column echelon form with respect to the rows in rowList. The only purpose of rowList is to clarify and/or weaken precisely what is meant by "column echelon form"; all rows of M are affected by the resulting column operations that take place.

This routine also returns the corresponding change of coordinate matrices R and Ri:

  • If R and Ri are passed as identity matrices, the returned matrices will be such that original_M * R = final_M and final_M * Ri = original_M (and of course final_M is in column echelon form with respect to the given row list).
  • If R and Ri are already non-trivial coordinate transformations, they are modified appropriately by the algorithm.

Our convention is that a matrix is in column echelon form if:

  1. each column is either zero or there is a first non-zero entry which is positive (but see the note regarding rowList below);
  2. moving from the leftmost column to the rightmost column, the rows containing the first non-zero entries for these columns have strictly increasing indices in rowList;
  3. given a first non-zero column entry, in that row all the elements to the left are smaller and non-negative (all elements to the right are already zero by the previous condition);
  4. all the zero columns are on the right hand side of the matrix.

By a "zero column" here we simply mean "zero for every row in \a rowList". Likewise, by "first non-zero entry" we mean "first row in \a rowList with a non-zero entry".

In a pinch, you can also use this routine to compute the inverse of an invertible square matrix.

Precondition
Both R and Ri are square matrices with side length M.columns(), and these matrices are inverses of each other.
Python:\n The argument rowList should be supplied as a python list.
Parameters
Mthe matrix to reduce.
Rused to return the row-reduction matrix, as described above.
Riused to return the inverse of R.
rowListthe rows to pay attention to. This list must contain distinct integers, all between 0 and M.rows()-1 inclusive. The integers may appear in any order (though changing the order will change the resulting column echelon form).
Author
Ryan Budney

◆ columns()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
unsigned long regina::Matrix< T, ring >::columns ( ) const
inline

Returns the number of columns in this matrix.

Returns
the number of columns.

◆ compareWith() [1/5]

template<int n>
int regina::Perm< n >::compareWith ( const Perm< n > &  other) const

Lexicographically compares the images of (0,1,...,n-1) under this and the given permutation.

Parameters
otherthe permutation with which to compare this.
Returns
-1 if this permutation produces a smaller image, 0 if the permutations are equal, and 1 if this permutation produces a greater image.

◆ compareWith() [2/5]

int regina::Perm< 2 >::compareWith ( const Perm< 2 > &  other) const
inline

Lexicographically compares the images of (0,1) under this and the given permutation.

Parameters
otherthe permutation with which to compare this.
Returns
-1 if this permutation produces a smaller image, 0 if the permutations are equal and 1 if this permutation produces a greater image.

◆ compareWith() [3/5]

int regina::Perm< 3 >::compareWith ( const Perm< 3 > &  other) const
inline

Lexicographically compares the images of (0,1,2) under this and the given permutation.

Parameters
otherthe permutation with which to compare this.
Returns
-1 if this permutation produces a smaller image, 0 if the permutations are equal and 1 if this permutation produces a greater image.

◆ compareWith() [4/5]

int regina::Perm< 4 >::compareWith ( const Perm< 4 > &  other) const
inline

Lexicographically compares the images of (0,1,2,3) under this and the given permutation.

Parameters
otherthe permutation with which to compare this.
Returns
-1 if this permutation produces a smaller image, 0 if the permutations are equal and 1 if this permutation produces a greater image.

◆ compareWith() [5/5]

int regina::Perm< 5 >::compareWith ( const Perm< 5 > &  other) const

Lexicographically compares the images of (0,1,2,3,4) under this and the given permutation.

Parameters
otherthe permutation with which to compare this.
Returns
-1 if this permutation produces a smaller image, 0 if the permutations are equal and 1 if this permutation produces a greater image.

◆ contract() [1/5]

template<int n>
template<int k>
static Perm regina::Perm< n >::contract ( Perm< k >  p)
static

Restricts a k-element permutation to an n-element permutation, where k > n.

The resulting permutation will map 0,...,n-1 to their respective images under p, and will ignore the "unused" images p[n],...,p[k-1].

Precondition
The given permutation maps 0,...,n-1 to 0,...,n-1 in some order.
Template Parameters
kthe number of elements for the input permutation; this must be strictly greater than n.
Parameters
pa permutation on k elements.
Returns
the same permutation restricted to a permutation on n elements.

◆ contract() [2/5]

template<int k>
static Perm<2> regina::Perm< 2 >::contract ( Perm< k >  p)
static

Restricts a k-element permutation to an 2-element permutation, where k > 2.

The resulting permutation will map 0,1 to their respective images under p, and will ignore the "unused" images p[2],...,p[k-1].

Precondition
The given permutation maps 0,1 to 0,1 in some order.
Template Parameters
kthe number of elements for the input permutation; this must be strictly greater than 2.
Parameters
pa permutation on k elements.
Returns
the same permutation restricted to a permutation on 2 elements.

◆ contract() [3/5]

template<int k>
static Perm<3> regina::Perm< 3 >::contract ( Perm< k >  p)
static

Restricts a k-element permutation to an 3-element permutation, where k > 3.

The resulting permutation will map 0,1,2 to their respective images under p, and will ignore the "unused" images p[3],...,p[k-1].

Precondition
The given permutation maps 0,1,2 to 0,1,2 in some order.
Template Parameters
kthe number of elements for the input permutation; this must be strictly greater than 3.
Parameters
pa permutation on k elements.
Returns
the same permutation restricted to a permutation on 3 elements.

◆ contract() [4/5]

template<int k>
static Perm<4> regina::Perm< 4 >::contract ( Perm< k >  p)
static

Restricts a k-element permutation to an 4-element permutation, where k > 4.

The resulting permutation will map 0,...,3 to their respective images under p, and will ignore the "unused" images p[4],...,p[k-1].

Precondition
The given permutation maps 0,...,3 to 0,...,3 in some order.
Template Parameters
kthe number of elements for the input permutation; this must be strictly greater than 4.
Parameters
pa permutation on k elements.
Returns
the same permutation restricted to a permutation on 4 elements.

◆ contract() [5/5]

template<int k>
static Perm<5> regina::Perm< 5 >::contract ( Perm< k >  p)
static

Restricts a k-element permutation to an 5-element permutation, where k > 5.

The resulting permutation will map 0,...,3 to their respective images under p, and will ignore the "unused" images p[5],...,p[k-1].

Precondition
The given permutation maps 0,...,4 to 0,...,4 in some order.
Template Parameters
kthe number of elements for the input permutation; this must be strictly greater than 5.
Parameters
pa permutation on k elements.
Returns
the same permutation restricted to a permutation on 5 elements.

◆ Cyclotomic() [1/7]

regina::Cyclotomic::Cyclotomic ( )
inline

Creates an uninitialised field element.

This element must be initialised using either init() or the assignment operator before it can be used.

The underlying cyclotomic field is not yet known; this will also be specified during the call to init() or the assignment operator.

◆ Cyclotomic() [2/7]

regina::Cyclotomic::Cyclotomic ( const Cyclotomic value)
inline

Creates a copy of the given field element, within the same cyclotomic field.

This constructor induces a deep copy of value.

Parameters
valuethe field element to copy.

◆ Cyclotomic() [3/7]

regina::Cyclotomic::Cyclotomic ( Cyclotomic &&  value)
inlinenoexcept

Moves the contents of the given field element to this new field element.

This is a fast (constant time) operation.

The element that was passed (value) will no longer be usable.

Parameters
valuethe field element to move.

◆ Cyclotomic() [4/7]

regina::Cyclotomic::Cyclotomic ( size_t  field)
inlineexplicit

Creates the zero element of the given cyclotomic field.

Parameters
fieldthe order of the underlying cyclotomic field; this must be strictly positive.

◆ Cyclotomic() [5/7]

regina::Cyclotomic::Cyclotomic ( size_t  field,
const Rational value 
)
inline

Creates the given rational element within the given cyclotomic field.

The polynomial representation of this element will simply be a rational constant.

Parameters
fieldthe order of the underlying cyclotomic field; this must be strictly positive.
valuethe value of this element; that is, the rational constant.

◆ Cyclotomic() [6/7]

regina::Cyclotomic::Cyclotomic ( size_t  field,
int  value 
)
inline

Creates the given integer element within the given cyclotomic field.

The polynomial representation of this element will simply be an integer constant.

Parameters
fieldthe order of the underlying cyclotomic field; this must be strictly positive.
valuethe value of this element; that is, the integer constant.

◆ Cyclotomic() [7/7]

regina::Cyclotomic::Cyclotomic ( size_t  field,
std::initializer_list< Rational coefficients 
)
inline

Creates a new field element from a hard-coded sequence of coefficients.

This constructor takes a C++11 initialiser list, which should contain the coefficients of the field element's polynomial representation, in order from the constant coefficient upwards. See operator[] for details on what this polynomial representation means.

There should be at most deg(Φ_n) = φ(n) coefficients in the list, where n is the given order of the underlying field; any missing coefficients are assumed to be zero. In particular, an empty sequence is allowed (and represents the zero field element).

Python:\n Not available.
Parameters
fieldthe order of the underlying cyclotomic field; this must be strictly positive.
coefficientsa sequence of at most φ(n) coefficients, as described above.

◆ cyclotomic()

static const Polynomial<Integer>& regina::Cyclotomic::cyclotomic ( size_t  n)
static

Returns the nth cyclotomic polynomial Φ_n.

Cyclotomic polynomials are cached after they are computed, and so after the first call to cyclotomic(n), all subsequent calls with the same value of n will be essentially instantaneous.

Although it queries and manipulates a global cache, this routine is thread-safe.

Precondition
The given integer n must be strictly positive.
Python:\n This routine returns a newly allocated polynomial
(not a constant reference). Moreover, since Python exposes the class Polynomial<Rational> but not Polynomial<Integer>, this routine returns an object of type Polynomial<Rational> instead.
Parameters
nindicates which cyclotomic polynomial to return.
Returns
the cyclotomic polynomial Φ_n.

◆ degree() [1/2]

size_t regina::Cyclotomic::degree ( ) const
inline

Returns the degree of the polynomial that defines the underlying cyclotomic field.

This is the degree of the cyclotomic polynomial Φ_n, and also the value of Euler's totient function φ(n), where n is the order of the field as returned by field().

A value of zero indicates that this field element has not yet been initialised (for instance, it was created using the default constructor).

Returns
the degree of the polynomial that defines the underlying field.

◆ degree() [2/2]

template<typename T >
size_t regina::Polynomial< T >::degree
inline

Returns the degree of this polynomial.

This is the largest exponent with a non-zero coefficient.

For the purposes of this class, the zero polynomial is considered to have degree zero.

Returns
the degree of this polynomial.

◆ denominator()

Integer regina::Rational::denominator ( ) const

Returns the denominator of this rational.

Note that rationals are always stored in lowest terms with non-negative denominator. Infinity will be stored as 1/0.

Returns
the denominator.

◆ det()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
T regina::Matrix< T, ring >::det ( ) const
inline

Evaluates the determinant of the matrix.

This algorithm has quartic complexity, and uses the dynamic programming approach of Mahajan and Vinay. For further details, see Meena Mahajan and V. Vinay, "Determinant: Combinatorics, algorithms, and complexity", Chicago J. Theor. Comput. Sci., Vol. 1997, Article 5.

This routine is only available when the template argument ring is true.

Precondition
This is a square matrix.
Returns
the determinant of this matrix.

◆ determinant()

long regina::Matrix2::determinant ( ) const
inline

Returns the determinant of this matrix.

Returns
the determinant of this matrix.

◆ digit()

constexpr char regina::digit ( int  i)
inlineconstexpr

Returns the character used to express the integer i in a permutation.

  • For i = 0,...,9, this will be the usual digit representing i.
  • For i ≥ 10, this will be a lower-case letter. In particular, for i = 10,...,15, this will be the usual hexadecimal digit representing i.
  • At present, this routine only supports integers i < 36.
Parameters
ithe integer to represent; this must be between 0 and 35 inclusive.
Returns
the single character used to represent i.

◆ divByExact() [1/4]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::divByExact ( const IntegerBase< supportInfinity > &  other)

Divides this by the given integer.

This can only be used when the given integer divides into this exactly, and for large integers this is much faster than ordinary division. This integer is changed to reflect the result.

Precondition
The given integer divides exactly into this integer, i.e. this divided by other is an integer.
other is not zero.
Neither this nor other is infinite.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ divByExact() [2/4]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::divByExact ( const NativeInteger< bytes > &  other)
inline

Divides this by the given integer.

For native integers, this routine is identical to operator /=.

Precondition
other is not zero.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ divByExact() [3/4]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::divByExact ( long  other)

Divides this by the given integer.

This can only be used when the given integer divides into this exactly, and for large integers this is much faster than ordinary division. This integer is changed to reflect the result.

Precondition
The given integer divides exactly into this integer, i.e. this divided by other is an integer.
other is not zero.
This integer is not infinite.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ divByExact() [4/4]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::divByExact ( Native  other)
inline

Divides this by the given integer.

For native integers, this routine is identical to operator /=.

Precondition
other is not zero.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ divExact() [1/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::divExact ( const IntegerBase< supportInfinity > &  other) const
inline

Divides this by the given integer and returns the result.

This can only be used when the given integer divides into this exactly, and for large integers can be much faster than ordinary division. This integer is not changed.

Precondition
The given integer divides exactly into this integer, i.e. this divided by other is an integer.
other is not zero.
Neither this nor other is infinite.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ divExact() [2/4]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::divExact ( const NativeInteger< bytes > &  other) const
inline

Divides this by the given integer and returns the result.

For native integers, this is identical to operator /.

Precondition
other is not zero.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ divExact() [3/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::divExact ( long  other) const
inline

Divides this by the given integer and returns the result.

This can only be used when the given integer divides into this exactly, and for large integers can be much faster than ordinary division. This integer is not changed.

Precondition
The given integer divides exactly into this integer, i.e. this divided by other is an integer.
other is not zero.
This integer is not infinite.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ divExact() [4/4]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::divExact ( Native  other) const
inline

Divides this by the given integer and returns the result.

For native integers, this is identical to operator /.

Precondition
other is not zero.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ divisionAlg() [1/3]

template<bool supportInfinity = false>
IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::divisionAlg ( const IntegerBase< supportInfinity > &  divisor,
IntegerBase< supportInfinity > &  remainder 
) const

Uses the division algorithm to obtain a quotient and remainder when dividing by the given integer.

Suppose this integer is n and we pass the divisor d. The division algorithm describes the result of dividing n by d; in particular, it expresses n = qd + r, where q is the quotient and r is the remainder.

The division algorithm is precise about which values of q and r are chosen; in particular it chooses the unique r in the range 0 <= r < |d|.

Note that this differs from other division routines in this class, in that it always rounds to give a non-negative remainder. Thus IntegerBase(-7).divisionAlg(3) gives quotient -3 and remainder 2, whereas (-7)/3 gives quotient -2 and (-7)%3 gives remainder -1.

The two results are passed back to the caller as follows: The quotient q is passed back as the return value of the function, and the remainder r is stored in the reference argument r.

In the special case where the given divisor is 0 (not allowed by the usual division algorithm), this routine selects quotient 0 and remainder n.

Precondition
Neither this nor the divisor are infinite.
Python:\n The argument remainder is missing; instead both
the quotient and remainder are passed back through the return value of the function. Specifically, this function returns a (quotient, remainder) pair.
Parameters
divisorthe divisor d.
remainderused to store the remainder r when the functon returns. The initial value of this argument is ignored.
Returns
the quotient q.
Author
Ryan Budney & B.B.

◆ divisionAlg() [2/3]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::divisionAlg ( const NativeInteger< bytes > &  divisor,
NativeInteger< bytes > &  remainder 
) const
inline

Uses the division algorithm to obtain a quotient and remainder when dividing by the given integer.

Suppose this integer is n and we pass the divisor d. The division algorithm describes the result of dividing n by d; in particular, it expresses n = qd + r, where q is the quotient and r is the remainder.

The division algorithm is precise about which values of q and r are chosen; in particular it chooses the unique r in the range 0 <= r < |d|.

Note that this differs from other division routines in this class, in that it always rounds to give a non-negative remainder. Thus NativeInteger(-7).divisionAlg(3) gives quotient -3 and remainder 2, whereas (-7)/3 gives quotient -2 and (-7)%3 gives remainder -1.

The two results are passed back to the caller as follows: The quotient q is passed back as the return value of the function, and the remainder r is stored in the reference argument r.

In the special case where the given divisor is 0 (not allowed by the usual division algorithm), this routine selects quotient 0 and remainder n.

Parameters
divisorthe divisor d.
remainderused to store the remainder r when the functon returns. The initial value of this argument is ignored.
Returns
the quotient q.
Author
Ryan Budney & B.B.

◆ divisionAlg() [3/3]

template<typename T >
void regina::Polynomial< T >::divisionAlg ( const Polynomial< T > &  divisor,
Polynomial< T > &  quotient,
Polynomial< T > &  remainder 
) const

Divides this by the given divisor, and extracts both the quotient and the remainder.

More precisely: suppose there exist polynomials q and r with coefficients of type T for which this = q.divisor + r, and where r has smaller degree than divisor. Then this routine sets the given polynomial quotient to q, and sets the given polynomial remainder to r.

If you do not need the remainder (e.g., if you know in advance that divisor divides into this polynomial exactly), then you can use the division operator /= instead, which will be a little faster.

If your coefficient type T is not a field (e.g., if T is Integer), you must be sure to know in advance that the quotient exists (see the precondition below). Otherwise the behaviour of this routine is undefined.

Coefficients are divided using the operator /= on type T.

Precondition
The given divisor is not the zero polynomial.
The quotient as defined above exists. If T is a field type (e.g., if T is Rational) then this is true automatically. If not (e.g., if T is Integer) then this requires some prior knowledge about the arguments.
Neither quotient nor remainder is a reference to this polynomial.
Python:\n The arguments quotient and remainder are
missing; instead these are passed back through the return value of the function. Specifically, this function returns a (quotient, remainder) pair.
Parameters
divisorthe polynomial to divide by this.
quotienta polynomial whose contents will be destroyed and replaced with the quotient q, as described above.
remaindera polynomial whose contents will be destroyed and replaced with the remainder r, as described above.

◆ doubleApprox()

double regina::Rational::doubleApprox ( bool *  inRange = 0) const

Attempts to convert this rational to a real number.

If this rational can be approximated by a double (specifically, if it lies within double's allowable range) then a such an approximation is returned. Otherwise zero is returned instead.

The optional inRange argument allows the result of range checking to be returned explicitly as a boolean (*inRange will be set to true if a double approximation is possible and false otherwise).

It is safe to pass inRange as null, in which case this boolean is not returned. Range checking is still performed internally however, i.e., zero is still returned if the rational is out of range.

Note that "lies with double's allowable range" is machine-dependent, and may vary between different installations. Infinity and undefined are always considered out of range. Otherwise a rational is out of range if its absolute value is finite but too large (e.g., 10^10000) or non-zero but too small (e.g., 10^-10000).

Parameters
inRangereturns the result of range checking as described above; this pointer may be passed as null if the caller does not care about this result.
Returns
the double approximation to this rational, or zero if this rational lies outside double's allowable range.
Python:\n The inRange argument is not present.
Instead there are two versions of this routine. The first is doubleApprox(), which returns a single real number. The second is doubleApproxCheck(), which returns a (real, bool) pair containing the converted real number followed by the result of range checking.
Author
Ryan Budney, B.B.

◆ elementSum()

template<class T >
T regina::Vector< T >::elementSum ( ) const
inline

Returns the sum of all elements of this vector.

Returns
the sum of the elements of this vector.

◆ entry() [1/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
T& regina::Matrix< T, ring >::entry ( unsigned long  row,
unsigned long  column 
)
inline

Returns the entry at the given row and column.

Rows and columns are numbered beginning at zero.

Precondition
row is between 0 and rows()-1 inclusive.
column is between 0 and columns()-1 inclusive.
Python:\n Although the entry() routine gives direct
read-write access to matrix elements, the syntax matrix.entry(row, column) = value still cannot be used in python to set a matrix element directly. For this, you can use the syntax matrix.set(row, column, value). This set() routine returns nothing, and is provided for python only (i.e., it is not part of the C++ calculation engine).
Parameters
rowthe row of the desired entry.
columnthe column of the desired entry.
Returns
a reference to the entry in the given row and column.

◆ entry() [2/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
const T& regina::Matrix< T, ring >::entry ( unsigned long  row,
unsigned long  column 
) const
inline

Returns the entry at the given row and column.

Rows and columns are numbered beginning at zero.

Precondition
row is between 0 and rows()-1 inclusive.
column is between 0 and columns()-1 inclusive.
Python:\n Not present, although the non-const form of
this routine is.
Parameters
rowthe row of the desired entry.
columnthe column of the desired entry.
Returns
a reference to the entry in the given row and column.

◆ evaluate()

std::complex<double> regina::Cyclotomic::evaluate ( size_t  whichRoot = 1) const

Returns the value of this cyclotomic field element as a complex number.

The evaluation depends upon which primitive root of unity is used to build the underlying cyclotomic field of order n. This ambiguity is resolved as follows.

Suppose the polynomial representation of this field element in ℚ[x]/Φ_n (as described in the Cyclotomic class notes) is f(x). Then the evaluation of this field element will be f(ρ), where ρ is the nth root of unity ρ = exp(2πi × k/n), and where k is the argument whichRoot as passed to this routine.

Precondition
The argument whichRoot is coprime to n (the order of the underlying cyclotomic field).
This field element has been initialised (either through a non-default constructor, an assignment operator, or by calling init()).
Warning
This routine uses floating point arithmetic, and so the value that it returns is subject to the usual floating point error.
Parameters
whichRootindicates which root of unity will be used to convert the polynomial representation of this field element into a complex number.
Returns
a floating-point approximation of this cyclotomic field element as a complex number.

◆ extend() [1/4]

template<int n>
template<int k>
static Perm regina::Perm< n >::extend ( Perm< k >  p)
static

Extends a k-element permutation to an n-element permutation, where 2 ≤ k < n.

The resulting permutation will map 0,...,k-1 to their respective images under p, and will map the "unused" elements k,...,n-1 to themselves.

Template Parameters
kthe number of elements for the input permutation; this must be at least 2, and strictly less than n.
Parameters
pa permutation on k elements.
Returns
the same permutation expressed as a permutation on n elements.

◆ extend() [2/4]

template<int k>
static Perm<3> regina::Perm< 3 >::extend ( Perm< k >  p)
static

Extends a k-element permutation to an 3-element permutation.

where 2 ≤ k < 3. The only possible value of k is 2, but this routine is kept as a template function for consistency with the other classes' Perm<n>::extend() routines.

The resulting permutation will map 0,1 to their respective images under p, and will map the "unused" element 3 to itself.

Template Parameters
kthe number of elements for the input permutation; this must be exactly 2.
Parameters
pa permutation on two elements.
Returns
the same permutation expressed as a permutation on three elements.

◆ extend() [3/4]

template<int k>
static Perm<4> regina::Perm< 4 >::extend ( Perm< k >  p)
static

Extends a k-element permutation to a 4-element permutation, where 2 ≤ k < 4.

The resulting permutation will map 0,...,k-1 to their respective images under p, and will map the "unused" elements k,...,3 to themselves.

Template Parameters
kthe number of elements for the input permutation; this must be 2 or 3.
Parameters
pa permutation on k elements.
Returns
the same permutation expressed as a permutation on four elements.

◆ extend() [4/4]

template<int k>
static Perm<5> regina::Perm< 5 >::extend ( Perm< k >  p)
static

Extends a k-element permutation to a 5-element permutation, where 2 ≤ k < 5.

The resulting permutation will map 0,...,k-1 to their respective images under p, and will map the "unused" elements k,...,4 to themselves.

Template Parameters
kthe number of elements for the input permutation; this must be 2, 3 or 4.
Parameters
pa permutation on k elements.
Returns
the same permutation expressed as a permutation on five elements.

◆ factorial()

constexpr int64_t regina::factorial ( int  n)
inlineconstexpr

Returns the factorial of n.

Parameters
nany non-negative integer; this must be at most 20 (since otherwise the factorial will overflow).
Returns
the factorial of n..

◆ field()

size_t regina::Cyclotomic::field ( ) const
inline

Returns the order n of the underlying cyclotomic field to which this element belongs.

A value of zero indicates that this field element has not yet been initialised (for instance, it was created using the default constructor).

Returns
the order of the underlying cyclotomic field.

◆ fromPermCode() [1/5]

template<int n>
Perm< n > regina::Perm< n >::fromPermCode ( Code  code)
inlinestatic

Creates a permutation from the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
codethe internal code for the new permutation.
Returns
the permutation reprsented by the given internal code.

◆ fromPermCode() [2/5]

Perm< 2 > regina::Perm< 2 >::fromPermCode ( Code  code)
inlinestatic

Creates a permutation from the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
codethe internal code for the new permutation.
Returns
the permutation represented by the given internal code.

◆ fromPermCode() [3/5]

Perm< 3 > regina::Perm< 3 >::fromPermCode ( Code  code)
inlinestatic

Creates a permutation from the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
codethe internal code for the new permutation.
Returns
the permutation represented by the given internal code.

◆ fromPermCode() [4/5]

Perm< 4 > regina::Perm< 4 >::fromPermCode ( Code  code)
inlinestatic

Creates a permutation from the given first-generation permutation code.

Precondition
the given code is a valid first-generation permutation code; see isPermCode() for details.
Warning
This routine will incur additional overhead, since Perm<4> now uses second-generation codes internally. See the class notes and the routine fromPermCode2() for details.
Parameters
codethe first-generation code for the new permutation.
Returns
the permutation represented by the given code.

◆ fromPermCode() [5/5]

Perm< 5 > regina::Perm< 5 >::fromPermCode ( Code  newCode)
inlinestatic

Creates a permutation from the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
newCodethe internal code for the new permutation.
Returns
the permutation reprsented by the given internal code.

◆ fromPermCode2()

Perm< 4 > regina::Perm< 4 >::fromPermCode2 ( Code  code)
inlinestatic

Creates a permutation from the given second-generation permutation code.

Second-generation codes are fast to work with, since they are used internally by the Perm<4> class.

Precondition
the given code is a valid second-generation permutation code; see isPermCode2() for details.
Parameters
codethe second-generation code for the new permutation.
Returns
the permutation represented by the given code.

◆ gcd() [1/3]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::gcd ( const IntegerBase< supportInfinity > &  other) const

Determines the greatest common divisor of this and the given integer.

This integer is not changed.

The result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Precondition
Neither this integer nor other is infinite.
Parameters
otherthe integer whose greatest common divisor with this will be found.
Returns
the greatest common divisor of this and the given integer.

◆ gcd() [2/3]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::gcd ( const NativeInteger< bytes > &  other) const
inline

Determines the greatest common divisor of this and the given integer.

This integer is not changed.

The result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Parameters
otherthe integer whose greatest common divisor with this will be found.
Returns
the greatest common divisor of this and the given integer.

◆ gcd() [3/3]

long regina::gcd ( long  a,
long  b 
)

Calculates the greatest common divisor of two signed integers.

This routine is not recursive.

Although the arguments may be negative, the result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Parameters
aone of the two integers to work with.
bthe other integer with which to work.
Returns
the greatest common divisor of a and b.

◆ gcdWith() [1/2]

template<bool supportInfinity = false>
void regina::IntegerBase< supportInfinity >::gcdWith ( const IntegerBase< supportInfinity > &  other)

Sets this integer to be the greatest common divisor of this and the given integer.

The result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Precondition
Neither this integer nor other is infinite.
Parameters
otherthe integer whose greatest common divisor with this will be found.

◆ gcdWith() [2/2]

template<int bytes>
void regina::NativeInteger< bytes >::gcdWith ( const NativeInteger< bytes > &  other)

Sets this integer to be the greatest common divisor of this and the given integer.

The result is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

Parameters
otherthe integer whose greatest common divisor with this will be found.

Now everything is non-negative. The following code is based on Stein's binary GCD algorithm.

◆ gcdWithCoeffs() [1/3]

template<bool supportInfinity = false>
IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::gcdWithCoeffs ( const IntegerBase< supportInfinity > &  other,
IntegerBase< supportInfinity > &  u,
IntegerBase< supportInfinity > &  v 
) const

Determines the greatest common divisor of this and the given integer and finds the smallest coefficients with which these integers combine to give their gcd.

Note that the given integers need not be non-negative. However, the gcd returned is guaranteed to be non-negative.

If d is the gcd of this and other, the values placed into u and v will be those for which u*this + v*other = d, -abs(this)/d < v*sign(other) <= 0 and 1 <= u*sign(this) <= abs(other)/d. These equations are not satisfied when either of this or other are zero, but in this case u and v are both 0, 1 or -1, using as many zeros as possible.

Precondition
Neither this integer nor other is infinite.
Parameters
otherthe integer whose greatest common divisor with this will be found.
ua variable into which the final coefficient of this will be placed.
va variable into which the final coefficient of other will be placed.
Returns
the greatest common divisor of this and other.

◆ gcdWithCoeffs() [2/3]

template<typename T >
template<typename U >
void regina::Polynomial< T >::gcdWithCoeffs ( const Polynomial< U > &  other,
Polynomial< T > &  gcd,
Polynomial< T > &  u,
Polynomial< T > &  v 
) const

Calculates the greatest common divisor of this and the given polynomial, and finds a linear combination of these polynomials that gives this gcd.

The greatest common divisor will be a monic polynomial. The polynomials returned in u and v will satisfy u*this + v*other = gcd.

As a special case, gcd(0,0) is considered to be zero.

Precondition
The coefficient type T represents a field. In particular, Rational is supported but Integer is not.
Parameters
otherthe polynomial whose greatest common divisor with this polynomial we should compute.
gcda polynomial whose contents will be destroyed and replaced with the greatest common divisor d, as described above.
ua polynomial whose contents will be destroyed and replaced with u, as described above.
va polynomial whose contents will be destroyed and replaced with v, as described above.

◆ gcdWithCoeffs() [3/3]

long regina::gcdWithCoeffs ( long  a,
long  b,
long &  u,
long &  v 
)

Calculates the greatest common divisor of two given integers and finds the smallest coefficients with which these integers combine to give their gcd.

This routine is not recursive.

Note that the given integers need not be non-negative. However, the gcd returned is guaranteed to be non-negative. As a special case, gcd(0,0) is considered to be zero.

If d is the gcd of a and b, the values placed in u and v will be those for which u*a + v*b = d, -abs(a)/d < v*sign(b) <= 0 and 1 <= u*sign(a) <= abs(b)/d.

In the special case where one of the given integers is zero, the corresponding coefficient will also be zero and the other coefficient will be 1 or -1 so that u*a + v*b = d still holds. If both given integers are zero, both of the coefficients will be set to zero.

Python:\n The arguments u and v are not present. Instead,
this routine returns the tuple (gcd, u, v).
Parameters
aone of the integers to work with.
bthe other integer with which to work.
ua variable into which the final coefficient of a will be placed.
va variable into which the final coefficient of b will be placed.
Returns
the greatest common divisor of a and b.

◆ index() [1/5]

template<int n>
Perm< n >::Index regina::Perm< n >::index

Returns the lexicographical index of this permutation.

This indicates where this permutation sits within a full lexicographical ordering of all n! permutations on n elements.

Lexicographical ordering treats each permutation p as the n-tuple (p[0], p[1], ..., p[n-1]). In particular, the identity permutation has index 0, and the "reverse" permutation (which maps each i to n-i-1) has index n!-1.

Returns
the index of this permutation, which will be between 0 and n!-1 inclusive.

◆ index() [2/5]

Perm< 2 >::Index regina::Perm< 2 >::index ( ) const
inline

Returns the lexicographical index of this permutation.

This indicates where this permutation sits within a full lexicographical ordering of all 2! permutations on two elements.

Lexicographical ordering treats each permutation p as the pair (p[0], p[1]). That is, the identity permutation has index 0, and the (unique) non-identity permutation has index 1.

This routine is identical to orderedS2Index().

Returns
the index of this permutation, which will be 0 or 1.

◆ index() [3/5]

Perm< 3 >::Index regina::Perm< 3 >::index ( ) const
inline

Returns the lexicographical index of this permutation.

This indicates where this permutation sits within a full lexicographical ordering of all 3! permutations on three elements.

Lexicographical ordering treats each permutation p as the 3-tuple (p[0], p[1], p[2]). In particular, the identity permutation has index 0, and the "reverse" permutation (which maps each i to 2-i) has index 5 = 3!-1.

This routine is identical to orderedS3Index().

Returns
the index of this permutation, which will be between 0 and 5 inclusive.

◆ index() [4/5]

Perm< 4 >::Index regina::Perm< 4 >::index ( ) const
inline

Returns the lexicographical index of this permutation.

This indicates where this permutation sits within a full lexicographical ordering of all 4! permutations on four elements.

Lexicographical ordering treats each permutation p as the 4-tuple (p[0], p[1], p[2], p[3]). In particular, the identity permutation has index 0, and the "reverse" permutation (which maps each i to 3-i) has index 23 = 4!-1.

This routine is identical to orderedS4Index().

Returns
the index of this permutation, which will be between 0 and 23 inclusive.

◆ index() [5/5]

Perm< 5 >::Index regina::Perm< 5 >::index ( ) const
inline

Returns the lexicographical index of this permutation.

This indicates where this permutation sits within a full lexicographical ordering of all 5! permutations on five elements.

Lexicographical ordering treats each permutation p as the 5-tuple (p[0], p[1], p[2], p[3], p[4]). In particular, the identity permutation has index 0, and the "reverse" permutation (which maps each i to 4-i) has index 119 = 5!-1.

This routine is identical to orderedS5Index().

Returns
the index of this permutation, which will be between 0 and 119 inclusive.

◆ init() [1/9]

template<typename T >
void regina::Laurent< T >::init
inline

Sets this to become the zero polynomial.

◆ init() [2/9]

template<typename T >
void regina::Laurent2< T >::init
inline

Sets this to become the zero polynomial.

◆ init() [3/9]

template<typename T >
void regina::Polynomial< T >::init
inline

Sets this to become the zero polynomial.

◆ init() [4/9]

template<typename T >
template<typename iterator >
void regina::Polynomial< T >::init ( iterator  begin,
iterator  end 
)

Sets this to become the polynomial described by the given sequence of coefficients.

The coefficients should appear in order from the constant coefficient to the leading coefficient.

There is no problem if the leading coefficient (i.e., the last coefficient in the sequence) is zero. An empty sequence will be treated as the zero polynomial.

This routine induces a deep copy of the given range.

Precondition
Objects of type T can be assigned values from dereferenced iterators of type iterator.
Python:\n Instead of a pair of iterators, this routine
takes a python list of coefficients.
Parameters
beginthe beginning of the sequence of coefficients.
enda past-the-end iterator indicating the end of the sequence of coefficients.

◆ init() [5/9]

template<typename T >
void regina::Laurent< T >::init ( long  exponent)
inline

Sets this to become the polynomial x^d for the given exponent d.

Parameters
exponentthe new exponent to use for this polynomial.

◆ init() [6/9]

template<typename T >
template<typename iterator >
void regina::Laurent< T >::init ( long  minExp,
iterator  begin,
iterator  end 
)

Sets this to become the polynomial described by the given sequence of coefficients.

The coefficients should appear in order from the smallest exponent term to the largest. The first coefficient in the sequence will be associated with the exponent minExp.

There is no problem if the first and/or last coefficient in the sequence is zero. An empty sequence will be treated as the zero polynomial.

This routine induces a deep copy of the given range.

Precondition
Objects of type T can be assigned values from dereferenced iterators of type iterator.
Python:\n Instead of the iterators begin and end,
this routine takes a python list of coefficients.
Parameters
minExpthe exponent corresponding to the first coefficient in the sequence.
beginthe beginning of the sequence of coefficients.
enda past-the-end iterator indicating the end of the sequence of coefficients.

◆ init() [7/9]

template<typename T >
void regina::Laurent2< T >::init ( long  xExp,
long  yExp 
)
inline

Sets this to become the polynomial x^d y^e for the given exponents d and e.

Parameters
xExpthe new exponent d, which is attached to x.
yExpthe new exponent e, which is attached to y.

◆ init() [8/9]

template<typename T >
void regina::Polynomial< T >::init ( size_t  degree)
inline

Sets this to become the polynomial x^d for the given degree d.

Parameters
degreethe new degree of this polynomial.

◆ init() [9/9]

void regina::Cyclotomic::init ( size_t  field)
inline

Initialises this to be the zero element of the given cyclotomic field.

This is safe even if this element was previously initialised as an element of a different field - all prior information about this field element will be safely discarded.

Parameters
fieldthe order of the cyclotomic field to which this field element will now belong; this must be strictly positive.

◆ initialise() [1/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::initialise ( const T &  value)
inline

Sets every entry in the matrix to the given value.

Parameters
valuethe value to assign to each entry.

◆ initialise() [2/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::initialise ( List  allValues)

A Python-only routine that fills the matrix with the given set of elements.

The argument allValues must be a Python list of length rows() * columns(). Its values will be inserted into the matrix row by row (i.e., the first row will be filled, then the second row, and so on).

C++:\n Not available; this routine is for Python only.
Parameters
allValuesthe individual elements to place into the matrix.

◆ IntegerBase() [1/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase
inline

Initialises this integer to zero.

◆ IntegerBase() [2/12]

template<bool supportInfinity = false>
regina::IntegerBase< supportInfinity >::IntegerBase ( const char *  value,
int  base = 10,
bool *  valid = nullptr 
)

Initialises this integer to the given value which is represented as a string of digits in a given base.

If not specified, the base defaults to 10. If the given base is zero, the base will be automatically determined. If the given string begins with 0x or 0X, the base will be assumed to be 16. Otherwise, if the string begins with 0, the base will be assumed to be 8. Otherwise it will be taken as base 10.

Whitespace may be present at the beginning or the end of the given string, and will simply be ignored.

Error detection is possible by passing a non-null boolean pointer as the third parameter to this constructor.

For finer details on how the string parsing works, see strtol() from the standard C library (on which this method is based).

Precondition
The given base is zero, or is between 2 and 36 inclusive.
The given string represents a finite integer in the given base, with optional whitespace beforehand.
Python:\n The final parameter valid is not present.
Parameters
valuethe new value of this integer, represented as a string of digits in base base.
basethe base in which value is given.
validif this pointer is not null, the boolean referenced will be set to true if the entire given string was a valid large integer representation and false otherwise.

◆ IntegerBase() [3/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( const IntegerBase< supportInfinity > &  value)
inline

Initialises this integer to the given value.

Parameters
valuethe new value of this integer.

◆ IntegerBase() [4/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( const IntegerBase<! supportInfinity > &  value)
inlineexplicit

Initialises this integer to the given value.

This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of template parameters.

Precondition
The given integer is not infinite.
Parameters
valuethe new value of this integer.

◆ IntegerBase() [5/12]

template<bool supportInfinity>
template<int bytes>
regina::IntegerBase< supportInfinity >::IntegerBase ( const NativeInteger< bytes > &  value)
inlineexplicit

Initialises this integer to the given value.

This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of integer classes.

Precondition
If bytes is larger than sizeof(long), then bytes is a strict multiple of sizeof(long). For instance, if longs are 8 bytes then you can use bytes=16 but not bytes=12. This restriction is enforced through a compile-time assertion, but may be lifted in future versions of Regina.
Python:\n Not present.
Parameters
valuethe new value of this integer.

◆ IntegerBase() [6/12]

template<bool supportInfinity = false>
regina::IntegerBase< supportInfinity >::IntegerBase ( const std::string &  value,
int  base = 10,
bool *  valid = nullptr 
)

Initialises this integer to the given value which is represented as a string of digits in a given base.

If not specified, the base defaults to 10. If the given base is zero, the base will be automatically determined. If the given string begins with 0x or 0X, the base will be assumed to be 16. Otherwise, if the string begins with 0, the base will be assumed to be 8. Otherwise it will be taken as base 10.

Whitespace may be present at the beginning or the end of the given string, and will simply be ignored.

Error detection is possible by passing a non-null boolean pointer as the third parameter to this constructor.

For finer details on how the string parsing works, see strtol() from the standard C library (on which this method is based).

Precondition
The given base is zero, or is between 2 and 36 inclusive.
The given string represents an integer in the given base, with optional whitespace beforehand.
Python:\n The final parameter valid is not present.
Parameters
valuethe new value of this integer, represented as a string of digits in base base.
basethe base in which value is given.
validif this pointer is not null, the boolean referenced will be set to true if the entire given string was a valid large integer representation and false otherwise.

◆ IntegerBase() [7/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( double  value)
inline

Initialises this integer to the truncation of the given real number.

Parameters
valuethe real number to be truncated.

◆ IntegerBase() [8/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( int  value)
inline

Initialises this integer to the given value.

Python:\n In Python, the only native-integer constructor
is IntegerBase(long).
Parameters
valuethe new value of this integer.

◆ IntegerBase() [9/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( long  value)
inline

Initialises this integer to the given value.

Python:\n In Python, this is the only native-integer
constructor available.
Parameters
valuethe new value of this integer.

◆ IntegerBase() [10/12]

template<bool supportInfinity = false>
regina::IntegerBase< supportInfinity >::IntegerBase ( Long  value)

Initialises this to the given Python arbitrary-precision integer.

The argument is of the Python type long, which Python uses to store integers of arbitrary magnitude (much like Regina does with its Integer and LargeInteger classes).

C++:\n Not available: this constructor is for Python only.
Parameters
valuethe new value of this integer.

◆ IntegerBase() [11/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( unsigned long  value)
inline

Initialises this integer to the given value.

Python:\n In Python, the only native-integer constructor
is IntegerBase(long).
Parameters
valuethe new value of this integer.

◆ IntegerBase() [12/12]

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::IntegerBase ( unsigned  value)
inline

Initialises this integer to the given value.

Python:\n In Python, the only native-integer constructor
is IntegerBase(long).
Parameters
valuethe new value of this integer.

◆ inverse() [1/8]

Cyclotomic regina::Cyclotomic::inverse ( ) const

Returns the inverse of this field element.

This field element is not changed.

Precondition
This field element has already been initialised (and so it already has specified an underlying cyclotomic field).
This field element is non-zero.

◆ inverse() [2/8]

Matrix2 regina::Matrix2::inverse ( ) const

Calculates the inverse of this matrix.

This matrix is not changed.

This routine only works for integer matrices whose determinant is either +1 or -1.

Returns
the inverse of this matrix. If this matrix does not have determinant +1 or -1, the zero matrix will be returned instead.

◆ inverse() [3/8]

template<int n>
Perm< n > regina::Perm< n >::inverse
inline

Finds the inverse of this permutation.

Returns
the inverse of this permutation.

◆ inverse() [4/8]

Rational regina::Rational::inverse ( ) const

Calculates the inverse of this rational.

This rational is not changed.

Returns
the inverse 1 / this.

◆ inverse() [5/8]

Perm< 2 > regina::Perm< 2 >::inverse ( ) const
inline

Finds the inverse of this permutation.

Returns
the inverse of this permutation.

◆ inverse() [6/8]

Perm< 3 > regina::Perm< 3 >::inverse ( ) const
inline

Finds the inverse of this permutation.

Returns
the inverse of this permutation.

◆ inverse() [7/8]

Perm< 4 > regina::Perm< 4 >::inverse ( ) const
inline

Finds the inverse of this permutation.

Returns
the inverse of this permutation.

◆ inverse() [8/8]

Perm< 5 > regina::Perm< 5 >::inverse ( ) const
inline

Finds the inverse of this permutation.

Returns
the inverse of this permutation.

◆ invert() [1/3]

void regina::Cyclotomic::invert ( )

Inverts this field element.

This field element is changed directly.

Precondition
This field element has already been initialised (and so it already has specified an underlying cyclotomic field).
This field element is non-zero.

◆ invert() [2/3]

bool regina::Matrix2::invert ( )

Inverts this matrix.

This routine only works for integer matrices whose determinant is either +1 or -1. Otherwise this matrix is left unchanged.

Returns
true if this matrix was successfully inverted (i.e., its determinant was +1 or -1), or false otherwise.

◆ invert() [3/3]

void regina::Rational::invert ( )

Inverts this rational.

This rational is changed to reflect the result.

◆ isIdentity() [1/7]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
bool regina::Matrix< T, ring >::isIdentity ( ) const
inline

Determines whether this matrix is a square identity matrix.

If this matrix is square, isIdentity() will return true if and only if the matrix has ones in the main diagonal and zeroes everywhere else.

If this matrix is not square, isIdentity() will always return false (even if makeIdentity() was called earlier).

This routine is only available when the template argument ring is true.

Returns
true if and only if this is a square identity matrix.

◆ isIdentity() [2/7]

bool regina::Matrix2::isIdentity ( ) const
inline

Determines if this is the 2x2 identity matrix.

Returns
true if this is the identity matrix, or false otherwise.

◆ isIdentity() [3/7]

template<int n>
bool regina::Perm< n >::isIdentity
inline

Determines if this is the identity permutation.

This is true if and only if every integer 0 ≤ i < n is mapped to itself.

Returns
true if and only if this is the identity permutation.

◆ isIdentity() [4/7]

bool regina::Perm< 2 >::isIdentity ( ) const
inline

Determines if this is the identity permutation.

This is true if and only if each of 0 and 1 is mapped to itself.

Returns
true if and only if this is the identity permutation.

◆ isIdentity() [5/7]

bool regina::Perm< 3 >::isIdentity ( ) const
inline

Determines if this is the identity permutation.

This is true if and only if each of 0, 1 and 2 is mapped to itself.

Returns
true if and only if this is the identity permutation.

◆ isIdentity() [6/7]

bool regina::Perm< 4 >::isIdentity ( ) const
inline

Determines if this is the identity permutation.

This is true if and only if each of 0, 1, 2 and 3 is mapped to itself.

Returns
true if and only if this is the identity permutation.

◆ isIdentity() [7/7]

bool regina::Perm< 5 >::isIdentity ( ) const
inline

Determines if this is the identity permutation.

This is true if and only if each of 0, 1, 2, 3 and 4 is mapped to itself.

Returns
true if and only if this is the identity permutation.

◆ isInfinite()

template<bool supportInfinity = false>
bool regina::IntegerBase< supportInfinity >::isInfinite ( ) const

Returns whether this integer is infinity.

Returns
true if and only if this integer is infinity.

◆ isMonic()

template<typename T >
bool regina::Polynomial< T >::isMonic
inline

Returns whether this polynomial is monic.

A monic polynomial is a non-zero polynomial whose leading coefficient is one.

Returns
true if and only if this is monic.

◆ isNative()

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::isNative
inline

Returns whether we are currently working with a native C/C++ long, or whether we have switched to GMP large integer arithmetic for this integer.

If this integer is infinite, this routine will return false.

Returns
true if and only if we are still using a native C/C++ long.

◆ isNegative()

template<class R >
bool regina::isNegative ( x)
inline

Deprecated routine for managing floating-point roundoff errors.

Determines whether the given real number is strictly negative. Any number within regina::epsilon of zero is considered to be zero.

Precondition
R must be of a floating point real type.
Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.
Parameters
xthe number to examine.
Returns
true if and only if the given number is strictly negative.

◆ isNonNegative()

template<class R >
bool regina::isNonNegative ( x)
inline

Deprecated routine for managing floating-point roundoff errors.

Determines whether the given real number is non-negative. Any number within regina::epsilon of zero is considered to be zero.

Precondition
R must be of a floating point real type.
Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.
Parameters
xthe number to examine.
Returns
true if and only if the given number is non-negative.

◆ isNonPositive()

template<class R >
bool regina::isNonPositive ( x)
inline

Deprecated routine for managing floating-point roundoff errors.

Determines whether the given real number is non-positive. Any number within regina::epsilon of zero is considered to be zero.

Precondition
R must be of a floating point real type.
Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.
Parameters
xthe number to examine.
Returns
true if and only if the given number is non-positive.

◆ isNonZero()

template<class R >
bool regina::isNonZero ( x)
inline

Deprecated routine for managing floating-point roundoff errors.

Determines whether the given real number is non-zero. Any number within regina::epsilon of zero is considered to be zero.

Precondition
R must be of a floating point real type.
Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.
Parameters
xthe number to examine.
Returns
true if and only if the given number is approximately non-zero.

◆ isPermCode() [1/5]

bool regina::Perm< 2 >::isPermCode ( Code  code)
inlinestatic

Determines whether the given integer is a valid internal permutation code.

Valid permutation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().

Returns
true if and only if the given code is a valid internal permutation code.

◆ isPermCode() [2/5]

bool regina::Perm< 3 >::isPermCode ( Code  code)
inlinestatic

Determines whether the given integer is a valid internal permutation code.

Valid permutation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().

Returns
true if and only if the given code is a valid internal permutation code.

◆ isPermCode() [3/5]

static bool regina::Perm< 4 >::isPermCode ( Code  code)
static

Determines whether the given character is a valid first-generation permutation code.

Valid first-generation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().

Warning
This routine will incur additional overhead, since Perm<4> now uses second-generation codes internally. See the class notes and the routine isPermCode2() for details.
Parameters
codethe permutation code to test.
Returns
true if and only if the given code is a valid first-generation permutation code.

◆ isPermCode() [4/5]

template<int n>
bool regina::Perm< n >::isPermCode ( Code  newCode)
static

Determines whether the given integer is a valid internal permutation code.

Valid permutation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().

Returns
true if and only if the given code is a valid internal permutation code.

◆ isPermCode() [5/5]

static bool regina::Perm< 5 >::isPermCode ( Code  newCode)
static

Determines whether the given integer is a valid internal permutation code.

Valid permutation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().

Returns
true if and only if the given code is a valid internal permutation code.

◆ isPermCode2()

bool regina::Perm< 4 >::isPermCode2 ( Code  code)
inlinestatic

Determines whether the given character is a valid second-generation permutation code.

Valid second-generation codes can be passed to setPermCode2() or fromPermCode2(), and are returned by permCode2().

Second-generation codes are fast to work with, since they are used internally by the Perm<4> class.

Parameters
codethe permutation code to test.
Returns
true if and only if the given code is a valid second-generation permutation code.

◆ isPositive()

template<class R >
bool regina::isPositive ( x)
inline

Deprecated routine for managing floating-point roundoff errors.

Determines whether the given real number is strictly positive. Any number within regina::epsilon of zero is considered to be zero.

Precondition
R must be of a floating point real type.
Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.
Parameters
xthe number to examine.
Returns
true if and only if the given number is strictly positive.

◆ isZero() [1/8]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::isZero
inline

Returns whether or not this integer is zero.

This is micro-optimised to be faster than simply testing whether (*this) == 0.

Returns
true if and only if this integer is zero.

◆ isZero() [2/8]

template<int bytes>
bool regina::NativeInteger< bytes >::isZero
inline

Returns whether or not this integer is zero.

Returns
true if and only if this integer is zero.

◆ isZero() [3/8]

template<typename T >
bool regina::Laurent< T >::isZero
inline

Returns whether this is the zero polynomial.

Returns
true if and only if this is the zero polynomial.

◆ isZero() [4/8]

template<typename T >
bool regina::Laurent2< T >::isZero
inline

Returns whether this is the zero polynomial.

Returns
true if and only if this is the zero polynomial.

◆ isZero() [5/8]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
bool regina::Matrix< T, ring >::isZero ( ) const
inline

Determines whether this is the zero matrix.

This routine is only available when the template argument ring is true.

Returns
true if and only if all entries in the matrix are zero.

◆ isZero() [6/8]

bool regina::Matrix2::isZero ( ) const
inline

Determines if this is the 2x2 zero matrix.

Returns
true if this is the zero matrix, or false otherwise.

◆ isZero() [7/8]

template<typename T >
bool regina::Polynomial< T >::isZero
inline

Returns whether this is the zero polynomial.

Returns
true if and only if this is the zero polynomial.

◆ isZero() [8/8]

template<class R >
bool regina::isZero ( x)
inline

Deprecated routine for managing floating-point roundoff errors.

Determines whether the given real number is zero. Any number within regina::epsilon of zero is considered to be zero.

Precondition
R must be of a floating point real type.
Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.
Parameters
xthe number to examine.
Returns
true if and only if the given number is approximately zero.

◆ Laurent() [1/7]

template<typename T >
regina::Laurent< T >::Laurent
inline

Creates the zero polynomial.

◆ Laurent() [2/7]

template<typename T >
regina::Laurent< T >::Laurent ( const Laurent< T > &  value)
inline

Creates a new copy of the given polynomial.

This constructor induces a deep copy of value.

A note for developers: even though this routine is identical to the templated copy constructor, it must be declared and implemented separately. Otherwise the compiler might create its own (incorrect) copy constructor automatically.

Parameters
valuethe polynomial to clone.

◆ Laurent() [3/7]

template<typename T >
template<typename U >
regina::Laurent< T >::Laurent ( const Laurent< U > &  value)
inline

Creates a new copy of the given polynomial.

This constructor induces a deep copy of value.

Precondition
Objects of type T can be assigned values of type U.
Parameters
valuethe polynomial to clone.

◆ Laurent() [4/7]

template<typename T >
regina::Laurent< T >::Laurent ( Laurent< T > &&  value)
inlinenoexcept

Moves the contents of the given polynomial to this new polynomial.

This is a fast (constant time) operation.

The polynomial that was passed (value) will no longer be usable.

Parameters
valuethe polynomial to move.

◆ Laurent() [5/7]

template<typename T >
regina::Laurent< T >::Laurent ( long  exponent)
inlineexplicit

Creates the polynomial x^d for the given exponent d.

Parameters
exponentthe exponent to use for the new polynomial.

◆ Laurent() [6/7]

template<typename T >
template<typename iterator >
regina::Laurent< T >::Laurent ( long  minExp,
iterator  begin,
iterator  end 
)
inline

Creates a new polynomial from the given sequence of coefficients.

The coefficients should appear in order from the smallest exponent term to the largest. The first coefficient in the sequence will be associated with the exponent minExp.

There is no problem if the first and/or last coefficient in the sequence is zero. An empty sequence will be treated as the zero polynomial.

This constructor induces a deep copy of the given range.

Precondition
Objects of type T can be assigned values from dereferenced iterators of type iterator.
Python:\n Instead of the iterators begin and end,
this routine takes a python list of coefficients.
Parameters
minExpthe exponent corresponding to the first coefficient in the sequence.
beginthe beginning of the sequence of coefficients.
enda past-the-end iterator indicating the end of the sequence of coefficients.

◆ Laurent() [7/7]

template<typename T >
regina::Laurent< T >::Laurent ( long  minExp,
std::initializer_list< T >  coefficients 
)
inline

Creates a new polynomial from a hard-coded sequence of coefficients.

This constructor takes a C++11 initialiser list, which should contain the coefficients in order from the smallest exponent term to the largest. The first coefficient in the sequence will be associated with the exponent minExp.

There is no problem if the first and/or last coefficient in the sequence is zero. An empty sequence will be treated as the zero polynomial.

Python:\n Not available, but there is a Python constructor
that takes a list of coefficients (which need not be constant).
Parameters
minExpthe exponent corresponding to the first coefficient in the sequence.
coefficientsthe full sequence of coefficients.

◆ Laurent2() [1/7]

template<typename T >
regina::Laurent2< T >::Laurent2 ( )
default

Creates the zero polynomial.

◆ Laurent2() [2/7]

template<typename T >
regina::Laurent2< T >::Laurent2 ( const Laurent2< T > &  toShift,
long  xShift,
long  yShift 
)

Creates a copy of the given polynomial with all terms multiplied by x^d y^e for some integers d and e.

This constructor induces a deep (and modified) copy of value.

Parameters
toShiftthe polynomial to clone and shift.
xShiftthe integer d, which will be added to all exponents for x.
yShiftthe integer e, which will be added to all exponents for y.

◆ Laurent2() [3/7]

template<typename T >
regina::Laurent2< T >::Laurent2 ( const Laurent2< T > &  value)
inline

Creates a new copy of the given polynomial.

This constructor induces a deep copy of value.

A note for developers: even though this routine is identical to the templated copy constructor, it must be declared and implemented separately. Otherwise the compiler might create its own (incorrect) copy constructor automatically.

Parameters
valuethe polynomial to clone.

◆ Laurent2() [4/7]

template<typename T >
template<typename U >
regina::Laurent2< T >::Laurent2 ( const Laurent2< U > &  value)
inline

Creates a new copy of the given polynomial.

This constructor induces a deep copy of value.

Precondition
Objects of type T can be assigned values of type U.
Parameters
valuethe polynomial to clone.

◆ Laurent2() [5/7]

template<typename T >
regina::Laurent2< T >::Laurent2 ( Laurent2< T > &&  value)
defaultnoexcept

Moves the contents of the given polynomial to this new polynomial.

This is a fast (constant time) operation.

The polynomial that was passed (value) will no longer be usable.

Parameters
valuethe polynomial to move.

◆ Laurent2() [6/7]

template<typename T >
regina::Laurent2< T >::Laurent2 ( long  xExp,
long  yExp 
)
inlineexplicit

Creates the polynomial x^d y^e for the given exponents d and e.

Parameters
xExpthe exponent d, which is attached to x.
yExpthe exponent e, which is attached to y.

◆ Laurent2() [7/7]

template<typename T >
regina::Laurent2< T >::Laurent2 ( std::initializer_list< std::tuple< long, long, T >>  coefficients)
inline

Creates a new polynomial from a hard-coded collection of non-zero coefficients.

This constructor takes a C++11 initialiser list, which should contain a collection of tuples of the form (d, e, v) each representing a term of the form v x^d y^e.

The tuples may be given in any order. An empty sequence will be treated as the zero polynomial.

In practice, this means you can create a hard-coded polynomial using syntax such as:

Precondition
Laurent2<Integer> p = { { 0, 0, 3 }, { 1, -1, 2 } }; \endpre
Each tuple has a non-zero value v, and no two tuples share the same pair of exponents (d, e).
Python:\n Not available.
Parameters
coefficientsthe set of all non-zero coefficients, as outlined above.

◆ lcm() [1/2]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::lcm ( const IntegerBase< supportInfinity > &  other) const

Determines the lowest common multiple of this and the given integer.

This integer is not changed.

Note that the result might possibly be negative.

Precondition
Neither this integer nor other is infinite.
Parameters
otherthe integer whose lowest common multiple with this will be found.
Returns
the lowest common multiple of this and the given integer.

◆ lcm() [2/2]

long regina::lcm ( long  a,
long  b 
)

Calculates the lowest common multiple of two signed integers.

Although the arguments may be negative, the result is guaranteed to be non-negative.

If either of the arguments is zero, the return value will also be zero.

Regarding possible overflow: This routine does not create any temporary integers that are larger than the final LCM.

Parameters
aone of the two integers to work with.
bthe other integer with which to work.
Returns
the lowest common multiple of a and b.

◆ lcmWith()

template<bool supportInfinity = false>
void regina::IntegerBase< supportInfinity >::lcmWith ( const IntegerBase< supportInfinity > &  other)

Sets this integer to be the lowest common multiple of this and the given integer.

Note that the result might possibly be negative.

Precondition
Neither this integer nor other is infinite.
Parameters
otherthe integer whose lowest common multiple with this will be found.

◆ leading()

template<typename T >
const T & regina::Polynomial< T >::leading
inline

Returns the leading coefficient of this polynomial.

If this is the zero polynomial, then the leading coefficient will be zero.

Returns
the leading coefficient of this polynomial.

◆ legendre()

template<bool supportInfinity = false>
int regina::IntegerBase< supportInfinity >::legendre ( const IntegerBase< supportInfinity > &  p) const

Returns the Legendre symbol (a/p), where a is this integer and p is an odd prime.

The Legendre symbol is equal to 0 if this integer is divisible by p, 1 if this integer is congruent to a square mod p (but not divisible by p), and -1 otherwise.

Precondition
The given integer p is an odd positive prime.
This integer is not infinite.
Parameters
pthe given odd prime.
Returns
The Legendre symbol (0, 1 or -1) as described above.
Author
Ryan Budney

◆ longValue()

template<bool supportInfinity>
long regina::IntegerBase< supportInfinity >::longValue
inline

Returns the value of this integer as a long.

It is the programmer's reponsibility to ensure that this integer is within the required range. If this integer is too large or small to fit into a long, then the result will be undefined.

Note that, assuming the value is within the required range, this routine will give correct results regardless of whether the underlying representation is a native or large integer.

Precondition
This integer is not infinity.
Returns
the value of this integer.

◆ makeIdentity()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::makeIdentity ( )
inline

Turns this matrix into an identity matrix.

This matrix need not be square; after this routine it will have entry(r,c) equal to 1 if r == c and 0 otherwise.

This routine is only available when the template argument ring is true.

◆ makeInfinite()

template<bool supportInfinity = false>
void regina::IntegerBase< supportInfinity >::makeInfinite ( )
inline

Sets this integer to be infinity.

If the template parameter supportInfinity is false, this routine safely does nothing.

◆ makeLarge()

template<bool supportInfinity>
void regina::IntegerBase< supportInfinity >::makeLarge
inline

Converts this integer to use a GMP large integer representation, regardless of whether this is actually necessary.

The contents of this integer will be preserved.

It does not matter which kind of representation this integer is currently using.

Precondition
This integer is not infinite.

◆ Matrix() [1/3]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::Matrix ( const Matrix< T, ring > &  src)
inline

Creates a new matrix that is a clone of the given matrix.

This constructor induces a deep copy of src.

Parameters
srcthe matrix to clone.

◆ Matrix() [2/3]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::Matrix ( Matrix< T, ring > &&  src)
inlinenoexcept

Moves the given matrix into this new matrix.

This is a fast (constant time) operation.

The matrix that is passed (src) will no longer be usable.

Parameters
srcthe matrix to move.

◆ Matrix() [3/3]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::Matrix ( unsigned long  rows,
unsigned long  cols 
)
inline

Creates a new matrix of the given size.

All entries will be initialised using their default constructors.

In particular, this means that for Regina's own integer classes (Integer, LargeInteger and NativeInteger), all entries will be initialised to zero.

Warning
If T is a native C++ integer type (such as int or long), then the matrix elements will not be initialised to any particular value.
Precondition
The given number of rows and columns are both strictly positive.
Parameters
rowsthe number of rows in the new matrix.
colsthe number of columns in the new matrix.

◆ Matrix2() [1/4]

regina::Matrix2::Matrix2 ( )
inline

Initialises to the zero matrix.

◆ Matrix2() [2/4]

regina::Matrix2::Matrix2 ( const long  values[2][2])
inline

Initialises to the given integer values.

Each given integer values[r][c] will be placed in row r, column c.

Python:\n Not present.
Parameters
valuesthe four values to insert into the new matrix.

◆ Matrix2() [3/4]

regina::Matrix2::Matrix2 ( const Matrix2 cloneMe)
inline

Initialises to a copy of the given matrix.

Parameters
cloneMethe matrix to be copied.

◆ Matrix2() [4/4]

regina::Matrix2::Matrix2 ( long  val00,
long  val01,
long  val10,
long  val11 
)
inline

Initialises to the given integer values.

Parameters
val00the value to place in row 0, column 0.
val01the value to place in row 0, column 1.
val10the value to place in row 1, column 0.
val11the value to place in row 1, column 1.

◆ maxExp()

template<typename T >
long regina::Laurent< T >::maxExp
inline

Returns the largest exponent that appears in this polynomial with a non-zero coefficient.

If this is the zero polynomial, then this routine returns 0.

Returns
the largest exponent.

◆ metricalSmithNormalForm()

void regina::metricalSmithNormalForm ( MatrixInt matrix,
MatrixInt rowSpaceBasis = 0,
MatrixInt rowSpaceBasisInv = 0,
MatrixInt colSpaceBasis = 0,
MatrixInt colSpaceBasisInv = 0 
)

An alternative Smith normal form algorithm that also returns change of basis matrices.

This routine may be preferable for extremely large matrices. This is a variant of Hafner-McCurley and Havas-Holt-Rees's description of pivoting methods.

The only input argument is matrix. The four remaining arguments (the change of basis matrices), if passed, will be refilled, though they must be constructed with the correct dimensions as seen in the preconditions below. All five arguments are used to return information as follows.

Let M be the initial value of matrix, and let S be the Smith normal form of M. After this routine exits:

  • The argument matrix will contain the Smith normal form S;
  • colSpaceBasis * M * rowSpaceBasis = S;
  • colSpaceBasisInv * S * rowSpaceBasisInv = M;
  • colSpaceBasis * colSpaceBasisInv and rowSpaceBasis * rowSpaceBasisInv are both identity matrices.

Thus, one obtains the Smith normal form the original matrix by multiplying on the left by ColSpaceBasis and on the right by RowSpaceBasis.

Precondition
The matrices rowSpaceBasis and rowSpaceBasisInv, if passed, must be square with side length matrix.columns().
The matrices colSpaceBasis and colSpaceBasisInv, if passed, must be square, with side length matrix.rows().
Parameters
matrixthe original matrix to put into Smith Normal Form (this need not be square). When the algorithm terminates, this matrix is in its Smith Normal Form.
rowSpaceBasisused to return a change of basis matrix (see above for details). This is optional; you may pass a null pointer instead.
rowSpaceBasisInvused to return the inverse of rowSpaceBasis. This is optional; you may pass a null pointer instead.
colSpaceBasisused to return a change of basis matrix (see above for details). This is optional; you may pass a null pointer instead.
colSpaceBasisInvused to return the inverse of colSpaceBasis. This is optional; you may pass a null pointer instead.
Author
Ryan Budney

◆ minExp()

template<typename T >
long regina::Laurent< T >::minExp
inline

Returns the smallest exponent that appears in this polynomial with a non-zero coefficient.

If this is the zero polynomial, then this routine returns 0.

Returns
the smallest exponent.

◆ modularInverse()

unsigned long regina::modularInverse ( unsigned long  n,
unsigned long  k 
)

Calculates the multiplicative inverse of one integer modulo another.

The inverse returned will be between 0 and n-1 inclusive.

Precondition
n and k are both strictly positive;
n and k have no common factors.
Parameters
nthe modular base in which to work.
kthe number whose multiplicative inverse should be found.
Returns
the inverse v for which k * v == 1 (mod n).

◆ multCol()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::multCol ( unsigned long  column,
factor 
)
inline

Multiplies the given column by the given factor.

Note that factor is passed by value in case it is an element of the row to be changed.

This routine is only available when the template argument ring is true.

Precondition
The given column is between 0 and columns()-1 inclusive.
Parameters
columnthe column to work with.
factorthe factor by which to multiply the given column.

◆ multiplyAs()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
Matrix regina::Matrix< T, ring >::multiplyAs ( const Matrix< T, ring > &  other) const
inline

Deprecated alias for the multiplication operator.

Multiplies this by the given matrix, and returns a new matrix (of this same class) as a result. This matrix is not changed.

As of Regina 5.3, the template parameter MatrixClass has been removed, since Regina's old matrix class hierarchy has been replaced with a single Matrix class. It is harmless if you still pass a template parameter, but your parameter will be ignored.

This routine is only available when the template argument ring is true.

Precondition
The number of columns in this matrix equals the number of rows in the given matrix.
Deprecated:
Simply use the multiplication operator (which is now identical to this routine). This routine multiplyAs() dated back to when Matrix had a hierarchy of subclasses that offered different capabilities according to the underlying type T. Now that there is just a single class Matrix, this routine is no longer required.
Python:\n Not present.
Parameters
otherthe other matrix to multiply this matrix by.
Returns
the product matrix this * other.

◆ multRow()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::multRow ( unsigned long  row,
factor 
)
inline

Multiplies the given row by the given factor.

Note that factor is passed by value in case it is an element of the row to be changed.

This routine is only available when the template argument ring is true.

Precondition
The given row is between 0 and rows()-1 inclusive.
Parameters
rowthe row to work with.
factorthe factor by which to multiply the given row.

◆ NativeInteger() [1/4]

template<int bytes>
regina::NativeInteger< bytes >::NativeInteger
inline

Initialises this integer to zero.

◆ NativeInteger() [2/4]

template<int bytes>
template<bool supportInfinity>
regina::NativeInteger< bytes >::NativeInteger ( const IntegerBase< supportInfinity > &  value)
inlineexplicit

Initialises this integer to the given value.

This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of integer classes.

It is the programmer's reponsibility to ensure that the given value fits within the required range. If the given value is too large or small to fit into this native type, then this new NativeInteger will have an undefined initial value.

Precondition
If bytes is larger than sizeof(long), then bytes is a strict multiple of sizeof(long). For instance, if longs are 8 bytes then you can use this routine with bytes=16 but not bytes=12. This restriction is enforced through a compile-time assertion, but may be lifted in future versions of Regina.
The given integer is not infinity.
Python:\n Not present.
Parameters
valuethe new value of this integer.

◆ NativeInteger() [3/4]

template<int bytes>
regina::NativeInteger< bytes >::NativeInteger ( const NativeInteger< bytes > &  value)
inline

Initialises this integer to the given value.

Parameters
valuethe new value of this integer.

◆ NativeInteger() [4/4]

template<int bytes>
regina::NativeInteger< bytes >::NativeInteger ( Native  value)
inline

Initialises this integer to the given value.

Parameters
valuethe new value of this integer.

◆ nativeValue() [1/2]

template<bool supportInfinity>
template<int bytes>
IntOfSize< bytes >::type regina::IntegerBase< supportInfinity >::nativeValue

Returns the value of this integer as a native integer of some fixed byte length.

It is the programmer's reponsibility to ensure that this integer is within the required range. If this integer is too large or small to fit into the return type, then the result will be undefined.

Note that, assuming the value is within the required range, this routine will give correct results regardless of whether the underlying representation is a native or large integer.

Precondition
If bytes is larger than sizeof(long), then bytes is a strict multiple of sizeof(long). For instance, if longs are 8 bytes then you can use this routine with bytes=16 but not bytes=12. This restriction is enforced through a compile-time assertion, but may be lifted in future versions of Regina.
This integer is not infinity.
Python:\n Not present.
Returns
the value of this integer.

◆ nativeValue() [2/2]

template<int bytes>
NativeInteger< bytes >::Native regina::NativeInteger< bytes >::nativeValue
inline

Returns the value of this integer in its native type.

Returns
the value of this integer.

◆ negate() [1/10]

void regina::Cyclotomic::negate ( )
inline

Negates this field element.

This field element is changed directly.

◆ negate() [2/10]

template<bool supportInfinity>
void regina::IntegerBase< supportInfinity >::negate
inline

Negates this integer.

This integer is changed to reflect the result.

Negating infinity will result in infinity.

◆ negate() [3/10]

template<int bytes>
void regina::NativeInteger< bytes >::negate
inline

Negates this integer.

This integer is changed to reflect the result.

◆ negate() [4/10]

template<typename T >
void regina::Laurent< T >::negate
inline

Negates this polynomial.

This field element is changed directly.

◆ negate() [5/10]

template<typename T >
void regina::Laurent2< T >::negate
inline

Negates this polynomial.

This field element is changed directly.

◆ negate() [6/10]

void regina::Matrix2::negate ( )
inline

Negates this matrix.

This matrix is changed to reflect the result.

◆ negate() [7/10]

template<typename T >
void regina::Polynomial< T >::negate
inline

Negates this polynomial.

This field element is changed directly.

◆ negate() [8/10]

void regina::Rational::negate ( )
inline

Negates this rational.

This rational is changed to reflect the result.

◆ negate() [9/10]

void regina::Ray::negate ( )
inline

Negates every element of this vector.

This is an optimised implementation that overrides Vector<LargeInteger>::negate().

◆ negate() [10/10]

template<class T >
void regina::Vector< T >::negate ( )
inline

Negates every element of this vector.

◆ norm()

template<class T >
T regina::Vector< T >::norm ( ) const
inline

Returns the norm of this vector.

This is the dot product of the vector with itself.

Returns
the norm of this vector.

◆ numerator()

Integer regina::Rational::numerator ( ) const

Returns the numerator of this rational.

Note that rationals are always stored in lowest terms with non-negative denominator. Infinity will be stored as 1/0.

Returns
the numerator.

◆ operator!=() [1/17]

bool regina::Cyclotomic::operator!= ( const Cyclotomic rhs) const
inline

Tests whether or not this and the given argument are the same element of the same cyclotomic field.

If this and rhs have different underlying fields then this test will always return true (indicating that the elements are not equal), even if they take the same numerical value when evaluated as complex numbers.

If either this or rhs have not been initialised (typically because they were created using the default constructor), then this comparison will return true. If both field elements have not been initialised, then this comparison will return false.

Parameters
rhsthe value to compare with this.
Returns
false if this and rhs are the same element of the same cyclotomic field, or true if they are not.

◆ operator!=() [2/17]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator!= ( const IntegerBase< supportInfinity > &  rhs) const
inline

Determines if this is not equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are not equal.

◆ operator!=() [3/17]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator!= ( const IntegerBase<! supportInfinity > &  rhs) const
inline

Determines if this is not equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are not equal.

◆ operator!=() [4/17]

template<typename T >
bool regina::Laurent2< T >::operator!= ( const Laurent2< T > &  rhs) const
inline

Tests whether this and the given polynomial are not equal.

Parameters
rhsthe polynomial to compare with this.
Returns
true if and only if this and the given polynomial are not equal.

◆ operator!=() [5/17]

template<typename T >
bool regina::Laurent< T >::operator!= ( const Laurent< T > &  rhs) const
inline

Tests whether this and the given polynomial are not equal.

Parameters
rhsthe polynomial to compare with this.
Returns
true if and only if this and the given polynomial are not equal.

◆ operator!=() [6/17]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
bool regina::Matrix< T, ring >::operator!= ( const Matrix< T, ring > &  other) const
inline

Determines whether this and the given matrix are different.

Two matrices are different if either (i) their dimensions differ, or (ii) the corresponding elements of each matrix differ in at least one location.

Note that this routine can happily deal with two matrices of different dimensions (in which case it will always return true).

This routine returns true if and only if the equality operator (==) returns false.

Precondition
The type T provides an equality operator (==).
Parameters
otherthe matrix to compare with this.
Returns
true if the matrices are different as described above, or false otherwise.

◆ operator!=() [7/17]

bool regina::Matrix2::operator!= ( const Matrix2 compare) const
inline

Determines if this is not equal to the given matrix.

Parameters
comparethe matrix with which this will be compared.
Returns
true if and only if this matrix is not equal to compare.

◆ operator!=() [8/17]

template<int bytes>
bool regina::NativeInteger< bytes >::operator!= ( const NativeInteger< bytes > &  rhs) const
inline

Determines if this is not equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are not equal.

◆ operator!=() [9/17]

template<int n>
bool regina::Perm< n >::operator!= ( const Perm< n > &  other) const
inline

Determines if this differs from the given permutation.

This is true if and only if the two permutations have different images for some 0 ≤ i < n.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation differ.

◆ operator!=() [10/17]

bool regina::Perm< 2 >::operator!= ( const Perm< 2 > &  other) const
inline

Determines if this differs from the given permutation.

This is true if and only if the two permutations have different images for at least one of 0 or 1.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation differ.

◆ operator!=() [11/17]

bool regina::Perm< 3 >::operator!= ( const Perm< 3 > &  other) const
inline

Determines if this differs from the given permutation.

This is true if and only if the two permutations have different images for at least one of 0, 1 or 2.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation differ.

◆ operator!=() [12/17]

bool regina::Perm< 4 >::operator!= ( const Perm< 4 > &  other) const
inline

Determines if this differs from the given permutation.

This is true if and only if the two permutations have different images for at least one of 0, 1, 2 or 3.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation differ.

◆ operator!=() [13/17]

bool regina::Perm< 5 >::operator!= ( const Perm< 5 > &  other) const
inline

Determines if this differs from the given permutation.

This is true if and only if the two permutations have different images for at least one of 0, 1, 2, 3 or 4.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation differ.

◆ operator!=() [14/17]

template<typename T >
bool regina::Polynomial< T >::operator!= ( const Polynomial< T > &  rhs) const
inline

Tests whether this and the given polynomial are not equal.

Parameters
rhsthe polynomial to compare with this.
Returns
true if and only if this and the given polynomial are not equal.

◆ operator!=() [15/17]

bool regina::Rational::operator!= ( const Rational compare) const
inline

Determines if this is not equal to the given rational.

Parameters
comparethe rational with which this will be compared.
Returns
true if and only if this rational is not equal to compare.

◆ operator!=() [16/17]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator!= ( long  rhs) const
inline

Determines if this is not equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are not equal.

◆ operator!=() [17/17]

template<int bytes>
bool regina::NativeInteger< bytes >::operator!= ( Native  rhs) const
inline

Determines if this is not equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are not equal.

◆ operator%() [1/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator% ( const IntegerBase< supportInfinity > &  other) const
inline

Determines the remainder when this integer is divided by the given integer.

If non-zero, the result will have the same sign as this integer. This integer is not changed.

For a division routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
Neither this nor other is infinite.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the remainder this modulo other.

◆ operator%() [2/4]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator% ( const NativeInteger< bytes > &  other) const
inline

Determines the remainder when this integer is divided by the given integer.

If non-zero, the result will have the same sign as this integer. This integer is not changed.

For a division routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the remainder this modulo other.

◆ operator%() [3/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator% ( long  other) const
inline

Determines the remainder when this integer is divided by the given integer.

If non-zero, the result will have the same sign as this integer. This integer is not changed.

For a division routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
This integer is not infinite.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the remainder this modulo other.

◆ operator%() [4/4]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator% ( Native  other) const
inline

Determines the remainder when this integer is divided by the given integer.

If non-zero, the result will have the same sign as this integer. This integer is not changed.

For a division routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the remainder this modulo other.

◆ operator%=() [1/4]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator%= ( const IntegerBase< supportInfinity > &  other)

Reduces this integer modulo the given integer.

If non-zero, the result will have the same sign as the original value of this integer. This integer is changed to reflect the result.

For a mod routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
Neither this nor other is infinite.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer modulo which this integer will be reduced.
Returns
a reference to this integer with its new value.

◆ operator%=() [2/4]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator%= ( const NativeInteger< bytes > &  other)
inline

Reduces this integer modulo the given integer.

If non-zero, the result will have the same sign as the original value of this integer. This integer is changed to reflect the result.

For a mod routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer modulo which this integer will be reduced.
Returns
a reference to this integer with its new value.

◆ operator%=() [3/4]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator%= ( long  other)

Reduces this integer modulo the given integer.

If non-zero, the result will have the same sign as the original value of this integer. This integer is changed to reflect the result.

For a mod routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
This integer is not infinite.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer modulo which this integer will be reduced.
Returns
a reference to this integer with its new value.

◆ operator%=() [4/4]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator%= ( Native  other)
inline

Reduces this integer modulo the given integer.

If non-zero, the result will have the same sign as the original value of this integer. This integer is changed to reflect the result.

For a mod routine that always returns a non-negative remainder, see divisionAlg().

Precondition
other is not zero.
Warning
As I understand it, the sign of the result under native C/C++ integer division when the second operand is negative was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 sign rule as described above.
Parameters
otherthe integer modulo which this integer will be reduced.
Returns
a reference to this integer with its new value.

◆ operator()()

template<typename T >
const T & regina::Laurent2< T >::operator() ( long  xExp,
long  yExp 
) const
inline

Returns the given coefficient of this polynomial.

There are no restrictions on the exponents xExp and yExp.

Python:\n In Python, this is the square bracket operator,
not the round bracket operator; that is, Python users can access coefficients through the syntax poly[xExp, yExp]. Moreover, this operator can also set cofficients; that is, you can write poly[xExp, yExp] = value. In contrast, C++ users must use the separate routine set(), due to the fact that in C++ this bracket operator is const.
Parameters
xExpthe exponent attached to x.
yExpthe exponent attached to y.
Returns
the coefficient of the term with the given exponents.

◆ operator*() [1/27]

Cyclotomic regina::operator* ( const Cyclotomic lhs,
const Cyclotomic rhs 
)

Multiplies the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to multiply.
rhsthe second field element to multiply.
Returns
the product of both field elements.

◆ operator*() [2/27]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator* ( const IntegerBase< supportInfinity > &  other) const
inline

Multiplies this by the given integer and returns the result.

This integer is not changed.

If either factor of the product is infinite, the result will be infinity.

Parameters
otherthe integer to multiply by this integer.
Returns
the product this times other.

◆ operator*() [3/27]

template<typename T >
Laurent2< T > regina::operator* ( const Laurent2< T > &  lhs,
const Laurent2< T > &  rhs 
)
inline

Multiplies the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe first polynomial to multiply.
rhsthe second polynomial to multiply.
Returns
the product of both polynomials.

◆ operator*() [4/27]

template<typename T >
Laurent< T > regina::operator* ( const Laurent< T > &  lhs,
const Laurent< T > &  rhs 
)

Multiplies the two given polynomials.

Parameters
lhsthe first polynomial to multiply.
rhsthe second polynomial to multiply.
Returns
the product of both polynomials.

◆ operator*() [5/27]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
Matrix regina::Matrix< T, ring >::operator* ( const Matrix< T, ring > &  other) const
inline

Multiplies this by the given matrix, and returns the result.

This matrix is not changed.

This routine is only available when the template argument ring is true.

Precondition
The number of columns in this matrix equals the number of rows in the given matrix.
Parameters
otherthe other matrix to multiply this matrix by.
Returns
the product matrix this * other.

◆ operator*() [6/27]

Matrix2 regina::Matrix2::operator* ( const Matrix2 other) const
inline

Calculates the matrix product of this and the given matrix.

Neither this nor the given matrix is changed.

Parameters
otherthe matrix that this should be multiplied by.
Returns
the product this * other.

◆ operator*() [7/27]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator* ( const NativeInteger< bytes > &  other) const
inline

Multiplies this by the given integer and returns the result.

This integer is not changed.

Parameters
otherthe integer to multiply by this integer.
Returns
the product this times other.

◆ operator*() [8/27]

template<int n>
Perm< n > regina::Perm< n >::operator* ( const Perm< n > &  q) const
inline

Returns the composition of this permutation with the given permutation.

If this permutation is p, the resulting permutation will satisfy (p*q)[x] == p[q[x]].

Parameters
qthe permutation to compose this with.
Returns
the composition of both permutations.

◆ operator*() [9/27]

Perm< 2 > regina::Perm< 2 >::operator* ( const Perm< 2 > &  q) const
inline

Returns the composition of this permutation with the given permutation.

If this permutation is p, the resulting permutation will be p o q, satisfying (p*q)[x] == p[q[x]].

Parameters
qthe permutation with which to compose this.
Returns
the composition of both permutations.

◆ operator*() [10/27]

Perm< 3 > regina::Perm< 3 >::operator* ( const Perm< 3 > &  q) const
inline

Returns the composition of this permutation with the given permutation.

If this permutation is p, the resulting permutation will be p o q, satisfying (p*q)[x] == p[q[x]].

Parameters
qthe permutation with which to compose this.
Returns
the composition of both permutations.

◆ operator*() [11/27]

Perm< 4 > regina::Perm< 4 >::operator* ( const Perm< 4 > &  q) const
inline

Returns the composition of this permutation with the given permutation.

If this permutation is p, the resulting permutation will be p o q, satisfying (p*q)[x] == p[q[x]].

Parameters
qthe permutation with which to compose this.
Returns
the composition of both permutations.

◆ operator*() [12/27]

Perm< 5 > regina::Perm< 5 >::operator* ( const Perm< 5 > &  q) const
inline

Returns the composition of this permutation with the given permutation.

If this permutation is p, the resulting permutation will be p o q, satisfying (p*q)[x] == p[q[x]].

Parameters
qthe permutation with which to compose this.
Returns
the composition of both permutations.

◆ operator*() [13/27]

template<typename T >
Polynomial< T > regina::operator* ( const Polynomial< T > &  lhs,
const Polynomial< T > &  rhs 
)

Multiplies the two given polynomials.

Parameters
lhsthe first polynomial to multiply.
rhsthe second polynomial to multiply.
Returns
the product of both polynomials.

◆ operator*() [14/27]

Rational regina::Rational::operator* ( const Rational r) const

Calculates the product of two rationals.

This rational is not changed.

Parameters
rthe rational with which to multiply this.
Returns
the product this * r.

◆ operator*() [15/27]

Cyclotomic regina::operator* ( const Rational scalar,
Cyclotomic  elt 
)
inline

Multiplies the given field element by the given rational.

Parameters
scalarthe rational to multiply by.
eltthe field element to multiply by.
Returns
the product of the given field element and rational.

◆ operator*() [16/27]

template<typename T >
Laurent2< T > regina::operator* ( const typename Laurent2< T >::Coefficient &  scalar,
Laurent2< T >  poly 
)
inline

Multiplies the given polynomial by the given scalar constant.

The scalar is simply of type T; we use the identical type Laurent2<T>::Coefficient here to assist with C++ template type matching.

Parameters
scalarthe scalar to multiply by.
polythe polynomial to multiply by.
Returns
the product of the given polynomial and scalar.

◆ operator*() [17/27]

template<typename T >
Laurent< T > regina::operator* ( const typename Laurent< T >::Coefficient &  scalar,
Laurent< T >  poly 
)
inline

Multiplies the given polynomial by the given scalar constant.

The scalar is simply of type T; we use the identical type Laurent<T>::Coefficient here to assist with C++ template type matching.

Parameters
scalarthe scalar to multiply by.
polythe polynomial to multiply by.
Returns
the product of the given polynomial and scalar.

◆ operator*() [18/27]

template<typename T >
Polynomial< T > regina::operator* ( const typename Polynomial< T >::Coefficient &  scalar,
Polynomial< T >  poly 
)
inline

Multiplies the given polynomial by the given scalar constant.

The scalar is simply of type T; we use the identical type Polynomial<T>::Coefficient here to assist with C++ template type matching.

Parameters
scalarthe scalar to multiply by.
polythe polynomial to multiply by.
Returns
the product of the given polynomial and scalar.

◆ operator*() [19/27]

template<class T >
T regina::Vector< T >::operator* ( const Vector< T > &  other) const
inline

Calculates the dot product of this vector and the given vector.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector with which this will be multiplied.
Returns
the dot product of this and the given vector.

◆ operator*() [20/27]

Cyclotomic regina::operator* ( Cyclotomic  elt,
const Rational scalar 
)
inline

Multiplies the given field element by the given rational.

Parameters
eltthe field element to multiply by.
scalarthe rational to multiply by.
Returns
the product of the given field element and rational.

◆ operator*() [21/27]

template<typename T >
Laurent2< T > regina::operator* ( Laurent2< T >  poly,
const typename Laurent2< T >::Coefficient &  scalar 
)
inline

Multiplies the given polynomial by the given scalar constant.

The scalar is simply of type T; we use the identical type Laurent2<T>::Coefficient here to assist with C++ template type matching.

Parameters
polythe polynomial to multiply by.
scalarthe scalar to multiply by.
Returns
the product of the given polynomial and scalar.

◆ operator*() [22/27]

template<typename T >
Laurent< T > regina::operator* ( Laurent< T >  poly,
const typename Laurent< T >::Coefficient &  scalar 
)
inline

Multiplies the given polynomial by the given scalar constant.

The scalar is simply of type T; we use the identical type Laurent<T>::Coefficient here to assist with C++ template type matching.

Parameters
polythe polynomial to multiply by.
scalarthe scalar to multiply by.
Returns
the product of the given polynomial and scalar.

◆ operator*() [23/27]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::operator* ( long  lhs,
const IntegerBase< supportInfinity > &  rhs 
)
inline

Multiplies the given native integer with the given large integer.

If the large integer is infinite, the result will also be infinity.

Python:\n Not available.
Parameters
lhsthe native integer to multiply.
rhsthe large integer to multiply.
Returns
the product lhs times rhs.

◆ operator*() [24/27]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator* ( long  other) const
inline

Multiplies this by the given integer and returns the result.

This integer is not changed.

If either factor of the product is infinite, the result will be infinity.

Parameters
otherthe integer to multiply by this integer.
Returns
the product this times other.

◆ operator*() [25/27]

Matrix2 regina::Matrix2::operator* ( long  scalar) const
inline

Calculates the scalar product of this matrix and the given integer.

This matrix is not changed.

Parameters
scalarthe integer that this matrix should be multiplied by.
Returns
the product this * scalar.

◆ operator*() [26/27]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator* ( Native  other) const
inline

Multiplies this by the given integer and returns the result.

This integer is not changed.

Parameters
otherthe integer to multiply by this integer.
Returns
the product this times other.

◆ operator*() [27/27]

template<typename T >
Polynomial< T > regina::operator* ( Polynomial< T >  poly,
const typename Polynomial< T >::Coefficient &  scalar 
)
inline

Multiplies the given polynomial by the given scalar constant.

The scalar is simply of type T; we use the identical type Polynomial<T>::Coefficient here to assist with C++ template type matching.

Parameters
polythe polynomial to multiply by.
scalarthe scalar to multiply by.
Returns
the product of the given polynomial and scalar.

◆ operator*=() [1/16]

Cyclotomic& regina::Cyclotomic::operator*= ( const Cyclotomic other)

Multiplies this by the given field element.

Precondition
The argument other belongs to the same cyclotomic field as this.
Parameters
otherthe field element to multiply this by.
Returns
a reference to this field element.

◆ operator*=() [2/16]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator*= ( const IntegerBase< supportInfinity > &  other)

Multiplies the given integer by this.

This integer is changed to reflect the result.

If either factor of the product is infinite, the result will be infinity.

Parameters
otherthe integer to multiply with this integer.
Returns
a reference to this integer with its new value.

◆ operator*=() [3/16]

template<typename T >
Laurent2< T > & regina::Laurent2< T >::operator*= ( const Laurent2< T > &  other)

Multiplies this by the given polynomial.

This and the given polynomial need not have the same range of non-zero coefficients.

Parameters
otherthe polynomial to multiply this by.
Returns
a reference to this polynomial.

◆ operator*=() [4/16]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator*= ( const Laurent< T > &  other)

Multiplies this by the given polynomial.

The given polynomial need not have the same minimum and/or maximum exponents as this.

Parameters
otherthe polynomial to multiply this by.
Returns
a reference to this polynomial.

◆ operator*=() [5/16]

Matrix2& regina::Matrix2::operator*= ( const Matrix2 other)

Multiplies this by the given matrix.

This matrix is changed to reflect the result.

Parameters
otherthe matrix by which this should be multiplied.
Returns
a reference to this matrix with its new value.

◆ operator*=() [6/16]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator*= ( const NativeInteger< bytes > &  other)
inline

Multiplies the given integer by this.

This integer is changed to reflect the result.

Parameters
otherthe integer to multiply with this integer.
Returns
a reference to this integer with its new value.

◆ operator*=() [7/16]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator*= ( const Polynomial< T > &  other)

Multiplies this by the given polynomial.

Parameters
otherthe polynomial to multiply this by.
Returns
a reference to this polynomial.

◆ operator*=() [8/16]

Rational& regina::Rational::operator*= ( const Rational other)

Multiplies the given rational by this.

This rational is changed to reflect the result.

Parameters
otherthe rational to multiply by this.
Returns
a reference to this rational with its new value.

◆ operator*=() [9/16]

Cyclotomic & regina::Cyclotomic::operator*= ( const Rational scalar)
inline

Multiplies this field element by the given rational.

This has the effect of multiplying the polynomial representation by a scalar constant.

Parameters
scalarthe rational to multiply this by.
Returns
a reference to this field element.

◆ operator*=() [10/16]

template<class T >
void regina::Vector< T >::operator*= ( const T &  factor)
inline

Multiplies this vector by the given scalar.

Parameters
factorthe scalar with which this will be multiplied.

◆ operator*=() [11/16]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator*= ( const T &  scalar)

Multiplies this polynomial by the given constant.

Parameters
scalarthe scalar factor to multiply by.
Returns
a reference to this polynomial.

◆ operator*=() [12/16]

template<typename T >
Laurent2< T > & regina::Laurent2< T >::operator*= ( const T &  scalar)
inline

Multiplies this polynomial by the given constant.

Parameters
scalarthe scalar factor to multiply by.
Returns
a reference to this polynomial.

◆ operator*=() [13/16]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator*= ( const T &  scalar)

Multiplies this polynomial by the given constant.

Parameters
scalarthe scalar factor to multiply by.
Returns
a reference to this polynomial.

◆ operator*=() [14/16]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator*= ( long  other)

Multiplies the given integer by this.

This integer is changed to reflect the result.

If either factor of the product is infinite, the result will be infinity.

Parameters
otherthe integer to multiply with this integer.
Returns
a reference to this integer with its new value.

◆ operator*=() [15/16]

Matrix2 & regina::Matrix2::operator*= ( long  scalar)
inline

Multiplies this by the given scalar.

This matrix is changed to reflect the result.

Parameters
scalarthe scalar by which this should be multiplied.
Returns
a reference to this matrix with its new value.

◆ operator*=() [16/16]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator*= ( Native  other)
inline

Multiplies the given integer by this.

This integer is changed to reflect the result.

Parameters
otherthe integer to multiply with this integer.
Returns
a reference to this integer with its new value.

◆ operator+() [1/23]

Cyclotomic regina::operator+ ( const Cyclotomic lhs,
const Cyclotomic rhs 
)
inline

Adds the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to add.
rhsthe second field element to add.
Returns
the sum of both field elements.

◆ operator+() [2/23]

Cyclotomic regina::operator+ ( const Cyclotomic lhs,
Cyclotomic &&  rhs 
)
inline

Adds the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to add.
rhsthe second field element to add.
Returns
the sum of both field elements.

◆ operator+() [3/23]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator+ ( const IntegerBase< supportInfinity > &  other) const
inline

Adds this to the given integer and returns the result.

This integer is not changed.

If either term of the sum is infinite, the result will be infinity.

Parameters
otherthe integer to add to this integer.
Returns
the sum this plus other.

◆ operator+() [4/23]

template<typename T >
Laurent2< T > regina::operator+ ( const Laurent2< T > &  lhs,
const Laurent2< T > &  rhs 
)
inline

Adds the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [5/23]

template<typename T >
Laurent2< T > regina::operator+ ( const Laurent2< T > &  lhs,
Laurent2< T > &&  rhs 
)
inline

Adds the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [6/23]

template<typename T >
Laurent< T > regina::operator+ ( const Laurent< T > &  lhs,
const Laurent< T > &  rhs 
)

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [7/23]

template<typename T >
Laurent< T > regina::operator+ ( const Laurent< T > &  lhs,
Laurent< T > &&  rhs 
)
inline

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [8/23]

Matrix2 regina::Matrix2::operator+ ( const Matrix2 other) const
inline

Calculates the sum of two matrices.

Neither this nor the given matrix is changed.

Parameters
otherthe matrix to add to this.
Returns
the sum this + other.

◆ operator+() [9/23]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator+ ( const NativeInteger< bytes > &  other) const
inline

Adds this to the given integer and returns the result.

This integer is not changed.

Parameters
otherthe integer to add to this integer.
Returns
the sum this plus other.

◆ operator+() [10/23]

template<typename T >
Polynomial< T > regina::operator+ ( const Polynomial< T > &  lhs,
const Polynomial< T > &  rhs 
)

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [11/23]

template<typename T >
Polynomial< T > regina::operator+ ( const Polynomial< T > &  lhs,
Polynomial< T > &&  rhs 
)
inline

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [12/23]

Rational regina::Rational::operator+ ( const Rational r) const

Calculates the sum of two rationals.

This rational is not changed.

Parameters
rthe rational to add to this.
Returns
the sum this + r.

◆ operator+() [13/23]

Cyclotomic regina::operator+ ( Cyclotomic &&  lhs,
const Cyclotomic rhs 
)
inline

Adds the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to add.
rhsthe second field element to add.
Returns
the sum of both field elements.

◆ operator+() [14/23]

Cyclotomic regina::operator+ ( Cyclotomic &&  lhs,
Cyclotomic &&  rhs 
)
inline

Adds the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to add.
rhsthe second field element to add.
Returns
the sum of both field elements.

◆ operator+() [15/23]

template<typename T >
Laurent2< T > regina::operator+ ( Laurent2< T > &&  lhs,
const Laurent2< T > &  rhs 
)
inline

Adds the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [16/23]

template<typename T >
Laurent2< T > regina::operator+ ( Laurent2< T > &&  lhs,
Laurent2< T > &&  rhs 
)
inline

Adds the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [17/23]

template<typename T >
Laurent< T > regina::operator+ ( Laurent< T > &&  lhs,
const Laurent< T > &  rhs 
)
inline

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [18/23]

template<typename T >
Laurent< T > regina::operator+ ( Laurent< T > &&  lhs,
Laurent< T > &&  rhs 
)
inline

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [19/23]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::operator+ ( long  lhs,
const IntegerBase< supportInfinity > &  rhs 
)
inline

Adds the given native integer to the given large integer.

If the large integer is infinite, the result will also be infinity.

Python:\n Not available.
Parameters
lhsthe native integer to add.
rhsthe large integer to add.
Returns
the sum lhs plus rhs.

◆ operator+() [20/23]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator+ ( long  other) const
inline

Adds this to the given integer and returns the result.

This integer is not changed.

If either term of the sum is infinite, the result will be infinity.

Parameters
otherthe integer to add to this integer.
Returns
the sum this plus other.

◆ operator+() [21/23]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator+ ( Native  other) const
inline

Adds this to the given integer and returns the result.

This integer is not changed.

Parameters
otherthe integer to add to this integer.
Returns
the sum this plus other.

◆ operator+() [22/23]

template<typename T >
Polynomial< T > regina::operator+ ( Polynomial< T > &&  lhs,
const Polynomial< T > &  rhs 
)
inline

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator+() [23/23]

template<typename T >
Polynomial< T > regina::operator+ ( Polynomial< T > &&  lhs,
Polynomial< T > &&  rhs 
)
inline

Adds the two given polynomials.

This operator + is sometimes faster than using +=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe first polynomial to add.
rhsthe second polynomial to add.
Returns
the sum of both polynomials.

◆ operator++() [1/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator++
inline

The preincrement operator.

This operator increments this integer by one, and returns a reference to the integer after the increment.

Python:\n Not available.
Returns
a reference to this integer after the increment.

◆ operator++() [2/4]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator++
inline

The preincrement operator.

This operator increments this integer by one, and returns a reference to the integer after the increment.

Python:\n Not available.
Returns
a reference to this integer after the increment.

◆ operator++() [3/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator++ ( int  )
inline

The postincrement operator.

This operator increments this integer by one, and returns a copy of the integer before the increment.

Python:\n Not available.
Returns
a copy of this integer before the increment took place.

◆ operator++() [4/4]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator++ ( int  )
inline

The postincrement operator.

This operator increments this integer by one, and returns a copy of the integer before the increment.

Python:\n Not available.
Returns
a copy of this integer before the increment took place.

◆ operator+=() [1/11]

Cyclotomic & regina::Cyclotomic::operator+= ( const Cyclotomic other)
inline

Adds the given field element to this.

Precondition
The argument other belongs to the same cyclotomic field as this.
Parameters
otherthe field element to add to this.
Returns
a reference to this field element.

◆ operator+=() [2/11]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator+= ( const IntegerBase< supportInfinity > &  other)
inline

Adds the given integer to this.

This integer is changed to reflect the result.

If either term of the sum is infinite, the result will be infinity.

Parameters
otherthe integer to add to this integer.
Returns
a reference to this integer with its new value.

◆ operator+=() [3/11]

template<typename T >
Laurent2< T > & regina::Laurent2< T >::operator+= ( const Laurent2< T > &  other)

Adds the given polynomial to this.

This and the given polynomial need not have the same range of non-zero coefficients.

Parameters
otherthe polynomial to add to this.
Returns
a reference to this polynomial.

◆ operator+=() [4/11]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator+= ( const Laurent< T > &  other)
inline

Adds the given polynomial to this.

The given polynomial need not have the same minimum and/or maximum exponents as this.

Warning
This routine may trigger a deep copy (depending upon the range of exponents used in other). Consider using the binary + operator instead, which is better able to avoid this deep copy where possible.
Parameters
otherthe polynomial to add to this.
Returns
a reference to this polynomial.

◆ operator+=() [5/11]

Matrix2 & regina::Matrix2::operator+= ( const Matrix2 other)
inline

Adds the given matrix to this.

This matrix is changed to reflect the result.

Parameters
otherthe matrix to add to this.
Returns
a reference to this matrix with its new value.

◆ operator+=() [6/11]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator+= ( const NativeInteger< bytes > &  other)
inline

Adds the given integer to this.

This integer is changed to reflect the result.

Parameters
otherthe integer to add to this integer.
Returns
a reference to this integer with its new value.

◆ operator+=() [7/11]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator+= ( const Polynomial< T > &  other)

Adds the given polynomial to this.

The given polynomial need not have the same degree as this. Note that the degree of this polynomial might change as a result of this operation.

Warning
This routine may trigger a deep copy (currently this happens when other has higher degree than this). Consider using the binary + operator instead, which is better able to avoid this deep copy where possible.
Parameters
otherthe polynomial to add to this.
Returns
a reference to this polynomial.

◆ operator+=() [8/11]

Rational& regina::Rational::operator+= ( const Rational other)

Adds the given rational to this.

This rational is changed to reflect the result.

Parameters
otherthe rational to add to this.
Returns
a reference to this rational with its new value.

◆ operator+=() [9/11]

template<class T >
void regina::Vector< T >::operator+= ( const Vector< T > &  other)
inline

Adds the given vector to this vector.

This behaves correctly in the case where other is this.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector to add to this vector.

◆ operator+=() [10/11]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator+= ( long  other)

Adds the given integer to this.

This integer is changed to reflect the result.

If either term of the sum is infinite, the result will be infinity.

Parameters
otherthe integer to add to this integer.
Returns
a reference to this integer with its new value.

◆ operator+=() [11/11]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator+= ( Native  other)
inline

Adds the given integer to this.

This integer is changed to reflect the result.

Parameters
otherthe integer to add to this integer.
Returns
a reference to this integer with its new value.

◆ operator-() [1/30]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator-
inline

Determines the negative of this integer.

This integer is not changed.

Negative infinity will return infinity.

Returns
the negative of this integer.

◆ operator-() [2/30]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator-
inline

Determines the negative of this integer.

This integer is not changed.

Returns
the negative of this integer.

◆ operator-() [3/30]

Matrix2 regina::Matrix2::operator- ( ) const
inline

Determines the negative of this matrix.

This matrix is not changed.

Returns
the negative of this matrix.

◆ operator-() [4/30]

Rational regina::Rational::operator- ( ) const

Determines the negative of this rational.

This rational is not changed.

Returns
the negative of this rational.

◆ operator-() [5/30]

Cyclotomic regina::operator- ( const Cyclotomic lhs,
const Cyclotomic rhs 
)
inline

Subtracts the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe field element to subtract from.
rhsthe field element to subtract.
Returns
the first field element minus the second.

◆ operator-() [6/30]

Cyclotomic regina::operator- ( const Cyclotomic lhs,
Cyclotomic &&  rhs 
)
inline

Subtracts the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe field element to subtract from.
rhsthe field element to subtract.
Returns
the first field element minus the second.

◆ operator-() [7/30]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator- ( const IntegerBase< supportInfinity > &  other) const
inline

Subtracts the given integer from this and returns the result.

This integer is not changed.

If either term of the difference is infinite, the result will be infinity.

Parameters
otherthe integer to subtract from this integer.
Returns
the difference this minus other.

◆ operator-() [8/30]

template<typename T >
Laurent2< T > regina::operator- ( const Laurent2< T > &  lhs,
const Laurent2< T > &  rhs 
)
inline

Subtracts the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe polynomial to subtract from.
rhsthe polynomial to subtract.
Returns
the first polynomial minus the second.

◆ operator-() [9/30]

template<typename T >
Laurent2< T > regina::operator- ( const Laurent2< T > &  lhs,
Laurent2< T > &&  rhs 
)
inline

Subtracts the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe polynomial to subtract from.
rhsthe polynomial to subtract.
Returns
the first polynomial minus the second.

◆ operator-() [10/30]

template<typename T >
Laurent< T > regina::operator- ( const Laurent< T > &  lhs,
const Laurent< T > &  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [11/30]

template<typename T >
Laurent< T > regina::operator- ( const Laurent< T > &  lhs,
Laurent< T > &&  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [12/30]

Matrix2 regina::Matrix2::operator- ( const Matrix2 other) const
inline

Calculates the difference of two matrices.

Neither this nor the given matrix is changed.

Parameters
otherthe matrix to subtract from this.
Returns
the difference this - other.

◆ operator-() [13/30]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator- ( const NativeInteger< bytes > &  other) const
inline

Subtracts the given integer from this and returns the result.

This integer is not changed.

Parameters
otherthe integer to subtract from this integer.
Returns
the difference this minus other.

◆ operator-() [14/30]

template<typename T >
Polynomial< T > regina::operator- ( const Polynomial< T > &  lhs,
const Polynomial< T > &  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [15/30]

template<typename T >
Polynomial< T > regina::operator- ( const Polynomial< T > &  lhs,
Polynomial< T > &&  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [16/30]

Rational regina::Rational::operator- ( const Rational r) const

Calculates the difference of two rationals.

This rational is not changed.

Parameters
rthe rational to subtract from this.
Returns
the difference this - r.

◆ operator-() [17/30]

Cyclotomic regina::operator- ( Cyclotomic &&  lhs,
const Cyclotomic rhs 
)
inline

Subtracts the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe field element to subtract from.
rhsthe field element to subtract.
Returns
the first field element minus the second.

◆ operator-() [18/30]

Cyclotomic regina::operator- ( Cyclotomic &&  lhs,
Cyclotomic &&  rhs 
)
inline

Subtracts the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe field element to subtract from.
rhsthe field element to subtract.
Returns
the first field element minus the second.

◆ operator-() [19/30]

Cyclotomic regina::operator- ( Cyclotomic  arg)
inline

Returns the negative of the given field element.

Parameters
argthe field element to negate.
Returns
the negative of arg.

◆ operator-() [20/30]

template<typename T >
Laurent2< T > regina::operator- ( Laurent2< T > &&  lhs,
const Laurent2< T > &  rhs 
)
inline

Subtracts the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe polynomial to subtract from.
rhsthe polynomial to subtract.
Returns
the first polynomial minus the second.

◆ operator-() [21/30]

template<typename T >
Laurent2< T > regina::operator- ( Laurent2< T > &&  lhs,
Laurent2< T > &&  rhs 
)
inline

Subtracts the two given polynomials.

The two polynomials need not have the same range of non-zero coefficients.

Parameters
lhsthe polynomial to subtract from.
rhsthe polynomial to subtract.
Returns
the first polynomial minus the second.

◆ operator-() [22/30]

template<typename T >
Laurent2< T > regina::operator- ( Laurent2< T >  arg)
inline

Returns the negative of the given polynomial.

Parameters
argthe polynomial to negate.
Returns
the negative of arg.

◆ operator-() [23/30]

template<typename T >
Laurent< T > regina::operator- ( Laurent< T > &&  lhs,
const Laurent< T > &  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [24/30]

template<typename T >
Laurent< T > regina::operator- ( Laurent< T > &&  lhs,
Laurent< T > &&  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [25/30]

template<typename T >
Laurent< T > regina::operator- ( Laurent< T >  arg)
inline

Returns the negative of the given polynomial.

Parameters
argthe polynomial to negate.
Returns
the negative of arg.

◆ operator-() [26/30]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator- ( long  other) const
inline

Subtracts the given integer from this and returns the result.

This integer is not changed.

If either term of the difference is infinite, the result will be infinity.

Parameters
otherthe integer to subtract from this integer.
Returns
the difference this minus other.

◆ operator-() [27/30]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator- ( Native  other) const
inline

Subtracts the given integer from this and returns the result.

This integer is not changed.

Parameters
otherthe integer to subtract from this integer.
Returns
the difference this minus other.

◆ operator-() [28/30]

template<typename T >
Polynomial< T > regina::operator- ( Polynomial< T > &&  lhs,
const Polynomial< T > &  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [29/30]

template<typename T >
Polynomial< T > regina::operator- ( Polynomial< T > &&  lhs,
Polynomial< T > &&  rhs 
)

Subtracts the two given polynomials.

This operator - is sometimes faster than using -=, since it has more flexibility to avoid an internal deep copy.

Parameters
lhsthe polynomial to sutract rhs from.
rhsthe polynomial to subtract from lhs.
Returns
the difference of the two given polynomials.

◆ operator-() [30/30]

template<typename T >
Polynomial< T > regina::operator- ( Polynomial< T >  arg)
inline

Returns the negative of the given polynomial.

Parameters
argthe polynomial to negate.
Returns
the negative of arg.

◆ operator--() [1/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator--
inline

The predecrement operator.

This operator decrements this integer by one, and returns a reference to the integer after the decrement.

Python:\n Not available.
Returns
a reference to this integer after the decrement.

◆ operator--() [2/4]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator--
inline

The predecrement operator.

This operator decrements this integer by one, and returns a reference to the integer after the decrement.

Python:\n Not available.
Returns
a reference to this integer after the decrement.

◆ operator--() [3/4]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator-- ( int  )
inline

The postdecrement operator.

This operator decrements this integer by one, and returns a copy of the integer before the decrement.

Python:\n Not available.
Returns
a copy of this integer before the decrement took place.

◆ operator--() [4/4]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator-- ( int  )
inline

The postdecrement operator.

This operator decrements this integer by one, and returns a copy of the integer before the decrement.

Python:\n Not available.
Returns
a copy of this integer before the decrement took place.

◆ operator-=() [1/11]

Cyclotomic & regina::Cyclotomic::operator-= ( const Cyclotomic other)
inline

Subtracts the given field element from this.

Precondition
The argument other belongs to the same cyclotomic field as this.
Parameters
otherthe field element to subtract from this.
Returns
a reference to this field element.

◆ operator-=() [2/11]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator-= ( const IntegerBase< supportInfinity > &  other)
inline

Subtracts the given integer from this.

This integer is changed to reflect the result.

If either term of the difference is infinite, the result will be infinity.

Parameters
otherthe integer to subtract from this integer.
Returns
a reference to this integer with its new value.

◆ operator-=() [3/11]

template<typename T >
Laurent2< T > & regina::Laurent2< T >::operator-= ( const Laurent2< T > &  other)

Subtracts the given polynomial from this.

This and the given polynomial need not have the same range of non-zero coefficients.

Parameters
otherthe polynomial to subtract from this.
Returns
a reference to this polynomial.

◆ operator-=() [4/11]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator-= ( const Laurent< T > &  other)
inline

Subtracts the given polynomial from this.

The given polynomial need not have the same minimum and/or maximum exponents as this.

Parameters
otherthe polynomial to subtract from this.
Returns
a reference to this polynomial.

◆ operator-=() [5/11]

Matrix2 & regina::Matrix2::operator-= ( const Matrix2 other)
inline

Subtracts the given matrix from this.

This matrix is changed to reflect the result.

Parameters
otherthe matrix to subtract from this.
Returns
a reference to this matrix with its new value.

◆ operator-=() [6/11]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator-= ( const NativeInteger< bytes > &  other)
inline

Subtracts the given integer from this.

This integer is changed to reflect the result.

Parameters
otherthe integer to subtract from this integer.
Returns
a reference to this integer with its new value.

◆ operator-=() [7/11]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator-= ( const Polynomial< T > &  other)

Subtracts the given polynomial from this.

The given polynomial need not have the same degree as this. Note that the degree of this polynomial might change as a result of this operation.

Parameters
otherthe polynomial to subtract from this.
Returns
a reference to this polynomial.

◆ operator-=() [8/11]

Rational& regina::Rational::operator-= ( const Rational other)

Subtracts the given rational from this.

This rational is changed to reflect the result.

Parameters
otherthe rational to subtract from this.
Returns
a reference to this rational with its new value.

◆ operator-=() [9/11]

template<class T >
void regina::Vector< T >::operator-= ( const Vector< T > &  other)
inline

Subtracts the given vector from this vector.

This behaves correctly in the case where other is this.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector to subtract from this vector.

◆ operator-=() [10/11]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator-= ( long  other)

Subtracts the given integer from this.

This integer is changed to reflect the result.

If either term of the difference is infinite, the result will be infinity.

Parameters
otherthe integer to subtract from this integer.
Returns
a reference to this integer with its new value.

◆ operator-=() [11/11]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator-= ( Native  other)
inline

Subtracts the given integer from this.

This integer is changed to reflect the result.

Parameters
otherthe integer to subtract from this integer.
Returns
a reference to this integer with its new value.

◆ operator/() [1/11]

Cyclotomic regina::operator/ ( const Cyclotomic lhs,
const Cyclotomic rhs 
)
inline

Divides the two given cyclotomic field elements.

Precondition
The second argument rhs is non-zero.
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe field element to divide by rhs.
rhsthe field element to divide lhs by.
Returns
the result of dividing lhs by rhs.

◆ operator/() [2/11]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator/ ( const IntegerBase< supportInfinity > &  other) const
inline

Divides this by the given integer and returns the result.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is not changed.

If other is known to divide this integer exactly, divExact() should be used instead.

Infinity divided by anything will return infinity. Anything finite divided by infinity will return zero. Anything finite divided by zero will return infinity.

For a division routine that always rounds down, see divisionAlg().

Precondition
If this class does not support infinity, then other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ operator/() [3/11]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator/ ( const NativeInteger< bytes > &  other) const
inline

Divides this by the given integer and returns the result.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is not changed.

For a division routine that always rounds down, see divisionAlg().

Precondition
other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ operator/() [4/11]

Rational regina::Rational::operator/ ( const Rational r) const

Calculates the ratio of two rationals.

This rational is not changed.

Parameters
rthe rational to divide this by.
Returns
the ratio this / r.

◆ operator/() [5/11]

Cyclotomic regina::operator/ ( Cyclotomic  elt,
const Rational scalar 
)
inline

Divides the given field element by the given rational.

Precondition
The argument scalar is non-zero.
Parameters
eltthe field element to divide by the given rational.
scalarthe rational to divide by.
Returns
the quotient of the given field element by the given rational.

◆ operator/() [6/11]

template<typename T >
Laurent2< T > regina::operator/ ( Laurent2< T >  poly,
const typename Laurent2< T >::Coefficient &  scalar 
)
inline

Divides the given polynomial by the given scalar constant.

This uses the division operator /= for the coefficient type T.

The scalar is simply of type T; we use the identical type Laurent2<T>::Coefficient here to assist with C++ template type matching.

Precondition
The argument scalar is non-zero.
Parameters
polythe polynomial to divide by the given scalar.
scalarthe scalar factor to divide by.
Returns
the quotient of the given polynomial by the given scalar.

◆ operator/() [7/11]

template<typename T >
Laurent< T > regina::operator/ ( Laurent< T >  poly,
const typename Laurent< T >::Coefficient &  scalar 
)
inline

Divides the given polynomial by the given scalar constant.

This uses the division operator /= for the coefficient type T.

The scalar is simply of type T; we use the identical type Laurent<T>::Coefficient here to assist with C++ template type matching.

Precondition
The argument scalar is non-zero.
Parameters
polythe polynomial to divide by the given scalar.
scalarthe scalar factor to divide by.
Returns
the quotient of the given polynomial by the given scalar.

◆ operator/() [8/11]

template<bool supportInfinity>
IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator/ ( long  other) const
inline

Divides this by the given integer and returns the result.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is not changed.

If other is known to divide this integer exactly, divExact() should be used instead.

Infinity divided by anything will return infinity. Anything finite divided by zero will return infinity.

For a division routine that always rounds down, see divisionAlg().

Precondition
If this class does not support infinity, then other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ operator/() [9/11]

template<int bytes>
NativeInteger< bytes > regina::NativeInteger< bytes >::operator/ ( Native  other) const
inline

Divides this by the given integer and returns the result.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is not changed.

For a division routine that always rounds down, see divisionAlg().

Precondition
other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
the quotient this divided by other.

◆ operator/() [10/11]

template<typename T >
Polynomial< T > regina::operator/ ( Polynomial< T >  lhs,
const Polynomial< T > &  rhs 
)
inline

Divides the two given polynomials.

More precisely: suppose there exist polynomials q and r with coefficients of type T for which lhs = q.rhs + r, and where r has smaller degree than rhs. Then we call q the quotient, and r the remainder.

This routine returns the quotient q, and discards the remainder. If you need to keep the remainder also, then call Polynomial::divisionAlg() instead.

Coefficients are divided using the operator /= on type T.

If your coefficient type T is not a field (e.g., if T is Integer), you must be sure to know in advance that the quotient exists (see the precondition below). Otherwise the behaviour of this routine is undefined.

Precondition
The second polynomial rhs is non-zero.
The quotient as defined above exists. If T is a field type (e.g., if T is Rational) then this is true automatically. If not (e.g., if T is Integer) then this requires some prior knowledge about the arguments.
Parameters
lhsthe polynomial to divide by rhs.
rhsthe polynomial that we will divide lhs by.
Returns
the quotient, as described above.

◆ operator/() [11/11]

template<typename T >
Polynomial< T > regina::operator/ ( Polynomial< T >  poly,
const typename Polynomial< T >::Coefficient &  scalar 
)
inline

Divides the given polynomial by the given scalar constant.

This uses the division operator /= for the coefficient type T.

The scalar is simply of type T; we use the identical type Polynomial<T>::Coefficient here to assist with C++ template type matching.

Precondition
The argument scalar is non-zero.
Parameters
polythe polynomial to divide by the given scalar.
scalarthe scalar factor to divide by.
Returns
the quotient of the given polynomial by the given scalar.

◆ operator/=() [1/11]

Cyclotomic & regina::Cyclotomic::operator/= ( const Cyclotomic other)
inline

Divides this by the given field element.

Precondition
The argument other is non-zero.
The argument other belongs to the same cyclotomic field as this.
Parameters
otherthe field element to divide this by.
Returns
a reference to this field element.

◆ operator/=() [2/11]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator/= ( const IntegerBase< supportInfinity > &  other)

Divides this by the given integer.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is changed to reflect the result.

If other is known to divide this integer exactly, divByExact() should be used instead.

Infinity divided by anything will return infinity. Anything finite divided by infinity will return zero. Anything finite divided by zero will return infinity.

For a division routine that always rounds down, see divisionAlg().

Precondition
If this class does not support infinity, then other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ operator/=() [3/11]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator/= ( const NativeInteger< bytes > &  other)
inline

Divides this by the given integer.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is changed to reflect the result.

For a division routine that always rounds down, see divisionAlg().

Precondition
other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ operator/=() [4/11]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator/= ( const Polynomial< T > &  other)

Divides this by the given polynomial.

More precisely: suppose there exist polynomials q and r with coefficients of type T for which this = q.other + r, and where r has smaller degree than other. Then we call q the quotient, and r the remainder.

This routine replaces this polynomial with the quotient q, and discards the remainder. If you need to keep the remainder also, then call divisionAlg() instead.

Coefficients are divided using the operator /= on type T.

If your coefficient type T is not a field (e.g., if T is Integer), you must be sure to know in advance that the quotient exists (see the precondition below). Otherwise the behaviour of this routine is undefined.

Precondition
The given polynomial is not the zero polynomial.
The quotient as defined above exists. If T is a field type (e.g., if T is Rational) then this is true automatically. If not (e.g., if T is Integer) then this requires some prior knowledge about the arguments.
Parameters
otherthe polynomial to divide this by.
Returns
a reference to this polynomial.

◆ operator/=() [5/11]

Rational& regina::Rational::operator/= ( const Rational other)

Divides this by the given rational.

This rational is changed to reflect the result.

Parameters
otherthe rational to divide this by.
Returns
a reference to this rational with its new value.

◆ operator/=() [6/11]

Cyclotomic & regina::Cyclotomic::operator/= ( const Rational scalar)
inline

Divides this field element by the given rational.

This has the effect of dividing the polynomial representation by a scalar constant.

Precondition
The given rational is non-zero.
Parameters
scalarthe rational to divide this by.
Returns
a reference to this field element.

◆ operator/=() [7/11]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator/= ( const T &  scalar)
inline

Divides this polynomial by the given constant.

This uses the division operator /= for the coefficient type T.

Precondition
The argument scalar is non-zero.
Parameters
scalarthe scalar factor to divide by.
Returns
a reference to this polynomial.

◆ operator/=() [8/11]

template<typename T >
Laurent2< T > & regina::Laurent2< T >::operator/= ( const T &  scalar)
inline

Divides this polynomial by the given constant.

This uses the division operator /= for the coefficient type T.

Precondition
The argument scalar is non-zero.
Parameters
scalarthe scalar factor to divide by.
Returns
a reference to this polynomial.

◆ operator/=() [9/11]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator/= ( const T &  scalar)
inline

Divides this polynomial by the given constant.

This uses the division operator /= for the coefficient type T.

Precondition
The argument scalar is non-zero.
Parameters
scalarthe scalar factor to divide by.
Returns
a reference to this polynomial.

◆ operator/=() [10/11]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator/= ( long  other)

Divides this by the given integer.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is changed to reflect the result.

If other is known to divide this integer exactly, divByExact() should be used instead.

Infinity divided by anything will return infinity. Anything finite divided by zero will return infinity.

For a division routine that always rounds down, see divisionAlg().

Precondition
If this class does not support infinity, then other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ operator/=() [11/11]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator/= ( Native  other)
inline

Divides this by the given integer.

The result will be truncated to an integer, i.e. rounded towards zero. This integer is changed to reflect the result.

For a division routine that always rounds down, see divisionAlg().

Precondition
other must be non-zero.
Warning
As I understand it, the direction of rounding for native C/C++ integer division was fixed in the C++11 specification, but left to the compiler implementation in earlier versions of the specification; however, any modern hardware should satisfy the C++11 rounding rule as described above.
Parameters
otherthe integer to divide this by.
Returns
a reference to this integer with its new value.

◆ operator<() [1/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator< ( const IntegerBase< supportInfinity > &  rhs) const
inline

Determines if this is less than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than the given integer.

◆ operator<() [2/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator< ( const NativeInteger< bytes > &  rhs) const
inline

Determines if this is less than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than the given integer.

◆ operator<() [3/5]

bool regina::Rational::operator< ( const Rational compare) const

Determines if this is less than the given rational.

Parameters
comparethe rational with which this will be compared.
Returns
true if and only if this rational is less than compare.

◆ operator<() [4/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator< ( long  rhs) const
inline

Determines if this is less than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than the given integer.

◆ operator<() [5/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator< ( Native  rhs) const
inline

Determines if this is less than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than the given integer.

◆ operator<<() [1/6]

template<bool supportInfinity>
std::ostream& regina::operator<< ( std::ostream &  out,
const IntegerBase< supportInfinity > &  i 
)

Writes the given integer to the given output stream.

Parameters
outthe output stream to which to write.
ithe integer to write.
Returns
a reference to out.

◆ operator<<() [2/6]

std::ostream& regina::operator<< ( std::ostream &  out,
const Matrix2 mat 
)

Writes the given matrix to the given output stream.

The matrix will be written entirely on a single line, with the first row followed by the second row.

Parameters
outthe output stream to which to write.
matthe matrix to write.
Returns
a reference to out.

◆ operator<<() [3/6]

template<int bytes>
std::ostream& regina::operator<< ( std::ostream &  out,
const NativeInteger< bytes > &  i 
)

Writes the given integer to the given output stream.

Parameters
outthe output stream to which to write.
ithe integer to write.
Returns
a reference to out.

◆ operator<<() [4/6]

template<int n>
std::ostream& regina::operator<< ( std::ostream &  out,
const Perm< n > &  p 
)
inline

Writes a string representation of the given permutation to the given output stream.

The format will be the same as is used by Perm::str().

Parameters
outthe output stream to which to write.
pthe permutation to write.
Returns
a reference to out.
Template Parameters
nthe number of objects being permuted. This must be between 3 and 16 inclusive.

◆ operator<<() [5/6]

std::ostream& regina::operator<< ( std::ostream &  out,
const Rational rat 
)

Writes the given rational to the given output stream.

Infinity will be written as Inf. Undefined will be written as Undef. A rational with denominator one will be written as a single integer. All other rationals will be written in the form r/s.

Parameters
outthe output stream to which to write.
ratthe rational to write.
Returns
a reference to out.

◆ operator<<() [6/6]

template<class T >
std::ostream& regina::operator<< ( std::ostream &  out,
const Vector< T > &  vector 
)

Writes the given vector to the given output stream.

The vector will be written on a single line with elements separated by a single space. No newline will be written.

Python:\n Not present.
Parameters
outthe output stream to which to write.
vectorthe vector to write.
Returns
a reference to out.

◆ operator<=() [1/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator<= ( const IntegerBase< supportInfinity > &  rhs) const
inline

Determines if this is less than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than or equal to the given integer.

◆ operator<=() [2/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator<= ( const NativeInteger< bytes > &  rhs) const
inline

Determines if this is less than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than or equal to the given integer.

◆ operator<=() [3/5]

bool regina::Rational::operator<= ( const Rational compare) const
inline

Determines if this is less than or equal to the given rational.

Parameters
comparethe rational with which this will be compared.
Returns
true if and only if this rational is less than or equal to compare.

◆ operator<=() [4/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator<= ( long  rhs) const
inline

Determines if this is less than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than or equal to the given integer.

◆ operator<=() [5/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator<= ( Native  rhs) const
inline

Determines if this is less than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is less than or equal to the given integer.

◆ operator=() [1/35]

template<bool supportInfinity = false>
IntegerBase& regina::IntegerBase< supportInfinity >::operator= ( const char *  value)

Sets this integer to the given value which is represented as a string of digits in base 10.

Whitespace may be present at the beginning or end of the given string and will simply be ignored.

Precondition
The given string represents an integer in base 10, with optional whitespace added.
Parameters
valuethe new value of this integer, represented as a string of digits in base 10.
Returns
a reference to this integer with its new value.

◆ operator=() [2/35]

Cyclotomic & regina::Cyclotomic::operator= ( const Cyclotomic value)
inline

Sets this to a copy of the given field element.

This assignment operator is safe even if this and value belong to different cyclotomic fields, or if this and/or value has not yet been initialised. The underlying field for this element will simply be changed to match the underlying field for value, and all old information stored for this element (if any) will be safely discarded. If value is uninitialised then this field element will become uninitialised also.

This operator induces a deep copy of value.

Parameters
valuethe new value to assign to this field element.
Returns
a reference to this field element.

◆ operator=() [3/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( const IntegerBase< supportInfinity > &  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [4/35]

template<bool supportInfinity>
Rational & regina::Rational::operator= ( const IntegerBase< supportInfinity > &  value)
inline

Sets this rational to the given integer value.

The given integer may be infinite.

Parameters
valuethe new value of this rational.
Returns
a reference to this rational with its new value.

◆ operator=() [5/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( const IntegerBase<! supportInfinity > &  value)
inline

Sets this integer to the given value.

Precondition
The given integer is not infinite.
Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [6/35]

template<typename T >
Laurent2< T > & regina::Laurent2< T >::operator= ( const Laurent2< T > &  value)
inline

Sets this to be a copy of the given polynomial.

This and the given polynomial need not have the same range of non-zero coefficients.

This operator induces a deep copy of value.

A note to developers: although this is identical to the templated assignment operator, it must be declared and implemented separately. See the copy constructor for further details.

Parameters
valuethe polynomial to copy.
Returns
a reference to this polynomial.

◆ operator=() [7/35]

template<typename T >
template<typename U >
Laurent2& regina::Laurent2< T >::operator= ( const Laurent2< U > &  value)

Sets this to be a copy of the given polynomial.

This and the given polynomial need not have the same range of non-zero coefficients.

This operator induces a deep copy of value.

Parameters
valuethe polynomial to copy.
Returns
a reference to this polynomial.

◆ operator=() [8/35]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator= ( const Laurent< T > &  value)

Sets this to be a copy of the given polynomial.

This and the given polynomial need not have the same minimum and/or maximum exponents.

This operator induces a deep copy of value.

A note to developers: although this is identical to the templated assignment operator, it must be declared and implemented separately. See the copy constructor for further details.

Parameters
valuethe polynomial to copy.
Returns
a reference to this polynomial.

◆ operator=() [9/35]

template<typename T >
template<typename U >
Laurent& regina::Laurent< T >::operator= ( const Laurent< U > &  value)

Sets this to be a copy of the given polynomial.

This and the given polynomial need not have the same minimum and/or maximum exponents.

This operator induces a deep copy of value.

Parameters
valuethe polynomial to copy.
Returns
a reference to this polynomial.

◆ operator=() [10/35]

Matrix2 & regina::Matrix2::operator= ( const long  values[2][2])
inline

Sets the elements of this matrix to the given integer values.

Each given integer values[r][c] will be placed in row r, column c.

Python:\n Not present.
Parameters
valuesthe four values to copy into this matrix.
Returns
a reference to this matrix.

◆ operator=() [11/35]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
Matrix& regina::Matrix< T, ring >::operator= ( const Matrix< T, ring > &  src)
inline

Copies the given matrix into this matrix.

It does not matter if this and the given matrix have different sizes; if they do then this matrix will be resized as a result.

This operator induces a deep copy of src.

Parameters
srcthe matrix to copy.
Returns
a reference to this matrix.

◆ operator=() [12/35]

Matrix2 & regina::Matrix2::operator= ( const Matrix2 cloneMe)
inline

Sets this matrix to be a copy of the given matrix.

Parameters
cloneMethe matrix to be copied.
Returns
a reference to this matrix.

◆ operator=() [13/35]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator= ( const NativeInteger< bytes > &  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [14/35]

template<int n>
Perm& regina::Perm< n >::operator= ( const Perm< n > &  cloneMe)
default

Sets this permutation to be equal to the given permutation.

Parameters
cloneMethe permutation whose value will be assigned to this permutation.
Returns
a reference to this permutation.

◆ operator=() [15/35]

Perm<2>& regina::Perm< 2 >::operator= ( const Perm< 2 > &  cloneMe)
default

Sets this permutation to be equal to the given permutation.

Parameters
cloneMethe permutation whose value will be assigned to this permutation.
Returns
a reference to this permutation.

◆ operator=() [16/35]

Perm<3>& regina::Perm< 3 >::operator= ( const Perm< 3 > &  cloneMe)
default

Sets this permutation to be equal to the given permutation.

Parameters
cloneMethe permutation whose value will be assigned to this permutation.
Returns
a reference to this permutation.

◆ operator=() [17/35]

Perm<4>& regina::Perm< 4 >::operator= ( const Perm< 4 > &  cloneMe)
default

Sets this permutation to be equal to the given permutation.

Parameters
cloneMethe permutation whose value will be assigned to this permutation.
Returns
a reference to this permutation.

◆ operator=() [18/35]

Perm<5>& regina::Perm< 5 >::operator= ( const Perm< 5 > &  cloneMe)
default

Sets this permutation to be equal to the given permutation.

Parameters
cloneMethe permutation whose value will be assigned to this permutation.
Returns
a reference to this permutation.

◆ operator=() [19/35]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator= ( const Polynomial< T > &  value)

Sets this to be a copy of the given polynomial.

This and the given polynomial need not have the same degree (but if they do not, then the degree of this polynomial will of course change).

This operator induces a deep copy of the given polynomial.

A note to developers: although this is identical to the templated assignment operator, it must be declared and implemented separately. See the copy constructor for further details.

Parameters
valuethe polynomial to copy.
Returns
a reference to this polynomial.

◆ operator=() [20/35]

template<typename T >
template<typename U >
Polynomial& regina::Polynomial< T >::operator= ( const Polynomial< U > &  value)

Sets this to be a copy of the given polynomial.

This and the given polynomial need not have the same degree (but if they do not, then the degree of this polynomial will of course change).

This operator induces a deep copy of the given polynomial.

Parameters
valuethe polynomial to copy.
Returns
a reference to this polynomial.

◆ operator=() [21/35]

Cyclotomic & regina::Cyclotomic::operator= ( const Rational scalar)
inline

Sets this field element to the given rational.

The underlying cyclotomic field will be left unchanged.

The polynomial representation for this field element will simply be a constant.

Precondition
This field element has already been initialised (and so it already has specified an underlying cyclotomic field).
Parameters
scalarthe new rational value of this field element.
Returns
a reference to this field element.

◆ operator=() [22/35]

Rational & regina::Rational::operator= ( const Rational value)
inline

Sets this rational to the given rational value.

Parameters
valuethe new value of this rational.
Returns
a reference to this rational with its new value.

◆ operator=() [23/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( const std::string &  value)
inline

Sets this integer to the given value which is represented as a string of digits in base 10.

Whitespace may be present at the beginning or end of the given string and will simply be ignored.

Precondition
The given string represents an integer in base 10, with optional whitespace added.
Parameters
valuethe new value of this integer, represented as a string of digits in base 10.
Returns
a reference to this integer with its new value.

◆ operator=() [24/35]

template<class T >
Vector<T>& regina::Vector< T >::operator= ( const Vector< T > &  cloneMe)
inline

Sets this vector equal to the given vector.

Precondition
This and the given vector have the same size.
Parameters
cloneMethe vector whose value shall be assigned to this vector.

◆ operator=() [25/35]

Cyclotomic & regina::Cyclotomic::operator= ( Cyclotomic &&  value)
inlinenoexcept

Moves the contents of the given field element to this field element.

This is a fast (constant time) operation.

This assignment operator is safe even if this and value belong to different cyclotomic fields, or if this and/or value has not yet been initialised. The underlying field for this element will simply be changed to match the underlying field for value, and all old information stored for this element (if any) will be safely discarded. If value is uninitialised then this field element will become uninitialised also.

The element that was passed (value) will no longer be usable.

Parameters
valuethe field element to move.
Returns
a reference to this field element.

◆ operator=() [26/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( int  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [27/35]

template<typename T >
Laurent2& regina::Laurent2< T >::operator= ( Laurent2< T > &&  value)
defaultnoexcept

Moves the contents of the given polynomial to this polynomial.

This is a fast (constant time) operation.

This and the given polynomial need not have the same range of non-zero coefficients.

The polynomial that was passed (value) will no longer be usable.

Parameters
valuethe polynomial to move.
Returns
a reference to this polynomial.

◆ operator=() [28/35]

template<typename T >
Laurent< T > & regina::Laurent< T >::operator= ( Laurent< T > &&  value)
inlinenoexcept

Moves the contents of the given polynomial to this polynomial.

This is a fast (constant time) operation.

This and the given polynomial need not have the same minimum and/or maximum exponents.

The polynomial that was passed (value) will no longer be usable.

Parameters
valuethe polynomial to move.
Returns
a reference to this polynomial.

◆ operator=() [29/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( long  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [30/35]

Rational & regina::Rational::operator= ( long  value)
inline

Sets this rational to the given integer value.

Parameters
valuethe new value of this rational.
Returns
a reference to this rational with its new value.

◆ operator=() [31/35]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
Matrix& regina::Matrix< T, ring >::operator= ( Matrix< T, ring > &&  src)
inlinenoexcept

Moves the given matrix into this matrix.

This is a fast (constant time) operation.

It does not matter if this and the given matrix have different sizes; if they do then this matrix will be resized as a result.

The matrix that is passed (src) will no longer be usable.

Parameters
srcthe matrix to move.
Returns
a reference to this matrix.

◆ operator=() [32/35]

template<int bytes>
NativeInteger< bytes > & regina::NativeInteger< bytes >::operator= ( Native  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [33/35]

template<typename T >
Polynomial< T > & regina::Polynomial< T >::operator= ( Polynomial< T > &&  value)
inlinenoexcept

Moves the contents of the given polynomial to this polynomial.

This is a fast (constant time) operation.

This and the given polynomial need not have the same degree (but if they do not, then the degree of this polynomial will of course change).

The polynomial that was passed (value) will no longer be usable.

Parameters
valuethe polynomial to move.
Returns
a reference to this polynomial.

◆ operator=() [34/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( unsigned long  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator=() [35/35]

template<bool supportInfinity>
IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= ( unsigned  value)
inline

Sets this integer to the given value.

Parameters
valuethe new value of this integer.
Returns
a reference to this integer with its new value.

◆ operator==() [1/18]

bool regina::Cyclotomic::operator== ( const Cyclotomic rhs) const
inline

Tests whether or not this and the given argument are the same element of the same cyclotomic field.

If this and rhs have different underlying fields then this test will always return false, even if they take the same numerical value when evaluated as complex numbers.

If either this or rhs have not been initialised (typically because they were created using the default constructor), then this comparison will return false. If both field elements have not been initialised, then this comparison will return true.

Parameters
rhsthe value to compare with this.
Returns
true if and only if this and rhs are the same element of the same cyclotomic field.

◆ operator==() [2/18]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator== ( const IntegerBase< supportInfinity > &  rhs) const
inline

Determines if this is equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are equal.

◆ operator==() [3/18]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator== ( const IntegerBase<! supportInfinity > &  rhs) const
inline

Determines if this is equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are equal.

◆ operator==() [4/18]

template<typename T >
bool regina::Laurent2< T >::operator== ( const Laurent2< T > &  rhs) const
inline

Tests whether this and the given polynomial are equal.

Parameters
rhsthe polynomial to compare with this.
Returns
true if and only if this and the given polynomial are equal.

◆ operator==() [5/18]

template<typename T >
bool regina::Laurent< T >::operator== ( const Laurent< T > &  rhs) const
inline

Tests whether this and the given polynomial are equal.

Parameters
rhsthe polynomial to compare with this.
Returns
true if and only if this and the given polynomial are equal.

◆ operator==() [6/18]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
bool regina::Matrix< T, ring >::operator== ( const Matrix< T, ring > &  other) const
inline

Determines whether this and the given matrix are identical.

Two matrices are identical if and only if (i) their dimensions are the same, and (ii) the corresponding elements of each matrix are equal.

Note that this routine can happily deal with two matrices of different dimensions (in which case it will always return false).

This routine returns true if and only if the inequality operator (!=) returns false.

Precondition
The type T provides an equality operator (==).
Parameters
otherthe matrix to compare with this.
Returns
true if the matrices are equal as described above, or false otherwise.

◆ operator==() [7/18]

bool regina::Matrix2::operator== ( const Matrix2 compare) const
inline

Determines if this is equal to the given matrix.

Parameters
comparethe matrix with which this will be compared.
Returns
true if and only if this matrix is equal to compare.

◆ operator==() [8/18]

template<int bytes>
bool regina::NativeInteger< bytes >::operator== ( const NativeInteger< bytes > &  rhs) const
inline

Determines if this is equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are equal.

◆ operator==() [9/18]

template<int n>
bool regina::Perm< n >::operator== ( const Perm< n > &  other) const
inline

Determines if this is equal to the given permutation.

This is true if and only if both permutations have the same images for all 0 ≤ i < n.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation are equal.

◆ operator==() [10/18]

bool regina::Perm< 2 >::operator== ( const Perm< 2 > &  other) const
inline

Determines if this is equal to the given permutation.

This is true if and only if both permutations have the same images for 0 and 1.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation are equal.

◆ operator==() [11/18]

bool regina::Perm< 3 >::operator== ( const Perm< 3 > &  other) const
inline

Determines if this is equal to the given permutation.

This is true if and only if both permutations have the same images for 0, 1 and 2.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation are equal.

◆ operator==() [12/18]

bool regina::Perm< 4 >::operator== ( const Perm< 4 > &  other) const
inline

Determines if this is equal to the given permutation.

This is true if and only if both permutations have the same images for 0, 1, 2 and 3.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation are equal.

◆ operator==() [13/18]

bool regina::Perm< 5 >::operator== ( const Perm< 5 > &  other) const
inline

Determines if this is equal to the given permutation.

This is true if and only if both permutations have the same images for 0, 1, 2, 3 and 4.

Parameters
otherthe permutation with which to compare this.
Returns
true if and only if this and the given permutation are equal.

◆ operator==() [14/18]

template<typename T >
bool regina::Polynomial< T >::operator== ( const Polynomial< T > &  rhs) const
inline

Tests whether this and the given polynomial are equal.

Parameters
rhsthe polynomial to compare with this.
Returns
true if and only if this and the given polynomial are equal.

◆ operator==() [15/18]

bool regina::Rational::operator== ( const Rational compare) const

Determines if this is equal to the given rational.

Parameters
comparethe rational with which this will be compared.
Returns
true if and only if this rational is equal to compare.

◆ operator==() [16/18]

template<class T >
bool regina::Vector< T >::operator== ( const Vector< T > &  compare) const
inline

Determines if this vector is equal to the given vector.

Precondition
This and the given vector have the same size.
Parameters
comparethe vector with which this will be compared.
Returns
true if and only if the this and the given vector are equal.

◆ operator==() [17/18]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator== ( long  rhs) const
inline

Determines if this is equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are equal.

◆ operator==() [18/18]

template<int bytes>
bool regina::NativeInteger< bytes >::operator== ( Native  rhs) const
inline

Determines if this is equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this and the given integer are equal.

◆ operator>() [1/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator> ( const IntegerBase< supportInfinity > &  rhs) const
inline

Determines if this is greater than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than the given integer.

◆ operator>() [2/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator> ( const NativeInteger< bytes > &  rhs) const
inline

Determines if this is greater than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than the given integer.

◆ operator>() [3/5]

bool regina::Rational::operator> ( const Rational compare) const

Determines if this is greater than the given rational.

Parameters
comparethe rational with which this will be compared.
Returns
true if and only if this rational is greater than compare.

◆ operator>() [4/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator> ( long  rhs) const
inline

Determines if this is greater than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than the given integer.

◆ operator>() [5/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator> ( Native  rhs) const
inline

Determines if this is greater than the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than the given integer.

◆ operator>=() [1/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator>= ( const IntegerBase< supportInfinity > &  rhs) const
inline

Determines if this is greater than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than or equal to the given integer.

◆ operator>=() [2/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator>= ( const NativeInteger< bytes > &  rhs) const
inline

Determines if this is greater than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than or equal to the given integer.

◆ operator>=() [3/5]

bool regina::Rational::operator>= ( const Rational compare) const
inline

Determines if this is greater than or equal to the given rational.

Parameters
comparethe rational with which this will be compared.
Returns
true if and only if this rational is greater than or equal to compare.

◆ operator>=() [4/5]

template<bool supportInfinity>
bool regina::IntegerBase< supportInfinity >::operator>= ( long  rhs) const
inline

Determines if this is greater than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than or equal to the given integer.

◆ operator>=() [5/5]

template<int bytes>
bool regina::NativeInteger< bytes >::operator>= ( Native  rhs) const
inline

Determines if this is greater than or equal to the given integer.

Parameters
rhsthe integer with which this will be compared.
Returns
true if and only if this is greater than or equal to the given integer.

◆ operator[]() [1/12]

template<int n>
int regina::Perm< n >::operator[] ( int  source) const
inline

Determines the image of the given integer under this permutation.

Parameters
sourcethe integer whose image we wish to find. This should be between 0 and n-1 inclusive.
Returns
the image of source.

◆ operator[]() [2/12]

int regina::Perm< 2 >::operator[] ( int  source) const
inline

Determines the image of the given integer under this permutation.

Parameters
sourcethe integer whose image we wish to find. This should be 0 or 1.
Returns
the image of source.

◆ operator[]() [3/12]

int regina::Perm< 3 >::operator[] ( int  source) const
inline

Determines the image of the given integer under this permutation.

Parameters
sourcethe integer whose image we wish to find. This should be between 0 and 2 inclusive.
Returns
the image of source.

◆ operator[]() [4/12]

int regina::Perm< 4 >::operator[] ( int  source) const
inline

Determines the image of the given integer under this permutation.

Parameters
sourcethe integer whose image we wish to find. This should be between 0 and 3 inclusive.
Returns
the image of source.

◆ operator[]() [5/12]

int regina::Perm< 5 >::operator[] ( int  source) const
inline

Determines the image of the given integer under this permutation.

Parameters
sourcethe integer whose image we wish to find. This should be between 0 and 4 inclusive.
Returns
the image of source.

◆ operator[]() [6/12]

template<typename T >
const T & regina::Laurent< T >::operator[] ( long  exp) const
inline

Returns the given coefficient of this polynomial.

There are no restrictions on the exponent exp.

Python:\n Python users can also use this operator to set
cofficients; that is, you can write poly[exp] = value. In contrast, C++ users must use the separate routine set(), due to the fact that in C++ this square bracket operator is const.
Parameters
expthe exponent of the term whose coefficient should be returned.
Returns
the coefficient of the given term.

◆ operator[]() [7/12]

Rational & regina::Cyclotomic::operator[] ( size_t  exp)
inline

Offers access to an individual rational coefficient of the polynomial representation of this field element.

The polynomial representation expresses this field element as a member of ℚ[x]/Φ_n, using a rational polynomial of degree strictly less than deg(Φ_n) = φ(n); that is, strictly less than the value returned by degree(). See the Cyclotomic class notes for further details.

In particular, for a field element e, the operator e[i] will give access to the coefficient of x^i in this polynomial representation.

This routine returns a non-constant reference: you can use this to directly edit the coefficients (and therefore the value of the field element). Note that there is also a constant (read-only) variant of this routine.

Parameters
expindicates which coefficient to access; this must be between 0 and degree()-1 inclusive.
Returns
a reference to the corresponding rational coefficient.

◆ operator[]() [8/12]

const Rational & regina::Cyclotomic::operator[] ( size_t  exp) const
inline

Returns an individual rational coefficient of the polynomial representation of this field element.

The polynomial representation expresses this field element as a member of ℚ[x]/Φ_n, using a rational polynomial of degree strictly less than deg(Φ_n) = φ(n); that is, strictly less than the value returned by degree(). See the Cyclotomic class notes for further details.

In particular, for a field element e, the operator e[i] will return the coefficient of x^i in this polynomial representation.

This is a constant (read-only) routine; note that there is a non-constant (read-write) variant of this routine also.

Parameters
expindicates which coefficient to return; this must be between 0 and degree()-1 inclusive.
Returns
a constant reference to the corresponding rational coefficient.

◆ operator[]() [9/12]

template<typename T >
const T & regina::Polynomial< T >::operator[] ( size_t  exp) const
inline

Returns the given coefficient of this polynomial.

Parameters
expthe exponent of the term whose coefficient should be returned. This must be between 0 and degree() inclusive.
Returns
the coefficient of the given term.

◆ operator[]() [10/12]

template<class T >
const T& regina::Vector< T >::operator[] ( size_t  index) const
inline

Returns the element at the given index in the vector.

A constant reference to the element is returned; the element may not be altered.

Precondition
index is between 0 and size()-1 inclusive.
Parameters
indexthe vector index to examine.
Returns
the vector element at the given index.

◆ operator[]() [11/12]

long * regina::Matrix2::operator[] ( unsigned  row)
inline

Returns a single row of this matrix.

This means that the integer in row r, column c can be accessed as myMatrix[r][c] (where r and c are each 0 or 1). Each such element may be modified directly.

Parameters
rowthe index of the requested row; this must be 0 or 1.
Returns
a two-integer array containing the elements of the requested row.

◆ operator[]() [12/12]

const long * regina::Matrix2::operator[] ( unsigned  row) const
inline

Returns a single row of this matrix.

This means that the integer in row r, column c can be accessed as myMatrix[r][c] (where r and c are each 0 or 1).

Parameters
rowthe index of the requested row; this must be 0 or 1.
Returns
a two-integer array containing the elements of the requested row.

◆ orderedS2Index()

int regina::Perm< 2 >::orderedS2Index ( ) const
inline

Returns the index of this permutation in the Perm<2>::orderedS2 array.

Returns
the index i for which this permutation is equal to Perm<2>::orderedS2[i]. This will be 0 or 1.

◆ orderedS3Index()

int regina::Perm< 3 >::orderedS3Index ( ) const
inline

Returns the index of this permutation in the Perm<3>::orderedS3 array.

Returns
the index i for which this permutation is equal to Perm<3>::orderedS3[i]. This will be between 0 and 5 inclusive.

◆ orderedS4Index()

int regina::Perm< 4 >::orderedS4Index ( ) const
inline

Returns the index of this permutation in the Perm<4>::orderedS4 array.

Returns
the index i for which this permutation is equal to Perm<4>::orderedS4[i]. This will be between 0 and 23 inclusive.

◆ orderedS5Index()

int regina::Perm< 5 >::orderedS5Index ( ) const

Returns the index of this permutation in the Perm<5>::orderedS5 array.

Returns
the index i for which this permutation is equal to Perm<5>::orderedS5[i]. This will be between 0 and 119 inclusive.
Author
Ryan Budney

◆ orderedSnIndex() [1/4]

int regina::Perm< 2 >::orderedSnIndex ( ) const
inline

Returns the index of this permutation in the Perm<2>::orderedS2 array.

This is a dimension-agnostic alias for orderedS2Index().

Returns
the index i for which this permutation is equal to Perm<2>::orderedS2[i]. This will be 0 or 1.

◆ orderedSnIndex() [2/4]

int regina::Perm< 3 >::orderedSnIndex ( ) const
inline

Returns the index of this permutation in the Perm<3>::orderedS3 array.

This is a dimension-agnostic alias for orderedS3Index().

Returns
the index i for which this permutation is equal to Perm<3>::orderedS3[i]. This will be between 0 and 5 inclusive.

◆ orderedSnIndex() [3/4]

int regina::Perm< 4 >::orderedSnIndex ( ) const
inline

Returns the index of this permutation in the Perm<4>::orderedS4 array.

This is a dimension-agnostic alias for orderedS4Index().

Returns
the index i for which this permutation is equal to Perm<4>::orderedS4[i]. This will be between 0 and 23 inclusive.

◆ orderedSnIndex() [4/4]

int regina::Perm< 5 >::orderedSnIndex ( ) const
inline

Returns the index of this permutation in the Perm<5>::orderedS5 array.

This is a dimension-agnostic alias for orderedS5Index().

Returns
the index i for which this permutation is equal to Perm<5>::orderedS5[i]. This will be between 0 and 119 inclusive.

◆ Perm() [1/30]

template<int n>
regina::Perm< n >::Perm
inline

Creates the identity permutation.

◆ Perm() [2/30]

regina::Perm< 2 >::Perm ( )
inline

Creates the identity permutation.

◆ Perm() [3/30]

regina::Perm< 3 >::Perm ( )
inline

Creates the identity permutation.

◆ Perm() [4/30]

regina::Perm< 4 >::Perm ( )
inline

Creates the identity permutation.

◆ Perm() [5/30]

regina::Perm< 5 >::Perm ( )
inline

Creates the identity permutation.

◆ Perm() [6/30]

template<int n>
regina::Perm< n >::Perm ( const int *  a,
const int *  b 
)
inline

Creates a permutation mapping (a[0], ..., a[n-1]) to (b[0], ..., b[n-1]) respectively.

Precondition
Both arrays a and b contain n elements, which are 0,...,n-1 in some order.
Python:\n Not present.
Parameters
athe array of preimages; this must have length n.
bthe corresponding array of images; this must also have length n.

◆ Perm() [7/30]

regina::Perm< 2 >::Perm ( const int *  a,
const int *  b 
)
inline

Creates a permutation mapping (a[0], a[1]) to (b[0], b[1]) respectively.

Precondition
Both arrays a and b contain two elements, which are 0 and 1 in some order.
Python:\n Not present.
Parameters
athe array of preimages; this must have length 2.
bthe corresponding array of images; this must also have length 2.

◆ Perm() [8/30]

regina::Perm< 3 >::Perm ( const int *  a,
const int *  b 
)

Creates a permutation mapping (a[0], ..., a[2]) to (b[0], ..., b[2]) respectively.

Precondition
Both arrays a and b contain 3 elements, which are 0,...,2 in some order.
Python:\n Not present.
Parameters
athe array of preimages; this must have length 3.
bthe corresponding array of images; this must also have length 3.

◆ Perm() [9/30]

regina::Perm< 4 >::Perm ( const int *  a,
const int *  b 
)

Creates a permutation mapping (a[0], ..., a[3]) to (b[0], ..., b[3]) respectively.

Precondition
Both arrays a and b contain 4 elements, which are 0,...,3 in some order.
Python:\n Not present.
Parameters
athe array of preimages; this must have length 4.
bthe corresponding array of images; this must also have length 4.

◆ Perm() [10/30]

regina::Perm< 5 >::Perm ( const int *  a,
const int *  b 
)
inline

Creates a permutation mapping (a[0], ..., a[4]) to (b[0], ..., b[4]) respectively.

Precondition
Both arrays a and b contain 5 elements, which are 0,...,4 in some order.
Python:\n Not present.
Parameters
athe array of preimages; this must have length 5.
bthe corresponding array of images; this must also have length 5.

◆ Perm() [11/30]

template<int n>
regina::Perm< n >::Perm ( const int *  image)
inline

Creates a permutation mapping i to image[i] for each 0 ≤ i < n.

Precondition
The array image contains n elements, which are 0,...,n-1 in some order.
Parameters
imagethe array of images.

◆ Perm() [12/30]

regina::Perm< 2 >::Perm ( const int *  image)
inline

Creates a permutation mapping i to image[i] for each i = 0,1.

Precondition
The array image contains two elements, which are 0 and 1 in some order.
Python:\n Not present.
Parameters
imagethe array of images.

◆ Perm() [13/30]

regina::Perm< 3 >::Perm ( const int *  image)
inline

Creates a permutation mapping i to image[i] for each i = 0,1,2.

Precondition
The array image contains three elements, which are 0, 1 and 2 in some order.
Python:\n Not present.
Parameters
imagethe array of images.

◆ Perm() [14/30]

regina::Perm< 4 >::Perm ( const int *  image)
inline

Creates a permutation mapping i to image[i] for each i = 0,1,2,3.

Precondition
The array image contains four elements, which are 0, 1, 2 and 3 in some order.
Python:\n Not present.
Parameters
imagethe array of images.

◆ Perm() [15/30]

regina::Perm< 5 >::Perm ( const int *  image)
inline

Creates a permutation mapping i to image[i] for each i = 0,1,2,3,4.

Precondition
The array image contains five elements, which are 0, 1, 2, 3 and 4 in some order.
Python:\n Not present.
Parameters
imagethe array of images.

◆ Perm() [16/30]

regina::Perm< 2 >::Perm ( const Perm< 2 > &  cloneMe)
default

Creates a permutation that is a clone of the given permutation.

Parameters
cloneMethe permutation to clone.

◆ Perm() [17/30]

regina::Perm< 3 >::Perm ( const Perm< 3 > &  cloneMe)
default

Creates a permutation that is a clone of the given permutation.

Parameters
cloneMethe permutation to clone.

◆ Perm() [18/30]

regina::Perm< 4 >::Perm ( const Perm< 4 > &  cloneMe)
default

Creates a permutation that is a clone of the given permutation.

Parameters
cloneMethe permutation to clone.

◆ Perm() [19/30]

regina::Perm< 5 >::Perm ( const Perm< 5 > &  cloneMe)
default

Creates a permutation that is a clone of the given permutation.

Parameters
cloneMethe permutation to clone.

◆ Perm() [20/30]

template<int n>
regina::Perm< n >::Perm ( const Perm< n > &  cloneMe)
default

Creates a permutation that is a clone of the given permutation.

Parameters
cloneMethe permutation to clone.

◆ Perm() [21/30]

template<int n>
regina::Perm< n >::Perm ( int  a,
int  b 
)
inline

Creates the transposition of a and b.

Note that a and b need not be distinct.

Precondition
0 ≤ a,b < n.
Parameters
athe element to switch with b.
bthe element to switch with a.

◆ Perm() [22/30]

regina::Perm< 2 >::Perm ( int  a,
int  b 
)
inline

Creates the transposition of a and b.

Note that a and b need not be distinct.

Precondition
a and b are in {0,1}.
Parameters
athe element to switch with b.
bthe element to switch with a.

◆ Perm() [23/30]

regina::Perm< 3 >::Perm ( int  a,
int  b 
)
inline

Creates the transposition of a and b.

Note that a and b need not be distinct.

Precondition
a and b are in {0,1,2}.
Parameters
athe element to switch with b.
bthe element to switch with a.

◆ Perm() [24/30]

regina::Perm< 4 >::Perm ( int  a,
int  b 
)
inline

Creates the transposition of a and b.

Note that a and b need not be distinct.

Precondition
a and b are in {0,1,2,3}.
Parameters
athe element to switch with b.
bthe element to switch with a.

◆ Perm() [25/30]

regina::Perm< 5 >::Perm ( int  a,
int  b 
)
inline

Creates the transposition of a and b.

Note that a and b need not be distinct.

Precondition
a and b are in {0,1,2,3,4}.
Parameters
athe element to switch with b.
bthe element to switch with a.

◆ Perm() [26/30]

regina::Perm< 3 >::Perm ( int  a,
int  b,
int  c 
)
inline

Creates a permutation mapping (0,1,2) to (a,b,c) respectively.

Precondition
{a,b,c} = {0,1,2}.
Parameters
athe desired image of 0.
bthe desired image of 1.
cthe desired image of 2.

◆ Perm() [27/30]

regina::Perm< 4 >::Perm ( int  a,
int  b,
int  c,
int  d 
)
inline

Creates a permutation mapping (0,1,2,3) to (a,b,c,d) respectively.

Precondition
{a,b,c,d} = {0,1,2,3}.
Parameters
athe desired image of 0.
bthe desired image of 1.
cthe desired image of 2.
dthe desired image of 3.

◆ Perm() [28/30]

regina::Perm< 5 >::Perm ( int  a,
int  b,
int  c,
int  d,
int  e 
)
inline

Creates a permutation mapping (0,1,2,3,4) to (a,b,c,d,e) respectively.

Precondition
{a,b,c,d,e} = {0,1,2,3,4}.
Parameters
athe desired image of 0.
bthe desired image of 1.
cthe desired image of 2.
dthe desired image of 3.
ethe desired image of 4.

◆ Perm() [29/30]

regina::Perm< 4 >::Perm ( int  a0,
int  a1,
int  b0,
int  b1,
int  c0,
int  c1,
int  d0,
int  d1 
)

Creates a permutation mapping (a0,b0,c0,d0) to (a1,b1,c1,d1) respectively.

Precondition
{a0,b0,c0,d0} = {a1,b1,c1,d1} = {0,1,2,3}.
Parameters
a0the desired preimage of a1.
b0the desired preimage of b1.
c0the desired preimage of c1.
d0the desired preimage of d1.
a1the desired image of a0.
b1the desired image of b0.
c1the desired image of c0.
d1the desired image of d0.

◆ Perm() [30/30]

regina::Perm< 5 >::Perm ( int  a0,
int  a1,
int  b0,
int  b1,
int  c0,
int  c1,
int  d0,
int  d1,
int  e0,
int  e1 
)
inline

Creates a permutation mapping (a0,b0,c0,d0,e0) to (a1,b1,c1,d1,e1) respectively.

Precondition
{a0,b0,c0,d0,e0} = {a1,b1,c1,d1,e1} = {0,1,2,3,4}.
Parameters
a0the desired preimage of a1.
b0the desired preimage of b1.
c0the desired preimage of c1.
d0the desired preimage of d1.
e0the desired preimage of e1.
a1the desired image of a0.
b1the desired image of b0.
c1the desired image of c0.
d1the desired image of d0.
e1the desired image of e0.

◆ permCode() [1/5]

template<int n>
Perm< n >::Code regina::Perm< n >::permCode
inline

Returns the internal code representing this permutation.

Note that the internal code is sufficient to reproduce the entire permutation.

The code returned will be a valid permutation code as determined by isPermCode().

Returns
the internal code.

◆ permCode() [2/5]

Perm< 2 >::Code regina::Perm< 2 >::permCode ( ) const
inline

Returns the internal code representing this permutation.

Note that the internal code is sufficient to reproduce the entire permutation.

The code returned will be a valid permutation code as determined by isPermCode().

Returns
the internal code.

◆ permCode() [3/5]

Perm< 3 >::Code regina::Perm< 3 >::permCode ( ) const
inline

Returns the internal code representing this permutation.

Note that the internal code is sufficient to reproduce the entire permutation.

The code returned will be a valid permutation code as determined by isPermCode().

Returns
the internal code.

◆ permCode() [4/5]

Perm< 4 >::Code regina::Perm< 4 >::permCode ( ) const
inline

Returns the first-generation code representing this permutation.

This code is sufficient to reproduce the entire permutation.

The code returned will be a valid first-generation permutation code as determined by isPermCode().

Warning
This routine will incur additional overhead, since Perm<4> now uses second-generation codes internally. See the class notes and the routine permCode2() for details.
Returns
the first-generation permutation code.

◆ permCode() [5/5]

Perm< 5 >::Code regina::Perm< 5 >::permCode ( ) const
inline

Returns the internal code representing this permutation.

Note that the internal code is sufficient to reproduce the entire permutation.

The code returned will be a valid permutation code as determined by isPermCode().

Returns
the internal code.

◆ permCode2()

Perm< 4 >::Code regina::Perm< 4 >::permCode2 ( ) const
inline

Returns the second-generation code representing this permutation.

This code is sufficient to reproduce the entire permutation.

The code returned will be a valid second-generation permutation code as determined by isPermCode2().

Second-generation codes are fast to work with, since they are used internally by the Perm<4> class.

Returns
the second-generation permutation code.

◆ Polynomial() [1/7]

template<typename T >
regina::Polynomial< T >::Polynomial
inline

Creates the zero polynomial.

◆ polynomial()

Polynomial< Rational > * regina::Cyclotomic::polynomial ( ) const
inline

Returns the full polynomial representation of this field element.

The polynomial representation expresses this field element as a member of ℚ[x]/Φ_n, using a rational polynomial of degree strictly less than deg(Φ_n) = φ(n); that is, strictly less than the value returned by degree(). See the Cyclotomic class notes for further details.

This routine returns the polynomial representation as a newly allocated Polynomial<Rational> object. The caller of this routine is responsible for destroying this new polynomial.

The new polynomial will become independent of this Cyclotomic field element: if you subsequently change this field element then the new Polynomial object will not change, and likewise if you change the new Polynomial object then this Cyclotomic field element will not change.

Precondition
This field element has been initialised (either through a non-default constructor, an assignment operator, or by calling init()).
Returns
a new polynomial giving the full polynomial representation of this field element.

◆ Polynomial() [2/7]

template<typename T >
regina::Polynomial< T >::Polynomial ( const Polynomial< T > &  value)
inline

Creates a new copy of the given polynomial.

This constructor induces a deep copy of value.

A note for developers: even though this routine is identical to the templated copy constructor, it must be declared and implemented separately. Otherwise the compiler might create its own (incorrect) copy constructor automatically.

Parameters
valuethe polynomial to clone.

◆ Polynomial() [3/7]

template<typename T >
template<typename U >
regina::Polynomial< T >::Polynomial ( const Polynomial< U > &  value)
inline

Creates a new copy of the given polynomial.

This constructor induces a deep copy of value.

Precondition
Objects of type T can be assigned values of type U.
Parameters
valuethe polynomial to clone.

◆ Polynomial() [4/7]

template<typename T >
template<typename iterator >
regina::Polynomial< T >::Polynomial ( iterator  begin,
iterator  end 
)
inline

Creates a new polynomial from the given sequence of coefficients.

The coefficients should appear in order from the constant coefficient to the leading coefficient.

There is no problem if the leading coefficient (i.e., the last coefficient in the sequence) is zero. An empty sequence will be treated as the zero polynomial.

This constructor induces a deep copy of the given range.

Precondition
Objects of type T can be assigned values from dereferenced iterators of type iterator.
Python:\n Instead of a pair of iterators, this routine
takes a python list of coefficients.
Parameters
beginthe beginning of the sequence of coefficients.
enda past-the-end iterator indicating the end of the sequence of coefficients.

◆ Polynomial() [5/7]

template<typename T >
regina::Polynomial< T >::Polynomial ( Polynomial< T > &&  value)
inlinenoexcept

Moves the contents of the given polynomial to this new polynomial.

This is a fast (constant time) operation.

The polynomial that was passed (value) will no longer be usable.

Parameters
valuethe polynomial to move.

◆ Polynomial() [6/7]

template<typename T >
regina::Polynomial< T >::Polynomial ( size_t  degree)
inlineexplicit

Creates the polynomial x^d for the given degree d.

Parameters
degreethe degree of the new polynomial.

◆ Polynomial() [7/7]

template<typename T >
regina::Polynomial< T >::Polynomial ( std::initializer_list< T >  coefficients)
inline

Creates a new polynomial from a hard-coded sequence of coefficients.

This constructor takes a C++11 initialiser list, which should contain the coefficients in order from the constant coefficient to the leading coefficient.

There is no problem if the leading coefficient (i.e., the last coefficient in the sequence) is zero. An empty sequence will be treated as the zero polynomial.

Python:\n Not available, but there is a Python constructor
that takes a list of coefficients (which need not be constant).
Parameters
coefficientsthe full sequence of coefficients.

◆ preImageOf() [1/5]

template<int n>
int regina::Perm< n >::preImageOf ( int  image) const
inline

Determines the preimage of the given integer under this permutation.

Parameters
imagethe integer whose preimage we wish to find. This should be between 0 and n-1 inclusive.
Returns
the preimage of image.

◆ preImageOf() [2/5]

int regina::Perm< 2 >::preImageOf ( int  image) const
inline

Determines the preimage of the given integer under this permutation.

Parameters
imagethe integer whose preimage we wish to find. This should be 0 or 1.
Returns
the preimage of image.

◆ preImageOf() [3/5]

int regina::Perm< 3 >::preImageOf ( int  image) const
inline

Determines the preimage of the given integer under this permutation.

Parameters
imagethe integer whose preimage we wish to find. This should be between 0 and 2 inclusive.
Returns
the preimage of image.

◆ preImageOf() [4/5]

int regina::Perm< 4 >::preImageOf ( int  image) const
inline

Determines the preimage of the given integer under this permutation.

Parameters
imagethe integer whose preimage we wish to find. This should be between 0 and 3 inclusive.
Returns
the preimage of image.

◆ preImageOf() [5/5]

int regina::Perm< 5 >::preImageOf ( int  image) const
inline

Determines the preimage of the given integer under this permutation.

Parameters
imagethe integer whose preimage we wish to find. This should be between 0 and 4 inclusive.
Returns
the preimage of image.

◆ preImageOfLattice()

std::unique_ptr<MatrixInt> regina::preImageOfLattice ( const MatrixInt hom,
const std::vector< Integer > &  sublattice 
)

Given a homomorphism from Z^n to Z^k and a sublattice of Z^k, compute the preimage of this sublattice under this homomorphism.

The homomorphism from Z^n to Z^k is described by the given k by n matrix hom. The sublattice is of the form (p1 Z) * (p2 Z) * ... * (pk Z), where the non-negative integers p1, ..., pk are passed in the given list sublattice.

An equivalent problem is to consider hom to be a homomorphism from Z^n to Z_p1 + ... + Z_pk; this routine then finds the kernel of this homomorphism.

The preimage of the sublattice (equivalently, the kernel described above) is some rank n lattice in Z^n. This algorithm finds and returns a basis for the lattice.

Python:\n The argument sublattice should be supplied as a python list.
Parameters
homthe matrix representing the homomorphism from Z^n to Z^k; this must be a k by n matrix.
sublatticea list of length k describing the sublattice of Z^k; the elements of this list must be the non-negative integers p1, ..., pk as described above.
Returns
a new matrix whose columns are a basis for the preimage lattice. This matrix will have precisely n rows.
Author
Ryan Budney

◆ prime()

static Integer regina::Primes::prime ( unsigned long  which,
bool  autoGrow = true 
)
static

Returns the requested prime (or suspected prime).

More specifically, this routine returns the (which + 1)th smallest prime. Thus prime(0) returns 2, prime(1) returns 3, prime(2) returns 5, and so on.

If which is smaller than the number of initial seed primes, the result is guaranteed to be the (which + 1)th smallest prime (see the Primes class notes for the size of the initial seed list). If which is larger, a probabilistic algorithm is used and so there is a possibility that non-primes are included in the list.

If which < size() then this routine is essentially instantaneous, since the (which + 1)th smallest (suspected) prime is already stored. Otherwise the behaviour depends on the argument autoGrow. If autoGrow is true (the default) then this routine calculates the requested prime, which might take some time. If autoGrow is false then this routine returns zero.

Parameters
whichindicates which prime is requested.
autoGrowspecifies what to do if the requested prime lies beyond the list currently stored (see above).
Returns
the requested prime (or suspected prime), or zero if which was too large and autoGrow was false.

◆ primeDecomp()

static std::vector<Integer> regina::Primes::primeDecomp ( const Integer n)
static

Returns the prime factorisation of the given integer as a list of individual primes (or suspected primes).

Prime factors are returned in increasing order. Where a prime power appears in the factorisation, the relevant prime will appear several times in the list.

For very large integers, the factorisation becomes probabilistic: (i) this routine examines suspected primes instead of primes (see the class notes), and (ii) if the routine is having trouble finding factors then it will run a probabilistic prime test on whatever portion of n still remains (and will assume that portion to be prime if the test passes).

The given integer may be negative, in which case -1 will be listed as the first factor (even though -1 is not prime). If 0 is passed then a single factor of 0 will be returned; if 1 is passed then an empty list will be returned. In all cases, the given integer n will be the product of all elements of the final list (where an empty product is assumed to be 1).

As an example, the prime factors of 54 will be listed as (2, 3, 3, 3), and the prime factors of -90 will be listed as (-1, 2, 3, 3, 5).

Note that the internal list of known primes and suspected primes will be expanded as necessary; there is no need for the caller to manage this list manually.

Todo:
Optimise: Add a version that does not return the factors by value.
Python:\n In addition to this routine, the routine
primeDecompInt() is also available. The routine primeDecompInt() behaves identically to this routine except that the (i) return values are of ordinary integer type, not Integer; (ii) the input value n must lie within the C++ long integer range (otherwise the behaviour is undefined).
Parameters
nthe integer to factorise.
Returns
the list of prime factors as described above.

◆ primePowerDecomp()

static std::vector<std::pair<Integer, unsigned long> > regina::Primes::primePowerDecomp ( const Integer n)
static

Returns the prime factorisation of the given integer as a list of prime powers (or suspected prime powers).

Factors are returned as (prime, exponent) pairs. Different pairs describe different primes, and the pairs are sorted in order from smallest prime to largest. All exponents are strictly positive.

For very large integers, the factorisation becomes probabilistic: (i) this routine examines suspected primes instead of primes (see the class notes), and (ii) if the routine is having trouble finding factors then it will run a probabilistic prime test on whatever portion of n still remains (and will assume that portion to be prime if the test passes).

The given integer may be negative, in which case (-1,1) will be listed as the first prime power (even though -1 is not prime). If 0 is passed then a single pair (0,1) will be returned; if 1 is passed then an empty list will be returned. In all cases, the given integer n will be the product of all powers described by the final list (where an empty product is assumed to be 1).

As an example, the factorisation of 54 will be reported as [(2,1) (3,3)], and the factorisation of -90 will be reported as [(-1,1) (2,1) (3,2) (5,1)].

Note that the internal list of known primes and suspected primes will be expanded as necessary; there is no need for the caller to manage this list manually.

The current implementation of this routine merely calls primeDecomp() and rewrites the list of factors by grouping primes.

Todo:
Optimise: Implement this routine natively to avoid the overhead of the temporary primeDecomp() vector.
Todo:
Optimise: Add a version that does not return the factors by value.
Python:\n In addition to this routine, the routine
primePowerDecompInt() is also available. The routine primePowerDecompInt() behaves identically to this routine except that the (i) return values are of ordinary integer type, not Integer; (ii) the input value n must lie within the C++ long integer range (otherwise the behaviour is undefined).
Parameters
nthe integer to factorise.
Returns
the list of prime power factors as described above.

◆ raiseToPower()

template<bool supportInfinity = false>
void regina::IntegerBase< supportInfinity >::raiseToPower ( unsigned long  exp)

Raises this integer to the power of the given exponent.

This integer is changed to reflect the result.

Note that 0 to the power of 0 will be 1, infinity to the power of 0 will be 1, and infinity to the power of anything else will be infinity.

Precondition
The given exponent is non-negative.
Parameters
expthe power to which this integer will be raised.

◆ rand() [1/10]

template<int n>
Perm< n > regina::Perm< n >::rand ( bool  even = false)
static

Returns a random permutation on n elements.

All permutations are returned with equal probability.

This routine is thread-safe, and uses RandomEngine for its random number generation.

Warning
This routine is expensive, since it locks and unlocks the mutex protecting Regina's global uniform random bit generator. If you are calling this many times in quick succession, consider creating a single RandomEngine object yourself and then calling rand(randomEngine.engine(), even).
Parameters
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [2/10]

Perm< 2 > regina::Perm< 2 >::rand ( bool  even = false)
inlinestatic

Returns a random permutation on two elements.

All permutations are returned with equal probability.

This routine is thread-safe, and uses RandomEngine for its random number generation.

Warning
This routine is expensive, since it locks and unlocks the mutex protecting Regina's global uniform random bit generator. If you are calling this many times in quick succession, consider creating a single RandomEngine object yourself and then calling rand(randomEngine.engine(), even).
Parameters
evenif true, then the resulting permutation is guaranteed to be even (which means, for a permutation on two elements, the resulting permutation must be the identity).
Returns
a random permutation.

◆ rand() [3/10]

Perm< 3 > regina::Perm< 3 >::rand ( bool  even = false)
inlinestatic

Returns a random permutation on three elements.

All permutations are returned with equal probability.

This routine is thread-safe, and uses RandomEngine for its random number generation.

Warning
This routine is expensive, since it locks and unlocks the mutex protecting Regina's global uniform random bit generator. If you are calling this many times in quick succession, consider creating a single RandomEngine object yourself and then calling rand(randomEngine.engine(), even).
Parameters
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [4/10]

Perm< 4 > regina::Perm< 4 >::rand ( bool  even = false)
inlinestatic

Returns a random permutation on four elements.

All permutations are returned with equal probability.

This routine is thread-safe, and uses RandomEngine for its random number generation.

Warning
This routine is expensive, since it locks and unlocks the mutex protecting Regina's global uniform random bit generator. If you are calling this many times in quick succession, consider creating a single RandomEngine object yourself and then calling rand(randomEngine.engine(), even).
Parameters
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [5/10]

Perm< 5 > regina::Perm< 5 >::rand ( bool  even = false)
inlinestatic

Returns a random permutation on five elements.

All permutations are returned with equal probability.

This routine is thread-safe, and uses RandomEngine for its random number generation.

Warning
This routine is expensive, since it locks and unlocks the mutex protecting Regina's global uniform random bit generator. If you are calling this many times in quick succession, consider creating a single RandomEngine object yourself and then calling rand(randomEngine.engine(), even).
Parameters
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [6/10]

template<int n>
template<class URBG >
static Perm regina::Perm< n >::rand ( URBG &&  gen,
bool  even = false 
)
static

Returns a random permutation on n elements, using the given uniform random bit generator.

All permutations are returned with equal probability.

The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.

Template Parameters
URBGA type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept.
Python:\n Not present, though the non-thread-safe variant
without the gen argument is available.
Parameters
genthe source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header).
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [7/10]

template<class URBG >
static Perm regina::Perm< 2 >::rand ( URBG &&  gen,
bool  even = false 
)
static

Returns a random permutation on two elements, using the given uniform random bit generator.

All permutations are returned with equal probability.

The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.

Template Parameters
URBGA type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept.
Python:\n Not present, though the non-thread-safe variant
without the gen argument is available.
Parameters
genthe source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header).
evenif true, then the resulting permutation is guaranteed to be even (which means, for a permutation on two elements, the resulting permutation must be the identity).
Returns
a random permutation.

◆ rand() [8/10]

template<class URBG >
static Perm regina::Perm< 3 >::rand ( URBG &&  gen,
bool  even = false 
)
static

Returns a random permutation on three elements, using the given uniform random bit generator.

All permutations are returned with equal probability.

The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.

Template Parameters
URBGA type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept.
Python:\n Not present, though the non-thread-safe variant
without the gen argument is available.
Parameters
genthe source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header).
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [9/10]

template<class URBG >
static Perm regina::Perm< 4 >::rand ( URBG &&  gen,
bool  even = false 
)
static

Returns a random permutation on four elements, using the given uniform random bit generator.

All permutations are returned with equal probability.

The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.

Template Parameters
URBGA type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept.
Python:\n Not present, though the non-thread-safe variant
without the gen argument is available.
Parameters
genthe source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header).
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ rand() [10/10]

template<class URBG >
static Perm regina::Perm< 5 >::rand ( URBG &&  gen,
bool  even = false 
)
static

Returns a random permutation on five elements, using the given uniform random bit generator.

All permutations are returned with equal probability.

The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.

Template Parameters
URBGA type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept.
Python:\n Not present, though the non-thread-safe variant
without the gen argument is available.
Parameters
genthe source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header).
evenif true, then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability).
Returns
a random permutation.

◆ randomBinary()

template<bool supportInfinity = false>
static IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::randomBinary ( unsigned long  n)
static

Generate a pseudo-random integer that is uniformly distributed in the interval [0,2^n).

The random number generation here does not use Regina's own RandomEngine class, but instead uses a separate random number generator provided by GMP.

Parameters
nthe maximum number of bits in the pseudo-random integer.
Returns
a pseudo-random integer.

◆ randomBoundedByThis()

template<bool supportInfinity = false>
IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::randomBoundedByThis ( ) const

Generate a pseudo-random integer that is uniformly distributed in the interval [0,*this).

The random number generation here does not use Regina's own RandomEngine class, but instead uses a separate random number generator provided by GMP.

Precondition
This integer is strictly positive.
Warning
Even if this integer is small, this routine is still slow - it always goes through the GMP large integer routines so that the random number generation algorithm is consistent. If you need a fast random number generator and this integer is small, consider using the standard rand() function instead.
Returns
a pseudo-random integer.

◆ randomCornerBinary()

template<bool supportInfinity = false>
static IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::randomCornerBinary ( unsigned long  n)
static

Generate a pseudo-random integer that is distributed in the interval [0,2^n), with a tendency to have long strings of 0s and 1s in its binary expansion.

The random number generation here does not use Regina's own RandomEngine class, but instead uses a separate random number generator provided by GMP.

Parameters
nthe maximum number of bits in the pseudo-random integer.
Returns
a pseudo-random integer.

◆ Rational() [1/6]

regina::Rational::Rational ( )
inline

Initialises to 0/1.

◆ Rational() [2/6]

template<bool supportInfinity>
regina::Rational::Rational ( const IntegerBase< supportInfinity > &  newNum,
const IntegerBase< supportInfinity > &  newDen 
)

Initialises to newNum/newDen.

Precondition
gcd(newNum, newDen) = 1 or newDen = 0.
newDen is non-negative.
Warning
Failing to meet the preconditions above can result in misleading or even undefined behaviour. As an example, Rational(4,4) (which breaks the gcd requirement) is considered different from Rational(1,1) (a valid rational), which is different again from Rational(-1,-1) (which breaks the non-negativity requirement).
Precondition
Neither of the given integers is infinite.
Parameters
newNumthe new numerator.
newDenthe new denominator.

◆ Rational() [3/6]

template<bool supportInfinity>
regina::Rational::Rational ( const IntegerBase< supportInfinity > &  value)
inline

Initialises to the given integer value.

The given integer may be infinite.

Parameters
valuethe new integer value of this rational.

◆ Rational() [4/6]

regina::Rational::Rational ( const Rational value)
inline

Initialises to the given rational value.

Parameters
valuethe new rational value of this rational.

◆ Rational() [5/6]

regina::Rational::Rational ( long  newNum,
unsigned long  newDen 
)

Initialises to newNum/newDen.

Precondition
gcd(newNum, newDen) = 1 or newDen = 0.
newDen is non-negative.
Warning
Failing to meet the preconditions above can result in misleading or even undefined behaviour. As an example, Rational(4,4) (which breaks the gcd requirement) is considered different from Rational(1,1) (a valid rational), which is different again from Rational(-1,-1) (which breaks the non-negativity requirement).
Parameters
newNumthe new numerator.
newDenthe new denominator.

◆ Rational() [6/6]

regina::Rational::Rational ( long  value)
inline

Initialises to the given integer value.

Parameters
valuethe new integer value of this rational.

◆ rawData() [1/2]

template<bool supportInfinity>
mpz_ptr regina::IntegerBase< supportInfinity >::rawData
inline

Returns the raw GMP data that describes this integer.

This routine allows IntegerBase to interact directly with libgmp and libgmpxx if necessary.

Warning
This routine will have the side-effect of converting this integer to a (bulkier and slower) GMP representation, regardless of whether it is small enough to fit within a native integer. Excessive use of this routine could lead to a significant performance loss. It is best to use this only when isNative() is already known to return false.
Precondition
This integer is not infinite.
Python:\n Not available.
Returns
the raw GMP data.

◆ rawData() [2/2]

template<bool supportInfinity>
mpz_srcptr regina::IntegerBase< supportInfinity >::rawData
inline

Returns the raw GMP data that describes this integer.

This routine allows IntegerBase to interact directly with libgmp and libgmpxx if necessary.

Warning
This routine will have the side-effect of converting this integer to a (bulkier and slower) GMP representation, regardless of whether it is small enough to fit within a native integer. Excessive use of this routine could lead to a significant performance loss. It is best to use this only when isNative() is already known to return false.
Precondition
This integer is not infinite.
Python:\n Not available.
Returns
the raw GMP data.

◆ Ray() [1/2]

regina::Ray::Ray ( const Vector< LargeInteger > &  cloneMe)
inline

Creates a new ray that is a clone of the given ray.

Parameters
cloneMethe ray to clone.

◆ Ray() [2/2]

regina::Ray::Ray ( size_t  length)
inline

Creates a new ray all of whose coordinates are initialised to zero.

Parameters
lengththe number of elements in the new vector.

◆ reducedMod()

long regina::reducedMod ( long  k,
long  modBase 
)

Reduces k modulo modBase to give the smallest possible absolute value.

For instance, reducedMod(4,10) = 4 but reducedMod(6,10) = -4. In the case of a tie, the positive solution is taken.

Precondition
modBase is strictly positive.
Parameters
kthe number to reduce modulo modBase.
modBasethe modular base in which to work.

◆ REGINA_ENABLE_FOR_REGINA_INTEGER() [1/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER ( )
inline

Computes the greatest common divisor of all elements of the given row.

The value returned is guaranteed to be non-negative.

This routine is only available when T is one of Regina's own integer classes (Integer, LargeInteger, or NativeIntgeger).

Precondition
The given row number is between 0 and rows()-1 inclusive.
Parameters
rowthe index of the row whose gcd should be computed.
Returns
the greatest common divisor of all elements of this row.

◆ REGINA_ENABLE_FOR_REGINA_INTEGER() [2/2]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER ( void  )

Divides all elements of the given row by the given integer.

This can only be used when the given integer divides into all row elements exactly (with no remainder). For the Integer class, this may be much faster than ordinary division.

This routine is only available when T is one of Regina's own integer classes (Integer, LargeInteger, or NativeIntgeger).

Precondition
The argument divBy is neither zero nor infinity, and none of the elements of the given row are infinity.
The argument divBy divides exactly into every element of the given row (i.e., it leaves no remainder).
The given row number is between 0 and rows()-1 inclusive.
Parameters
rowthe index of the row whose elements should be divided by divBy.
divBythe integer to divide each row element by.

◆ REGINA_ENABLE_FOR_RING_STATIC()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_RING_STATIC ( Matrix< T, ring >  )
inline

Returns an identity matrix of the given size.

The matrix returned will have size rows and size columns.

This routine is only available when the template argument ring is true.

Parameters
sizethe number of rows and columns of the matrix to build.
Returns
an identity matrix of the given size.

◆ reverse() [1/5]

template<int n>
Perm< n > regina::Perm< n >::reverse
inline

Finds the reverse of this permutation.

Here reverse means that we reverse the images of 0,...,n-1. In other words, if permutation q is the reverse of p, then p[i] == q[n - 1 - i] for all i.

◆ reverse() [2/5]

Perm< 2 > regina::Perm< 2 >::reverse ( ) const
inline

Finds the reverse of this permutation.

Here reverse means that we reverse the images of 0 and 1. In other words, if permutation q is the reverse of p, then p[i] == q[1 - i] for all i.

◆ reverse() [3/5]

Perm< 3 > regina::Perm< 3 >::reverse ( ) const
inline

Finds the reverse of this permutation.

Here reverse means that we reverse the images of 0,1,2. In other words, if permutation q is the reverse of p, then p[i] == q[2 - i] for all i.

◆ reverse() [4/5]

Perm< 4 > regina::Perm< 4 >::reverse ( ) const
inline

Finds the reverse of this permutation.

Here reverse means that we reverse the images of 0,...,3. In other words, if permutation q is the reverse of p, then p[i] == q[3 - i] for all i.

◆ reverse() [5/5]

Perm< 5 > regina::Perm< 5 >::reverse ( ) const
inline

Finds the reverse of this permutation.

Here reverse means that we reverse the images of 0,...,4. In other words, if permutation q is the reverse of p, then p[i] == q[4 - i] for all i.

◆ rowBasis()

unsigned regina::rowBasis ( MatrixInt matrix)

Find a basis for the row space of the given matrix.

This routine will rearrange the rows of the given matrix so that the first rank rows form a basis for the row space (where rank is the rank of the matrix). The rank itself will be returned. No other changes will be made to the matrix aside from swapping rows.

Although this routine takes an integer matrix (and only uses integer operations), we consider the row space to be over the rationals. That is, although we never divide, we act as though we could if we wanted to.

Parameters
matrixthe matrix to examine and rearrange.
Returns
the rank of the given matrix.

◆ rowBasisAndOrthComp()

unsigned regina::rowBasisAndOrthComp ( MatrixInt input,
MatrixInt complement 
)

Finds a basis for the row space of the given matrix, as well as an "incremental" basis for its orthogonal complement.

This routine takes an (r by c) matrix input, as well as a square (c by c) matrix complement, and does the following:

  • The rows of input are rearranged so that the first rank rows form a basis for the row space (where rank is the rank of the matrix). No other changes are made to this matrix aside from swapping rows.
  • The matrix complement is re-filled (any previous contents are thrown away) so that, for any i between 0 and rank-1 inclusive, the final (c - i) rows of complement form a basis for the orthogonal complement of the first i rows of the rearranged input.
  • The rank of the matrix input is returned from this routine.

This routine can help with larger procedures that need to build up a row space and simultaneously cut down the complement one dimension at a time.

Although this routine takes integer matrices (and only uses integer operations), we consider all bases to be over the rationals. That is, although we never divide, we act as though we could if we wanted to.

Precondition
The matrix complement is a square matrix, whose size is equal to the number of columns in input.
Parameters
inputthe input matrix whose row space we will describe; this matrix will be changed (though only by swapping rows).
complementthe square matrix that will be re-filled with the "incremental" basis for the orthogonal complement of input.
Returns
the rank of the given matrix input.

◆ rows()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
unsigned long regina::Matrix< T, ring >::rows ( ) const
inline

Returns the number of rows in this matrix.

Returns
the number of rows.

◆ S2Index()

int regina::Perm< 2 >::S2Index ( ) const
inline

Returns the index of this permutation in the Perm<2>::S2 array.

Returns
the index i for which this permutation is equal to Perm<2>::S2[i]. This will be 0 or 1.

◆ S3Index()

int regina::Perm< 3 >::S3Index ( ) const
inline

Returns the index of this permutation in the Perm<3>::S3 array.

Returns
the index i for which this permutation is equal to Perm<3>::S3[i]. This will be between 0 and 5 inclusive.

◆ S4Index()

int regina::Perm< 4 >::S4Index ( ) const
inline

Returns the index of this permutation in the Perm<4>::S4 array.

Returns
the index i for which this permutation is equal to Perm<4>::S4[i]. This will be between 0 and 23 inclusive.

◆ S5Index()

int regina::Perm< 5 >::S5Index ( ) const

Returns the index of this permutation in the Perm<5>::S5 array.

Returns
the index i for which this permutation is equal to Perm<5>::S5[i]. This will be between 0 and 119 inclusive.
Author
Ryan Budney

◆ scaleDown() [1/2]

void regina::Ray::scaleDown ( )

Scales this vector down by the greatest common divisor of all its elements.

The resulting vector will be the smallest multiple of the original that maintains integral entries, and these entries will have the same signs as the originals.

This routine thus reduces a ray to its smallest possible representation.

This routine poses no problem for vectors containing infinite elements; such elements are simply ignored and left at infinity.

◆ scaleDown() [2/2]

template<typename T >
void regina::Laurent< T >::scaleDown ( long  k)

Divides all exponents in this polynomial by k for some integer k.

This is equivalent to replacing the variable x of the polynomial with x1/k.

Both positive and negative scaling factors k are allowed.

Precondition
k is non-zero.
All exponents in this polynomial with non-zero coefficients are multiples of k.
Parameters
kthe scaling factor to divide exponents by.

◆ scaleUp()

template<typename T >
void regina::Laurent< T >::scaleUp ( long  k)

Multiplies all exponents in this polynomial by k for some integer k.

This is equivalent to replacing the variable x of the polynomial with xk.

Both positive and negative scaling factors k are allowed.

Precondition
k is non-zero.
Parameters
kthe scaling factor to multiply exponents by.

◆ set() [1/3]

template<typename T >
void regina::Laurent< T >::set ( long  exp,
const T &  value 
)

Changes the given coefficient of this polynomial.

There are no restrictions on the exponent exp, and the new coefficient value may be zero.

Note, however, that it is expensive to set a non-zero coefficient whose exponent is larger than maxExp() or smaller than minExp(), since this will typically require deallocating and reallocating the full list of coefficients.

In contrast, setting a zero coefficient for the exponent maxExp() or minExp() is cheap, even though the range of non-zero coefficients changes as a result.

Python:\n This set() routine is available, but you can
also set coefficients directly using syntax of the form p[exp] = value.
Parameters
expthe exponent of the term whose coefficient should be changed.
valuethe new value of this coefficient.

◆ set() [2/3]

template<typename T >
void regina::Laurent2< T >::set ( long  xExp,
long  yExp,
const T &  value 
)

Changes the given coefficient of this polynomial.

There are no restrictions on the exponents xExp and yExp, and the new coefficient value may be zero.

Moreover, the underlying data structures ensure that this operation is cheap regardless of the exponents involved.

Python:\n This set() routine is available, but you can
also set coefficients directly using syntax of the form p[xExp, yExp] = value.
Parameters
xExpthe exponent attached to x.
yExpthe exponent attached to y.
valuethe new value of the corresponding coefficient.

◆ set() [3/3]

template<typename T >
void regina::Polynomial< T >::set ( size_t  exp,
const T &  value 
)

Changes the given coefficient of this polynomial.

It is fine to set the leading coefficient to zero, though note that degree() will now return a smaller value as a result.

It is also fine to set a coefficient whose exponent is larger than the current degree; this time degree() will now return a larger value (unless the given coefficient is zero). Such an operation is expensive, however, since it will require deallocating and reallocating the full list of coefficients.

Python:\n This set() routine is available, but you can
also set coefficients directly using syntax of the form p[exp] = value.
Parameters
expthe exponent of the term whose coefficient should be changed.
valuethe new value of this coefficient.

◆ setElement()

template<class T >
void regina::Vector< T >::setElement ( size_t  index,
const T &  value 
)
inline

Sets the element at the given index in the vector to the given value.

Precondition
index is between 0 and size()-1 inclusive.
Parameters
indexthe vector index to examine.
valuethe new value to assign to the element.

◆ setPermCode() [1/5]

template<int n>
void regina::Perm< n >::setPermCode ( Code  code)
inline

Sets this permutation to that represented by the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
codethe internal code that will determine the new value of this permutation.

◆ setPermCode() [2/5]

void regina::Perm< 2 >::setPermCode ( Code  code)
inline

Sets this permutation to that represented by the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
codethe internal code that will determine the new value of this permutation.

◆ setPermCode() [3/5]

void regina::Perm< 3 >::setPermCode ( Code  code)
inline

Sets this permutation to that represented by the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
codethe internal code that will determine the new value of this permutation.

◆ setPermCode() [4/5]

void regina::Perm< 4 >::setPermCode ( Code  code)
inline

Sets this permutation to that represented by the given first-generation permutation code.

Precondition
the given code is a valid first-generation permutation code; see isPermCode() for details.
Warning
This routine will incur additional overhead, since Perm<4> now uses second-generation codes internally. See the class notes and the routine setPermCode2() for details.
Parameters
codethe first-generation code that will determine the new value of this permutation.

◆ setPermCode() [5/5]

void regina::Perm< 5 >::setPermCode ( Code  newCode)
inline

Sets this permutation to that represented by the given internal code.

Precondition
the given code is a valid permutation code; see isPermCode() for details.
Parameters
newCodethe internal code that will determine the new value of this permutation.

◆ setPermCode2()

void regina::Perm< 4 >::setPermCode2 ( Code  code)
inline

Sets this permutation to that represented by the given second-generation permutation code.

Second-generation codes are fast to work with, since they are used internally by the Perm<4> class.

Precondition
the given code is a valid second-generation permutation code; see isPermCode2() for details.
Parameters
codethe second-generation code that will determine the new value of this permutation.

◆ setRaw()

template<bool supportInfinity>
void regina::IntegerBase< supportInfinity >::setRaw ( mpz_srcptr  fromData)
inline

Set this to a copy of the given raw GMP integer.

This routine allows IntegerBase to interact directly with libgmp and libgmpxx if necessary.

Python:\n Not available.
Parameters
fromDatathe raw GMP integer to clone.

◆ shift()

template<typename T >
void regina::Laurent< T >::shift ( long  s)
inline

Multiplies this polynomial by x^s for some integer s.

Parameters
sthe power of x to multiply by.

◆ sign() [1/7]

template<bool supportInfinity>
int regina::IntegerBase< supportInfinity >::sign
inline

Returns the sign of this integer.

In this routine, infinity is considered to have sign +1.

Returns
+1, -1 or 0 according to whether this integer is positive, negative or zero.

◆ sign() [2/7]

template<int bytes>
int regina::NativeInteger< bytes >::sign
inline

Returns the sign of this integer.

Returns
+1, -1 or 0 according to whether this integer is positive, negative or zero.

◆ sign() [3/7]

template<int n>
int regina::Perm< n >::sign

Determines the sign of this permutation.

Returns
1 if this permutation is even, or -1 if this permutation is odd.

◆ sign() [4/7]

int regina::Perm< 2 >::sign ( ) const
inline

Determines the sign of this permutation.

Returns
1 if this permutation is even, or -1 if this permutation is odd.

◆ sign() [5/7]

int regina::Perm< 3 >::sign ( ) const
inline

Determines the sign of this permutation.

Returns
1 if this permutation is even, or -1 if this permutation is odd.

◆ sign() [6/7]

int regina::Perm< 4 >::sign ( ) const
inline

Determines the sign of this permutation.

Returns
1 if this permutation is even, or -1 if this permutation is odd.

◆ sign() [7/7]

int regina::Perm< 5 >::sign ( ) const

Determines the sign of this permutation.

Returns
1 if this permutation is even, or -1 if this permutation is odd.

◆ simpler() [1/2]

bool regina::simpler ( const Matrix2 m1,
const Matrix2 m2 
)

Determines whether the first given matrix is more aesthetically pleasing than the second.

The way in which this judgement is made is purely aesthetic on the part of the author, and is subject to change in future versions of Regina.

Parameters
m1the first matrix to examine.
m2the second matrix to examine.
Returns
true if m1 is deemed to be more pleasing than m2, or false if either the matrices are equal or m2 is more pleasing than m1.

◆ simpler() [2/2]

bool regina::simpler ( const Matrix2 pair1first,
const Matrix2 pair1second,
const Matrix2 pair2first,
const Matrix2 pair2second 
)

Determines whether the first given pair of matrices is more aesthetically pleasing than the second pair.

The way in which this judgement is made is purely aesthetic on the part of the author, and is subject to change in future versions of Regina.

Note that pairs are ordered, so the pair (M, N) may be more (or perhaps less) pleasing than the pair (N, M).

Parameters
pair1firstthe first matrix of the first pair to examine.
pair1secondthe second matrix of the first pair to examine.
pair2firstthe first matrix of the second pair to examine.
pair2secondthe second matrix of the second pair to examine.
Returns
true if the first pair is deemed to be more pleasing than the second pair, or false if either the ordered pairs are equal or the second pair is more pleasing than the first.

◆ size() [1/2]

unsigned long regina::Primes::size ( )
inlinestatic

Returns the number of primes (or suspected primes) currently stored.

Primes that are already stored can be accessed instantly; primes larger than those currently stored must be generated on the fly (which takes time).

This number may increase as the program runs (according to whether larger primes are requested), but it will never decrease.

Returns
the number of primes or suspected primes currently stored.

◆ size() [2/2]

template<class T >
size_t regina::Vector< T >::size ( ) const
inline

Returns the number of elements in the vector.

Returns
the vector size.

◆ smithNormalForm() [1/2]

void regina::smithNormalForm ( MatrixInt matrix)

Transforms the given integer matrix into Smith normal form.

Note that the given matrix need not be square and need not be of full rank.

Reading down the diagonal, the final Smith normal form will have a series of non-negative, non-decreasing invariant factors followed by zeroes. "Invariant factor" refers to the convention that the ith term divides the (i+1)th term, and so they are unique.

The algorithm used is due to Hafner and McCurley (1991). It does not use modular arithmetic to control the intermediate coefficient explosion.

Parameters
matrixthe matrix to transform.

◆ smithNormalForm() [2/2]

void regina::smithNormalForm ( MatrixInt matrix,
MatrixInt rowSpaceBasis,
MatrixInt rowSpaceBasisInv,
MatrixInt colSpaceBasis,
MatrixInt colSpaceBasisInv 
)

A Smith normal form algorithm that also returns change of basis matrices.

This is a modification of the one-argument smithNormalForm(MatrixInt&). As well as converting the given matrix matrix into Smith normal form, it also returns the appropriate change-of-basis matrices corresponding to all the row and column operations that were performed.

The only input argument is matrix. The four remaining arguments (the change of basis matrices) will be refilled, though they must be constructed with the correct dimensions as seen in the preconditions below. All five arguments are used to return information as follows.

Let M be the initial value of matrix, and let S be the Smith normal form of M. After this routine exits:

  • The argument matrix will contain the Smith normal form S;
  • colSpaceBasis * M * rowSpaceBasis = S;
  • colSpaceBasisInv * S * rowSpaceBasisInv = M;
  • colSpaceBasis * colSpaceBasisInv and rowSpaceBasis * rowSpaceBasisInv are both identity matrices.

Thus, one obtains the Smith normal form the original matrix by multiplying on the left by ColSpaceBasis and on the right by RowSpaceBasis.

Precondition
The matrices rowSpaceBasis and rowSpaceBasisInv that are passed are square, with side length matrix.columns().
The matrices colSpaceBasis and colSpaceBasisInv that are passed are square, with side length matrix.rows().
Parameters
matrixthe original matrix to put into Smith Normal Form (this need not be square). When the algorithm terminates, this matrix is in its Smith Normal Form.
rowSpaceBasisused to return a change of basis matrix (see above for details).
rowSpaceBasisInvused to return the inverse of rowSpaceBasis.
colSpaceBasisused to return a change of basis matrix (see above for details).
colSpaceBasisInvused to return the inverse of colSpaceBasis.
Author
Ryan Budney

◆ SnIndex() [1/4]

int regina::Perm< 2 >::SnIndex ( ) const
inline

Returns the index of this permutation in the Perm<2>::S2 array.

This is a dimension-agnostic alias for S2Index().

Returns
the index i for which this permutation is equal to Perm<2>::S2[i]. This will be 0 or 1.

◆ SnIndex() [2/4]

int regina::Perm< 3 >::SnIndex ( ) const
inline

Returns the index of this permutation in the Perm<3>::S3 array.

This is a dimension-agnostic alias for S3Index().

Returns
the index i for which this permutation is equal to Perm<3>::S3[i]. This will be between 0 and 5 inclusive.

◆ SnIndex() [3/4]

int regina::Perm< 4 >::SnIndex ( ) const
inline

Returns the index of this permutation in the Perm<4>::S4 array.

This is a dimension-agnostic alias for S4Index().

Returns
the index i for which this permutation is equal to Perm<4>::S4[i]. This will be between 0 and 23 inclusive.

◆ SnIndex() [4/4]

int regina::Perm< 5 >::SnIndex ( ) const
inline

Returns the index of this permutation in the Perm<5>::S5 array.

This is a dimension-agnostic alias for S5Index().

Returns
the index i for which this permutation is equal to Perm<5>::S5[i]. This will be between 0 and 119 inclusive.

◆ str() [1/9]

template<int n>
std::string regina::Perm< n >::str

Returns a string representation of this permutation.

The representation will consist of n adjacent digits representing the images of 0,...,n-1 respectively. If n > 10, then lower-case hexadecimal digits will be used.

An example of a string representation for n = 5 is 30421.

Returns
a string representation of this permutation.

◆ str() [2/9]

std::string regina::Perm< 2 >::str ( ) const
inline

Returns a string representation of this permutation.

The representation will consist of two adjacent digits representing the images of 0 and 1 respectively. An example of a string representation is 10.

Returns
a string representation of this permutation.

◆ str() [3/9]

std::string regina::Perm< 3 >::str ( ) const

Returns a string representation of this permutation.

The representation will consist of three adjacent digits representing the images of 0, 1 and 2 respectively. An example of a string representation is 120.

Returns
a string representation of this permutation.

◆ str() [4/9]

std::string regina::Perm< 4 >::str ( ) const

Returns a string representation of this permutation.

The representation will consist of four adjacent digits representing the images of 0, 1, 2 and 3 respectively. An example of a string representation is 1302.

Returns
a string representation of this permutation.

◆ str() [5/9]

std::string regina::Perm< 5 >::str ( ) const

Returns a string representation of this permutation.

The representation will consist of five adjacent digits representing the images of 0, 1, 2, 3 and 4 respectively. An example of a string representation is 30421.

Returns
a string representation of this permutation.

◆ str() [6/9]

std::string regina::Cyclotomic::str ( const char *  variable) const
inline

Returns this field element as a human-readable string, using the given variable name instead of x.

The field element will be written using its rational polynomial representation. The underlying field will not be indicated in the output, since this is often already understood. If required, it can be accessed by calling c.field().

Note
There is also the usual variant of str() which takes no arguments; that variant is inherited from the Output class.
Parameters
variablethe symbol to use for the polynomial variable. This may be null, in which case the default variable x will be used.
Returns
this field element as a human-readable string.

◆ str() [7/9]

template<typename T >
std::string regina::Laurent< T >::str ( const char *  variable) const
inline

Returns this polynomial as a human-readable string, using the given variable name instead of x.

Note
There is also the usual variant of str() which takes no arguments; that variant is inherited from the Output class.
Parameters
variablethe symbol to use for the variable in this polynomial. This may be null, in which case the default variable x will be used.
Returns
this polynomial as a human-readable string.

◆ str() [8/9]

template<typename T >
std::string regina::Polynomial< T >::str ( const char *  variable) const
inline

Returns this polynomial as a human-readable string, using the given variable name instead of x.

Note
There is also the usual variant of str() which takes no arguments; that variant is inherited from the Output class.
Parameters
variablethe symbol to use for the variable in this polynomial. This may be null, in which case the default variable x will be used.
Returns
this polynomial as a human-readable string.

◆ str() [9/9]

template<typename T >
std::string regina::Laurent2< T >::str ( const char *  varX,
const char *  varY = nullptr 
) const
inline

Returns this polynomial as a human-readable string, using the given variable names instead of x and y.

Note
There is also the usual variant of str() which takes no arguments; that variant is inherited from the Output class.
Parameters
varXthe symbol to use for the variable x. This may be null, in which case the default symbol 'x' will be used.
varYthe symbol to use for the variable y. This may be null, in which case the default symbol 'y' will be used.
Returns
this polynomial as a human-readable string.

◆ stringValue()

template<bool supportInfinity = false>
std::string regina::IntegerBase< supportInfinity >::stringValue ( int  base = 10) const

Returns the value of this integer as a string in the given base.

If not specified, the base defaults to 10.

If this integer is infinity, the string returned will be inf.

Precondition
The given base is between 2 and 36 inclusive.
Returns
the value of this integer as a newly allocated string.

◆ subtractCopies()

template<class T >
void regina::Vector< T >::subtractCopies ( const Vector< T > &  other,
const T &  multiple 
)
inline

Subtracts the given multiple of the given vector to this vector.

This behaves correctly in the case where other is this.

Precondition
This and the given vector have the same size.
Parameters
otherthe vector a multiple of which will be subtracted from this vector.
multiplethe multiple of other to be subtracted from this vector.

◆ swap() [1/6]

template<bool supportInfinity = false>
void regina::IntegerBase< supportInfinity >::swap ( IntegerBase< supportInfinity > &  other)

Swaps the values of this and the given integer.

Parameters
otherthe integer whose value will be swapped with this.

◆ swap() [2/6]

template<typename T >
void regina::Laurent2< T >::swap ( Laurent2< T > &  other)
inline

Swaps the contents of this and the given polynomial.

This is a fast (constant time) operation.

This and the given polynomial need not have the same range of non-zero coefficients.

Parameters
otherthe polynomial whose contents should be swapped with this.

◆ swap() [3/6]

template<typename T >
void regina::Laurent< T >::swap ( Laurent< T > &  other)
inline

Swaps the contents of this and the given polynomial.

This is a fast (constant time) operation.

This and the given polynomial do not need to have the same minimum and/or maximum exponents.

Parameters
otherthe polynomial whose contents should be swapped with this.

◆ swap() [4/6]

template<int bytes>
void regina::NativeInteger< bytes >::swap ( NativeInteger< bytes > &  other)
inline

Swaps the values of this and the given integer.

Parameters
otherthe integer whose value will be swapped with this.

◆ swap() [5/6]

template<typename T >
void regina::Polynomial< T >::swap ( Polynomial< T > &  other)
inline

Swaps the contents of this and the given polynomial.

This is a fast (constant time) operation.

This and the given polynomial do not need to have the same degree.

Parameters
otherthe polynomial whose contents should be swapped with this.

◆ swap() [6/6]

void regina::Rational::swap ( Rational other)
inline

Swaps the values of this and the given rational.

Parameters
otherthe rational whose value will be swapped with this.

◆ swapColumns()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::swapColumns ( unsigned long  first,
unsigned long  second 
)
inline

Swaps the elements of the two given columns in the matrix.

Precondition
The two given columns are between 0 and columns()-1 inclusive.
Parameters
firstthe first column to swap.
secondthe second column to swap.

◆ swapRows()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::swapRows ( unsigned long  first,
unsigned long  second 
)
inline

Swaps the elements of the two given rows in the matrix.

Precondition
The two given rows are between 0 and rows()-1 inclusive.
Parameters
firstthe first row to swap.
secondthe second row to swap.

◆ TeX()

std::string regina::Rational::TeX ( ) const

Returns this rational as written using TeX formatting.

No leading or trailing dollar signs will be included.

Returns
this rational as written using TeX formatting.
Author
Ryan Budney

◆ torsionAutInverse()

std::unique_ptr<MatrixInt> regina::torsionAutInverse ( const MatrixInt input,
const std::vector< Integer > &  invF 
)

Given an automorphism of an abelian group, this procedure computes the inverse automorphism.

The abelian group is of the form Z_p1 + Z_p2 + ... + Z_pn. The input is an n-by-n matrix A which represents a lift of the automorphism to just some n-by-n matrix. Specifically, you have a little commutative diagram with Z^n –A--> Z^n covering the automorphism of Z_p1 + Z_p2 + ... + Z_pn, where the maps down are the direct sum of the standard quotients Z --> Z_pi. So if you want this procedure to give you meaningful output, A must be a lift of a genuine automorphism of Z_p1 + ... + Z_pn.

Precondition
The list p1, p2, ..., pn is a list of invariant factors, which means that p1|p2, ..., p{n-1}|pn.
Python:\n The argument invF should be supplied as a python list.
Parameters
inputthe n-by-n matrix A, which must be a lift of a genuine automorphism as described above.
invFthe list p1, p2, ..., pn.
Returns
the inverse automorphism, also described as an n-by-n matrix as per the discussion above.
Author
Ryan Budney

◆ transpose()

Matrix2 regina::Matrix2::transpose ( ) const
inline

Returns the transpose of this matrix.

This matrix is not changed.

Returns
the transpose of this matrix.

◆ trunc() [1/5]

template<int n>
std::string regina::Perm< n >::trunc ( unsigned  len) const

Returns a prefix of the string representation of this permutation, containing only the images of the first len integers.

Parameters
lenthe length of the prefix required; this must be between 0 and n inclusive.
Returns
the corresponding prefix of the string representation of this permutation.

◆ trunc() [2/5]

std::string regina::Perm< 2 >::trunc ( unsigned  len) const
inline

Returns a prefix of the string representation of this permutation, containing only the images of the first len integers.

Parameters
lenthe length of the prefix required; this must be between 0 and 2 inclusive.
Returns
the corresponding prefix of the string representation of this permutation.

◆ trunc() [3/5]

std::string regina::Perm< 3 >::trunc ( unsigned  len) const

Returns a prefix of the string representation of this permutation, containing only the images of the first len integers.

Parameters
lenthe length of the prefix required; this must be between 0 and 3 inclusive.
Returns
the corresponding prefix of the string representation of this permutation.

◆ trunc() [4/5]

std::string regina::Perm< 4 >::trunc ( unsigned  len) const

Returns a prefix of the string representation of this permutation, containing only the images of the first len integers.

Parameters
lenthe length of the prefix required; this must be between 0 and 4 inclusive.
Returns
the corresponding prefix of the string representation of this permutation.

◆ trunc() [5/5]

std::string regina::Perm< 5 >::trunc ( unsigned  len) const

Returns a prefix of the string representation of this permutation, containing only the images of the first len integers.

Parameters
lenthe length of the prefix required; this must be between 0 and 5 inclusive.
Returns
the corresponding prefix of the string representation of this permutation.

◆ trunc2() [1/3]

std::string regina::Perm< 3 >::trunc2 ( ) const

Returns a string representation of this permutation with only the images of 0 and 1.

The resulting string will therefore have length two.

Returns
a truncated string representation of this permutation.

◆ trunc2() [2/3]

std::string regina::Perm< 4 >::trunc2 ( ) const

Returns a string representation of this permutation with only the images of 0 and 1.

The resulting string will therefore have length two.

Returns
a truncated string representation of this permutation.

◆ trunc2() [3/3]

std::string regina::Perm< 5 >::trunc2 ( ) const

Returns a string representation of this permutation with only the images of 0 and 1.

The resulting string will therefore have length two.

Returns
a truncated string representation of this permutation.

◆ trunc3() [1/2]

std::string regina::Perm< 4 >::trunc3 ( ) const

Returns a string representation of this permutation with only the images of 0, 1 and 2 included.

The resulting string will therefore have length three.

Returns
a truncated string representation of this permutation.

◆ trunc3() [2/2]

std::string regina::Perm< 5 >::trunc3 ( ) const

Returns a string representation of this permutation with only the images of 0, 1 and 2.

The resulting string will therefore have length three.

Returns
a truncated string representation of this permutation.

◆ trunc4()

std::string regina::Perm< 5 >::trunc4 ( ) const

Returns a string representation of this permutation with only the images of 0, 1, 2 and 3.

The resulting string will therefore have length four.

Returns
a truncated string representation of this permutation.

◆ tryReduce()

template<bool supportInfinity>
void regina::IntegerBase< supportInfinity >::tryReduce
inline

Converts this integer to use a native C/C++ long representation, if this is possible.

However, if this integer is outside the range of a C/C++ long, then it will remain as a GMP large integer instead (i.e., nothing will change). Whatever happens, the contents of this integer will be preserved.

It does not matter which kind of representation this integer is currently using.

Precondition
This integer is not infinite.

◆ utf8() [1/4]

std::string regina::Cyclotomic::utf8 ( const char *  variable) const
inline

Returns this field element as a human-readable string using unicode characters, using the given variable name instead of x.

The field element will be written using its rational polynomial representation. The underlying field will not be indicated in the output, since this is often already understood. If required, it can be accessed by calling c.field().

This is similar to the output from str(), except that it uses unicode characters to make the output more pleasant to read. In particular, it makes use of superscript digits for exponents.

The string is encoded in UTF-8.

Note
There is also the usual variant of utf8() which takes no arguments; that variant is inherited from the Output class.
Parameters
variablethe symbol to use for the polynomial variable. This may be null, in which case the default variable x will be used.
Returns
this field element as a unicode-enabled human-readable string.

◆ utf8() [2/4]

template<typename T >
std::string regina::Laurent< T >::utf8 ( const char *  variable) const
inline

Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x.

This is similar to the output from str(), except that it uses unicode characters to make the output more pleasant to read. In particular, it makes use of superscript digits for exponents and a wider minus sign.

The string is encoded in UTF-8.

Note
There is also the usual variant of utf8() which takes no arguments; that variant is inherited from the Output class.
Parameters
variablethe symbol to use for the variable in this polynomial. This may be null, in which case the default variable x will be used.
Returns
this polynomial as a unicode-enabled human-readable string.

◆ utf8() [3/4]

template<typename T >
std::string regina::Polynomial< T >::utf8 ( const char *  variable) const
inline

Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x.

This is similar to the output from str(), except that it uses unicode characters to make the output more pleasant to read. In particular, it makes use of superscript digits for exponents.

The string is encoded in UTF-8.

Note
There is also the usual variant of utf8() which takes no arguments; that variant is inherited from the Output class.
Parameters
variablethe symbol to use for the variable in this polynomial. This may be null, in which case the default variable x will be used.
Returns
this polynomial as a unicode-enabled human-readable string.

◆ utf8() [4/4]

template<typename T >
std::string regina::Laurent2< T >::utf8 ( const char *  varX,
const char *  varY = nullptr 
) const
inline

Returns this polynomial as a human-readable string using unicode characters, using the given variable names instead of x and y.

This is similar to the output from str(), except that it uses unicode characters to make the output more pleasant to read. In particular, it makes use of superscript digits for exponents and a wider minus sign.

The string is encoded in UTF-8.

Note
There is also the usual variant of utf8() which takes no arguments; that variant is inherited from the Output class.
Parameters
varXthe symbol to use for the variable x. This may be null, in which case the default symbol 'x' will be used.
varYthe symbol to use for the variable y. This may be null, in which case the default symbol 'y' will be used.
Returns
this polynomial as a unicode-enabled human-readable string.

◆ Vector() [1/3]

template<class T >
regina::Vector< T >::Vector ( const Vector< T > &  cloneMe)
inline

Creates a new vector that is a clone of the given vector.

Parameters
cloneMethe vector to clone.

◆ Vector() [2/3]

template<class T >
regina::Vector< T >::Vector ( size_t  newVectorSize)
inline

Creates a new vector.

Its elements will not be initialised.

Parameters
newVectorSizethe number of elements in the new vector; this must be strictly positive.

◆ Vector() [3/3]

template<class T >
regina::Vector< T >::Vector ( size_t  newVectorSize,
const T &  initValue 
)
inline

Creates a new vector and initialises every element to the given value.

Parameters
newVectorSizethe number of elements in the new vector; this must be strictly positive.
initValuethe value to assign to every element of the vector.

◆ writeMatrix()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::writeMatrix ( std::ostream &  out) const
inline

Writes a complete representation of the matrix to the given output stream.

Each row will be written on a separate line with elements in each row separated by single spaces.

Python:\n Not present, even if a subclass of Matrix
is mirrored and its inherited routines are mirrored also.
Parameters
outthe output stream to which to write.

◆ writeTeX()

std::ostream& regina::Rational::writeTeX ( std::ostream &  out) const

Writes this rational in TeX format to the given output stream.

No leading or trailing dollar signs will be included.

Python:\n The parameter out does not exist; instead
standard output will always be used. Moreover, this routine returns None.
Parameters
outthe output stream to which to write.
Returns
a reference to the given output stream.
Author
Ryan Budney

◆ writeTextLong()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::writeTextLong ( std::ostream &  out) const
inline

Writes a detailed text representation of this object to the given output stream.

Python:\n Not present.
Parameters
outthe output stream to which to write.

◆ writeTextShort() [1/5]

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
void regina::Matrix< T, ring >::writeTextShort ( std::ostream &  out) const
inline

Writes a short text representation of this object to the given output stream.

Python:\n Not present.
Parameters
outthe output stream to which to write.

◆ writeTextShort() [2/5]

template<typename T >
void regina::Polynomial< T >::writeTextShort ( std::ostream &  out,
bool  utf8 = false,
const char *  variable = 0 
) const

Writes this polynomial to the given output stream, using the given variable name instead of x.

If utf8 is passed as true then unicode superscript characters will be used for exponents; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.

Python:\n Not present.
Parameters
outthe output stream to which to write.
utf8true if unicode superscript characters may be used.
variablethe symbol to use for the variable in this polynomial. This may be null, in which case the default variable x will be used.

◆ writeTextShort() [3/5]

void regina::Cyclotomic::writeTextShort ( std::ostream &  out,
bool  utf8 = false,
const char *  variable = nullptr 
) const

Writes this field element to the given output stream, using the given variable name instead of x.

The field element will be written using its rational polynomial representation. The underlying field will not be indicated in the output, since this is often already understood. If required, it can be accessed by calling c.field().

If utf8 is passed as true then unicode superscript characters will be used for exponents; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.

Python:\n Not present.
Parameters
outthe output stream to which to write.
utf8true if unicode superscript characters may be used.
variablethe symbol to use for the polynomial variable. This may be null, in which case the default variable x will be used.

◆ writeTextShort() [4/5]

template<typename T >
void regina::Laurent< T >::writeTextShort ( std::ostream &  out,
bool  utf8 = false,
const char *  variable = nullptr 
) const

Writes this polynomial to the given output stream, using the given variable name instead of x.

If utf8 is passed as true then unicode superscript characters will be used for exponents and the minus sign; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.

Python:\n Not present.
Parameters
outthe output stream to which to write.
utf8true if unicode characters may be used.
variablethe symbol to use for the variable in this polynomial. This may be null, in which case the default variable x will be used.
Returns
a reference to the given output stream.

◆ writeTextShort() [5/5]

template<typename T >
void regina::Laurent2< T >::writeTextShort ( std::ostream &  out,
bool  utf8 = false,
const char *  varX = nullptr,
const char *  varY = nullptr 
) const

Writes this polynomial to the given output stream, using the given variable names instead of x and y.

If utf8 is passed as true then unicode superscript characters will be used for exponents and the minus sign; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.

Python:\n Not present.
Parameters
outthe output stream to which to write.
utf8true if unicode characters may be used.
varXthe symbol to use for the variable x. This may be null, in which case the default symbol 'x' will be used.
varYthe symbol to use for the variable y. This may be null, in which case the default symbol 'y' will be used.
Returns
a reference to the given output stream.

◆ ~Cyclotomic()

regina::Cyclotomic::~Cyclotomic ( )
inline

Destroys this field element.

This is safe even if the field element was never initialised.

◆ ~IntegerBase()

template<bool supportInfinity>
regina::IntegerBase< supportInfinity >::~IntegerBase
inline

Destroys this integer.

◆ ~Laurent()

template<typename T >
regina::Laurent< T >::~Laurent
inline

Destroys this polynomial.

◆ ~Matrix()

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
regina::Matrix< T, ring >::~Matrix ( )
inline

Destroys this matrix.

◆ ~Polynomial()

template<typename T >
regina::Polynomial< T >::~Polynomial
inline

Destroys this polynomial.

◆ ~Rational()

regina::Rational::~Rational ( )
inline

Destroys this rational.

◆ ~Vector()

template<class T >
regina::Vector< T >::~Vector ( )
inline

Destroys this vector.

Variable Documentation

◆ binomSmall_

const int* const regina::detail::binomSmall_[17]
extern

A lookup table that stores (n choose k) for all n16.

For all values 0 ≤ kn ≤ 16, the value binomSmall_[n][k] is the binomial coefficient (n choose k).

This array is used in the implementation of the function binomSmall(). End users should call binomSmall() instead of referring to this array directly.

◆ divBy

template<class T , bool ring = ((std::is_integral<T>::value && ! std::is_same<T, bool>::value) || IsReginaInteger<T>::value || std::is_same<T, Rational>::value)>
const T & regina::Matrix< T, ring >::divBy
Initial value:
{
for (T* x = this->data_[row]; x != this->data_[row] + cols_; ++x)
x->divByExact(divBy)

◆ elements

template<class T >
T* regina::Vector< T >::elements
protected

The internal array containing all vector elements.

◆ end

template<class T >
T* regina::Vector< T >::end
protected

A pointer just beyond the end of the internal array.

The size of the vector can be computed as (end - elements).

◆ epsilon

const double regina::epsilon
extern

Deprecated constant for managing floating-point roundoff errors.

A very small positive real designed to accommodate for rounding error. Any two numbers within epsilon of each other are considered to be equal by the generic zero-testing and sign-testing routines defined in this file (isZero(), isPositive(), isNonNegative() and so on).

Deprecated:
This method of using a hard-coded epsilon is very blunt. Currently Regina does not provide alternative methods for managing round-off error, though since Regina's computations are exact, this should not be necessary.
Python:\n Not present.

◆ imageBits [1/2]

template<int n>
constexpr int regina::Perm< n >::imageBits = regina::bitsRequired(n)
staticconstexpr

Indicates the number of bits used by the permutation code to store the image of a single integer.

This constant refers to the "image packing" codes that are used for n ≥ 5, as described in the Perm class notes. For n ≤ 4 the permutation codes are constructed in a different way, and so this constant is not present.

The full permutation code packs n such images together, and so uses n * imageBits bits in total.

◆ imageBits [2/2]

const int regina::Perm< 5 >::imageBits = 3
static

Indicates the number of bits used by the permutation code to store the image of a single integer.

The full permutation code packs 5 such images together, and so uses 5 * imageBits bits in total.

◆ infinity [1/2]

template<bool supportInfinity = false>
const IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::infinity
static

Globally available infinity.

This is only defined if supportInfinity is true. Any attempt to use it when supportInfinity is false should generate a linker error.

◆ infinity [2/2]

const Rational regina::Rational::infinity
static

Globally available infinity.

Note that both 1/0 and -1/0 evaluate to this same rational. When queried, the representation 1/0 will be returned.

◆ invS2

const unsigned regina::Perm< 2 >::invS2[2]
static

Contains the inverses of the permutations in the array S2.

Specifically, the inverse of permutation S2[i] is the permutation S2[ invS2[i] ].

This array is provided for consistency with larger permutation classes; of course, for permutations of two elements, the inverse of p is always p itself.

◆ invS3

const unsigned regina::Perm< 3 >::invS3[6]
static

Contains the inverses of the permutations in the array S3.

Specifically, the inverse of permutation S3[i] is the permutation S3[ invS3[i] ].

◆ invS4

const unsigned regina::Perm< 4 >::invS4[24]
static

Contains the inverses of the permutations in the array S4.

Specifically, the inverse of permutation S4[i] is the permutation S4[ invS4[i] ].

◆ invS5

const unsigned regina::Perm< 5 >::invS5[120]
static

Contains the inverses of the permutations in the array S5.

Specifically, the inverse of permutation S5[i] is the permutation S5[ invS5[i] ].

◆ invSn [1/4]

const unsigned* regina::Perm< 2 >::invSn
static

A dimension-agnostic alias for Perm<2>::invS2.

In general, for each K the class PermK will define an alias invSn that references the list of all permutations PermK::invSK.

◆ invSn [2/4]

const unsigned* regina::Perm< 3 >::invSn
static

A dimension-agnostic alias for Perm<3>::invS3.

In general, for each K the class PermK will define an alias invSn that references the list of all permutations PermK::invSK.

◆ invSn [3/4]

const unsigned* regina::Perm< 4 >::invSn
static

A dimension-agnostic alias for Perm<4>::invS4.

In general, for each K the class PermK will define an alias invSn that references the list of all permutations PermK::invSK.

◆ invSn [4/4]

const unsigned* regina::Perm< 5 >::invSn
static

A dimension-agnostic alias for Perm<5>::invS5.

In general, for each K the class PermK will define an alias invSn that references the list of all permutations PermK::invSK.

◆ minusOne

template<class T >
T regina::Vector< T >::minusOne
static

Negative one in the underlying number system.

This would be const if it weren't for the fact that some compilers don't like this. It should never be modified!

◆ nPerms [1/5]

template<int n>
constexpr Perm< n >::Index regina::Perm< n >::nPerms = factorial(n)
staticconstexpr

The total number of permutations on n elements.

This is the size of the symmetric group Sn.

◆ nPerms [2/5]

const Index regina::Perm< 2 >::nPerms = 2
static

The total number of permutations on two elements.

This is the size of the array Sn.

◆ nPerms [3/5]

const Index regina::Perm< 3 >::nPerms = 6
static

The total number of permutations on three elements.

This is the size of the array Sn.

◆ nPerms [4/5]

const Index regina::Perm< 4 >::nPerms = 24
static

The total number of permutations on four elements.

This is the size of the array Sn.

◆ nPerms [5/5]

const Index regina::Perm< 5 >::nPerms = 120
static

The total number of permutations on five elements.

This is the size of the array Sn.

◆ nPerms_1 [1/5]

template<int n>
constexpr Perm< n >::Index regina::Perm< n >::nPerms_1 = factorial(n-1)
staticconstexpr

The total number of permutations on n-1 elements.

This is the size of the symmetric group Sn-1.

◆ nPerms_1 [2/5]

const Index regina::Perm< 2 >::nPerms_1 = 1
static

The total number of permutations on one element.

This is the size of the array Sn_1.

◆ nPerms_1 [3/5]

const Index regina::Perm< 3 >::nPerms_1 = 2
static

The total number of permutations on two elements.

This is the size of the array Sn_1.

◆ nPerms_1 [4/5]

const Index regina::Perm< 4 >::nPerms_1 = 6
static

The total number of permutations on three elements.

This is the size of the array Sn_1.

◆ nPerms_1 [5/5]

const Index regina::Perm< 5 >::nPerms_1 = 24
static

The total number of permutations on four elements.

This is the size of the array Sn_1.

◆ one [1/4]

template<bool supportInfinity = false>
const IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::one
static

Globally available one.

◆ one [2/4]

template<typename T , bool ring>
const T regina::MatrixRingIdentities< T, ring >::one
static

The multiplicative identity in the underlying ring.

◆ one [3/4]

const Rational regina::Rational::one
static

Globally available one.

◆ one [4/4]

template<class T >
T regina::Vector< T >::one
static

One in the underlying number system.

This would be const if it weren't for the fact that some compilers don't like this. It should never be modified!

◆ orderedS2

const Perm<2>* regina::Perm< 2 >::orderedS2
static

Contains all possible permutations of two elements in lexicographical order.

This is identical to the array Perm<2>::S2, and in fact orderedS2 and S2 are pointers to the same array in memory. Note however that for n ≥ 3, the arrays Perm<n>::Sn and Perm<n>::orderedSn are different: Sn alternates between even and odd permutations, and orderedSn stores permutations in lexicograpical order.

◆ orderedS3 [1/3]

const Perm<3> regina::Perm< 3 >::orderedS3[6]
static

Contains all possible permutations of three elements in lexicographical order.

◆ orderedS3 [2/3]

const Perm<4> regina::Perm< 4 >::orderedS3[6]
static

Contains all possible permutations of three elements in lexicographical order.

In each permutation, 3 maps to 3.

◆ orderedS3 [3/3]

const Perm<5> regina::Perm< 5 >::orderedS3[6]
static

Contains all possible permutations of three elements in lexicographical order.

In each permutation, 3 maps to 3 and 4 maps to 4.

◆ orderedS4 [1/2]

const Perm<4> regina::Perm< 4 >::orderedS4[24]
static

Contains all possible permutations of four elements in lexicographical order.

◆ orderedS4 [2/2]

const Perm<5> regina::Perm< 5 >::orderedS4[24]
static

Contains all possible permutations of four elements in lexicographical order.

In each permutation, 4 maps to 4.

◆ orderedS5

const Perm<5> regina::Perm< 5 >::orderedS5[120]
static

Contains all possible permutations of five elements in lexicographical order.

◆ orderedSn [1/4]

const Perm<2>* regina::Perm< 2 >::orderedSn
static

A dimension-agnostic alias for Perm<2>::orderedS2.

In general, for each K the class PermK will define an alias orderedSn that references the list of all permutations PermK::orderedSK.

◆ orderedSn [2/4]

const Perm<3>* regina::Perm< 3 >::orderedSn
static

A dimension-agnostic alias for Perm<3>::orderedS3.

In general, for each K the class PermK will define an alias orderedSn that references the list of all permutations PermK::orderedSK.

◆ orderedSn [3/4]

const Perm<4>* regina::Perm< 4 >::orderedSn
static

A dimension-agnostic alias for Perm<4>::orderedS4.

In general, for each K the class PermK will define an alias orderedSn that references the list of all permutations PermK::orderedSK.

◆ orderedSn [4/4]

const Perm<5>* regina::Perm< 5 >::orderedSn
static

A dimension-agnostic alias for Perm<5>::orderedS5.

In general, for each K the class PermK will define an alias orderedSn that references the list of all permutations PermK::orderedSK.

◆ S1

const Perm<2>* regina::Perm< 2 >::S1
static

Contains all possible permutations of one element.

In each permutation, 1 maps to 1.

Of course, this array is trivial: it contains just the identity permutation. This array is provided for consistency with larger permutation classes Perm<n>.

Note that, as an implementation detail, the arrays S1 and S2 point to the same location in memory (however, they are treated as arrays of different lengths).

◆ S2 [1/4]

const Perm<2> regina::Perm< 2 >::S2[2]
static

Contains all possible permutations of two elements.

The identity permutation has index 0, and the non-identity permutation has index 1. As a result, S2[i] is an even permutation if and only if i is even.

For all permutation classes (Perm<2>, Perm<3> and so on), the S2 array stores the same permutations in the same order (but of course using different data types).

◆ S2 [2/4]

const Perm<3> regina::Perm< 3 >::S2[2]
static

Contains all possible permutations of two elements.

In each permutation, 2 maps to 2.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<3>, Perm<4> and so on), the S2 array stores the same permutations in the same order (but of course using different data types).

Note that these permutations are already in lexicographical order.

◆ S2 [3/4]

const Perm<4> regina::Perm< 4 >::S2[2]
static

Contains all possible permutations of two elements.

In each permutation, 2 maps to 2 and 3 maps to 3.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<4>, Perm<5> and so on), the S2 array stores the same permutations in the same order (but of course using different data types).

Note that these permutations are already in lexicographical order.

◆ S2 [4/4]

const Perm<5> regina::Perm< 5 >::S2[2]
static

Contains all possible permutations of two elements.

In each permutation, 2 maps to 2, 3 maps to 3, and 4 maps to 4.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<4>, Perm<5> and so on), the S2 array stores the same permutations in the same order (but of course using different data types).

Note that these permutations are already in lexicographical order.

◆ S3 [1/3]

const Perm<3> regina::Perm< 3 >::S3[6]
static

Contains all possible permutations of three elements.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<3>, Perm<4> and so on), the S3 array stores the same permutations in the same order (but of course using different data types).

Note that these permutations are not necessarily in lexicographical order.

◆ S3 [2/3]

const Perm<4> regina::Perm< 4 >::S3[6]
static

Contains all possible permutations of three elements.

In each permutation, 3 maps to 3.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<4>, Perm<5> and so on), the S3 array stores the same permutations in the same order (but of course using different data types).

Note that the permutations are not necessarily in lexicographical order. For the corresponding inverse array, see Perm<3>::invS3.

◆ S3 [3/3]

const Perm<5> regina::Perm< 5 >::S3[6]
static

Contains all possible permutations of three elements.

In each permutation, 3 maps to 3 and 4 maps to 4.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<4>, Perm<5> and so on), the S3 array stores the same permutations in the same order (but of course using different data types).

Note that the permutations are not necessarily in lexicographical order. For the corresponding inverse array, see Perm<3>::invS3.

◆ S4 [1/2]

const Perm<4> regina::Perm< 4 >::S4[24]
static

Contains all possible permutations of four elements.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<4>, Perm<5> and so on), the S4 array stores the same permutations in the same order (but of course using different data types).

Note that the permutations are not necessarily in lexicographical order.

◆ S4 [2/2]

const Perm<5> regina::Perm< 5 >::S4[24]
static

Contains all possible permutations of four elements.

In each permutation, 4 maps to 4.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

For all permutation classes (Perm<4>, Perm<5> and so on), the S4 array stores the same permutations in the same order (but of course using different data types).

Note that the permutations are not necessarily in lexicographical order. For the corresponding inverse array, see Perm<4>::invS4.

◆ S5

const Perm<5> regina::Perm< 5 >::S5[120]
static

Contains all possible permutations of five elements.

The permutations with even indices in the array are the even permutations, and those with odd indices in the array are the odd permutations.

Note that the permutations are not necessarily in lexicographical order.

◆ Sn [1/4]

const Perm<2>* regina::Perm< 2 >::Sn
static

A dimension-agnostic alias for Perm<2>::S2.

In general, for each K the class PermK will define an alias Sn that references the list of all permutations PermK::SK.

◆ Sn [2/4]

const Perm<3>* regina::Perm< 3 >::Sn
static

A dimension-agnostic alias for Perm<3>::S3.

In general, for each K the class PermK will define an alias Sn that references the list of all permutations PermK::SK.

◆ Sn [3/4]

const Perm<4>* regina::Perm< 4 >::Sn
static

A dimension-agnostic alias for Perm<4>::S4.

In general, for each K the class PermK will define an alias Sn that references the list of all permutations PermK::SK.

◆ Sn [4/4]

const Perm<5>* regina::Perm< 5 >::Sn
static

A dimension-agnostic alias for Perm<5>::S5.

In general, for each K the class PermK will define an alias Sn that references the list of all permutations PermK::SK.

◆ Sn_1 [1/4]

const Perm<2>* regina::Perm< 2 >::Sn_1
static

A dimension-agnostic alias for Perm<2>::S1.

In general, for each K the class PermK will define an alias Sn_1 that references the list of all permutations PermK::S(K-1).

◆ Sn_1 [2/4]

const Perm<3>* regina::Perm< 3 >::Sn_1
static

A dimension-agnostic alias for Perm<3>::S2.

In general, for each K the class PermK will define an alias Sn_1 that references the list of all permutations PermK::S(K-1).

◆ Sn_1 [3/4]

const Perm<4>* regina::Perm< 4 >::Sn_1
static

A dimension-agnostic alias for Perm<4>::S3.

In general, for each K the class PermK will define an alias Sn_1 that references the list of all permutations PermK::S(K-1).

◆ Sn_1 [4/4]

const Perm<5>* regina::Perm< 5 >::Sn_1
static

A dimension-agnostic alias for Perm<5>::S4.

In general, for each K the class PermK will define an alias Sn_1 that references the list of all permutations PermK::S(K-1).

◆ undefined

const Rational regina::Rational::undefined
static

Globally available undefined.

This is represented as 0/0.

◆ zero [1/4]

template<bool supportInfinity = false>
const IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::zero
static

Globally available zero.

◆ zero [2/4]

template<typename T , bool ring>
const T regina::MatrixRingIdentities< T, ring >::zero
static

The additive identity in the underlying ring.

◆ zero [3/4]

const Rational regina::Rational::zero
static

Globally available zero.

◆ zero [4/4]

template<class T >
T regina::Vector< T >::zero
static

Zero in the underlying number system.

This would be const if it weren't for the fact that some compilers don't like this. It should never be modified!

Friends

◆ operator*

Cyclotomic operator* ( const Cyclotomic ,
const Cyclotomic  
)
friend

Multiplies the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to multiply.
rhsthe second field element to multiply.
Returns
the product of both field elements.

◆ operator+

Cyclotomic operator+ ( const Cyclotomic lhs,
const Cyclotomic rhs 
)
friend

Adds the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe first field element to add.
rhsthe second field element to add.
Returns
the sum of both field elements.

◆ operator-

Cyclotomic operator- ( const Cyclotomic lhs,
const Cyclotomic rhs 
)
friend

Subtracts the two given cyclotomic field elements.

Precondition
Both arguments belong to the same cyclotomic field.
Parameters
lhsthe field element to subtract from.
rhsthe field element to subtract.
Returns
the first field element minus the second.

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const Matrix2 mat 
)
friend

Writes the given matrix to the given output stream.

The matrix will be written entirely on a single line, with the first row followed by the second row.

Parameters
outthe output stream to which to write.
matthe matrix to write.
Returns
a reference to out.

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  out,
const Rational rat 
)
friend

Writes the given rational to the given output stream.

Infinity will be written as Inf. Undefined will be written as Undef. A rational with denominator one will be written as a single integer. All other rationals will be written in the form r/s.

Parameters
outthe output stream to which to write.
ratthe rational to write.
Returns
a reference to out.

Copyright © 1999-2020, 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).