Mathematical Support

## 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::Matrix< T >
| Represents a matrix of elements of the given type T. More...
class | regina::MatrixRing< T >
| Represents a matrix of elements from a given ring T. More...
class | regina::MatrixIntDomain< T >
| Represents a matrix of elements from a given integral domain 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 whose coordinates are rational. 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 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...
template<class T >
using | regina::NMatrix = Matrix< T >
| Deprecated typedef for backward compatibility. More...
template<class T >
using | regina::NMatrixRing = MatrixRing< T >
| 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...
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...
| 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 ()
| 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 Rational & | regina::Cyclotomic::operator[] (size_t exp) const
| Returns an individual rational coefficient of the polynomial representation of this field element. More...
Rational & | regina::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...
Cyclotomic & | regina::Cyclotomic::operator= (const Cyclotomic &value)
| Sets this to a copy of the given field element. More...
Cyclotomic & | regina::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::operator*= (const Rational &scalar)
| Multiplies this field element by the given rational. More...
Cyclotomic & | regina::Cyclotomic::operator/= (const Rational &scalar)
| Divides this field element by the given rational. More...
Cyclotomic & | regina::Cyclotomic::operator+= (const Cyclotomic &other)
| Adds the given field element to this. More...
Cyclotomic & | regina::Cyclotomic::operator-= (const Cyclotomic &other)
| Subtracts the given field element from this. More...
Cyclotomic & | regina::Cyclotomic::operator*= (const Cyclotomic &other)
| Multiplies this by the given field element. More...
Cyclotomic & | regina::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=0) 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...
| 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 (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=0)
| 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=0)
| 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...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator= (const IntegerBase &value)
| Sets this integer to the given value. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator= (const IntegerBase<! supportInfinity > &value)
| Sets this integer to the given value. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator= (int value)
| Sets this integer to the given value. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator= (unsigned value)
| Sets this integer to the given value. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator= (long value)
| Sets this integer to the given value. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator= (unsigned long value)
| Sets this integer to the given value. More...
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. More...
IntegerBase & | regina::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...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator++ ()
| The preincrement operator. More...
IntegerBase | regina::IntegerBase< supportInfinity >::operator++ (int)
| The postincrement operator. More...
IntegerBase & | regina::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...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator+= (const IntegerBase &other)
| Adds the given integer to this. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator+= (long other)
| Adds the given integer to this. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator-= (const IntegerBase &other)
| Subtracts the given integer from this. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator-= (long other)
| Subtracts the given integer from this. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator*= (const IntegerBase &other)
| Multiplies the given integer by this. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator*= (long other)
| Multiplies the given integer by this. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator/= (const IntegerBase &other)
| Divides this by the given integer. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator/= (long other)
| Divides this by the given integer. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::divByExact (const IntegerBase &other)
| Divides this by the given integer. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::divByExact (long other)
| Divides this by the given integer. More...
IntegerBase & | regina::IntegerBase< supportInfinity >::operator%= (const IntegerBase &other)
| Reduces this integer modulo the given integer. More...
IntegerBase & | regina::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...
NativeInteger & | regina::NativeInteger< bytes >::operator= (const NativeInteger &value)
| Sets this integer to the given value. More...
NativeInteger & | regina::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...
NativeInteger & | regina::NativeInteger< bytes >::operator++ ()
| The preincrement operator. More...
NativeInteger | regina::NativeInteger< bytes >::operator++ (int)
| The postincrement operator. More...
NativeInteger & | regina::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...
NativeInteger & | regina::NativeInteger< bytes >::operator+= (const NativeInteger &other)
| Adds the given integer to this. More...
NativeInteger & | regina::NativeInteger< bytes >::operator+= (Native other)
| Adds the given integer to this. More...
NativeInteger & | regina::NativeInteger< bytes >::operator-= (const NativeInteger &other)
| Subtracts the given integer from this. More...
NativeInteger & | regina::NativeInteger< bytes >::operator-= (Native other)
| Subtracts the given integer from this. More...
NativeInteger & | regina::NativeInteger< bytes >::operator*= (const NativeInteger &other)
| Multiplies the given integer by this. More...
NativeInteger & | regina::NativeInteger< bytes >::operator*= (Native other)
| Multiplies the given integer by this. More...
NativeInteger & | regina::NativeInteger< bytes >::operator/= (const NativeInteger &other)
| Divides this by the given integer. More...
NativeInteger & | regina::NativeInteger< bytes >::operator/= (Native other)
| Divides this by the given integer. More...
NativeInteger & | regina::NativeInteger< bytes >::divByExact (const NativeInteger &other)
| Divides this by the given integer. More...
NativeInteger & | regina::NativeInteger< bytes >::divByExact (Native other)
| Divides this by the given integer. More...
NativeInteger & | regina::NativeInteger< bytes >::operator%= (const NativeInteger &other)
| Reduces this integer modulo the given integer. More...
NativeInteger & | regina::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::Matrix< T >::Matrix (unsigned long rows, unsigned long cols)
| Creates a new matrix of the given size. More...
| regina::Matrix< T >::Matrix (const Matrix &cloneMe)
| Creates a new matrix that is a clone of the given matrix. More...
| regina::Matrix< T >::~Matrix ()
| Destroys this matrix. More...
void | regina::Matrix< T >::initialise (const T &value)
| Sets every entry in the matrix to the given value. More...
void | regina::Matrix< T >::initialise (List allValues)
| A Python-only routine that fills the matrix with the given set of elements. More...
unsigned long | regina::Matrix< T >::rows () const
| Returns the number of rows in this matrix. More...
unsigned long | regina::Matrix< T >::columns () const
| Returns the number of columns in this matrix. More...
T & | regina::Matrix< T >::entry (unsigned long row, unsigned long column)
| Returns the entry at the given row and column. More...
const T & | regina::Matrix< T >::entry (unsigned long row, unsigned long column) const
| Returns the entry at the given row and column. More...
bool | regina::Matrix< T >::operator== (const Matrix< T > &other) const
| Determines whether this and the given matrix are identical. More...
bool | regina::Matrix< T >::operator!= (const Matrix< T > &other) const
| Determines whether this and the given matrix are different. More...
void | regina::Matrix< T >::writeMatrix (std::ostream &out) const
| Writes a complete representation of the matrix to the given output stream. More...
void | regina::Matrix< T >::swapRows (unsigned long first, unsigned long second)
| Swaps the elements of the two given rows in the matrix. More...
void | regina::Matrix< T >::swapColumns (unsigned long first, unsigned long second)
| Swaps the elements of the two given columns in the matrix. More...
void | regina::Matrix< T >::writeTextShort (std::ostream &out) const
| Writes a short text representation of this object to the given output stream. More...
void | regina::Matrix< T >::writeTextLong (std::ostream &out) const
| Writes a detailed text representation of this object to the given output stream. More...
| regina::MatrixRing< T >::MatrixRing (unsigned long rows, unsigned long cols)
| Creates a new matrix of the given size. More...
| regina::MatrixRing< T >::MatrixRing (const Matrix< T > &cloneMe)
| Creates a new matrix that is a clone of the given matrix. More...
void | regina::MatrixRing< T >::makeIdentity ()
| Turns this matrix into an identity matrix. More...
bool | regina::MatrixRing< T >::isIdentity () const
| Determines whether this matrix is a square identity matrix. More...
bool | regina::MatrixRing< T >::isZero () const
| Determines whether this is the zero matrix. More...
void | regina::MatrixRing< T >::addRow (unsigned long source, unsigned long dest)
| Adds the given source row to the given destination row. More...
void | regina::MatrixRing< T >::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::MatrixRing< T >::addCol (unsigned long source, unsigned long dest)
| Adds the given source column to the given destination column. More...
void | regina::MatrixRing< T >::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::MatrixRing< T >::multRow (unsigned long row, T factor)
| Multiplies the given row by the given factor. More...
void | regina::MatrixRing< T >::multCol (unsigned long column, T factor)
| Multiplies the given column by the given factor. More...
std::unique_ptr< MatrixRing< T > > | regina::MatrixRing< T >::operator* (const MatrixRing< T > &other) const
| Multiplies this by the given matrix, and returns the result. More...
template<class MatrixClass >
std::unique_ptr< MatrixClass > | regina::MatrixRing< T >::multiplyAs (const MatrixRing< T > &other) const
| Multiplies this by the given matrix, and returns a new matrix of subclass MatrixClass. More...
T | regina::MatrixRing< T >::det () const
| Evaluates the determinant of the matrix. More...
| regina::MatrixIntDomain< T >::MatrixIntDomain (unsigned long rows, unsigned long cols)
| Creates a new matrix of the given size. More...
| regina::MatrixIntDomain< T >::MatrixIntDomain (const MatrixIntDomain< T > &cloneMe)
| Creates a new matrix that is a clone of the given matrix. More...
void | regina::MatrixIntDomain< T >::divRowExact (unsigned long row, const T &divBy)
| Divides all elements of the given row by the given integer. More...
void | regina::MatrixIntDomain< T >::divColExact (unsigned long col, const T &divBy)
| Divides all elements of the given column by the given integer. More...
T | regina::MatrixIntDomain< T >::gcdRow (unsigned long row)
| Computes the greatest common divisor of all elements of the given row. More...
T | regina::MatrixIntDomain< T >::gcdCol (unsigned long col)
| Computes the greatest common divisor of all elements of the given column. More...
void | regina::MatrixIntDomain< T >::reduceRow (unsigned long row)
| Reduces the given row by dividing all its elements by their greatest common divisor. More...
void | regina::MatrixIntDomain< T >::reduceCol (unsigned long col)
| Reduces the given column by dividing all its elements by their greatest common divisor. 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...
Matrix2 & | regina::Matrix2::operator= (const Matrix2 &cloneMe)
| Sets this matrix to be a copy of the given matrix. More...
Matrix2 & | regina::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...
Matrix2 & | regina::Matrix2::operator+= (const Matrix2 &other)
| Adds the given matrix to this. More...
Matrix2 & | regina::Matrix2::operator-= (const Matrix2 &other)
| Subtracts the given matrix from this. More...
Matrix2 & | regina::Matrix2::operator*= (const Matrix2 &other)
| Multiplies this by the given matrix. More...
Matrix2 & | regina::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< 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. More...
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. 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)
| 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...
Perm & | regina::Perm< n >::operator= (const Perm &cloneMe)
| 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 ()
| Returns a random permutation on n elements. 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...
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 ()
| 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...
Polynomial & | regina::Polynomial< T >::operator= (const Polynomial< T > &value)
| Sets this to be a copy of the given polynomial. More...
template<typename U >
Polynomial & | regina::Polynomial< T >::operator= (const Polynomial< U > &value)
| Sets this to be a copy of the given polynomial. More...
void | regina::Polynomial< T >::swap (Polynomial< T > &other)
| Swaps the contents of this and the given polynomial. More...
Polynomial & | regina::Polynomial< T >::operator*= (const T &scalar)
| Multiplies this polynomial by the given constant. More...
Polynomial & | regina::Polynomial< T >::operator/= (const T &scalar)
| Divides this polynomial by the given constant. More...
Polynomial & | regina::Polynomial< T >::operator+= (const Polynomial< T > &other)
| Adds the given polynomial to this. More...
Polynomial & | regina::Polynomial< T >::operator-= (const Polynomial< T > &other)
| Subtracts the given polynomial from this. More...
Polynomial & | regina::Polynomial< T >::operator*= (const Polynomial< T > &other)
| Multiplies this by the given polynomial. More...
Polynomial & | regina::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...
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< Integer > | regina::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...
Rational & | regina::Rational::operator= (const Rational &value)
| Sets this rational to the given rational value. More...
template<bool supportInfinity>
Rational & | regina::Rational::operator= (const IntegerBase< supportInfinity > &value)
| Sets this rational to the given integer value. More...
Rational & | regina::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...
Rational & | regina::Rational::operator+= (const Rational &other)
| Adds the given rational to this. More...
Rational & | regina::Rational::operator-= (const Rational &other)
| Subtracts the given rational from this. More...
Rational & | regina::Rational::operator*= (const Rational &other)
| Multiplies the given rational by this. More...
Rational & | regina::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)
| 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)
| 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 ()
| Returns a random permutation on two elements. 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)
| 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)
| 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 ()
| Returns a random permutation on three elements. 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)
| 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)
| 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 ()
| Returns a random permutation on four elements. 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)
| 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)
| 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 ()
| Returns a random permutation on five elements. 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...
T | 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...
T | regina::Vector< T >::norm () const
| Returns the norm of this vector. More...
T | 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...
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...
unsigned long | regina::Matrix< T >::nRows
| The number of rows in the matrix. More...
unsigned long | regina::Matrix< T >::nCols
| The number of columns in the matrix. More...
T ** | regina::Matrix< T >::data
| The actual entries in the matrix. More...
static const T | regina::MatrixRing< T >::zero
| Zero in the underlying ring. More...
static const T | regina::MatrixRing< T >::one
| One (the multiplicative identity) in the underlying ring. More...
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

class | regina::IntegerBase< supportInfinity >::IntegerBase<! supportInfinity >
template<int bytes>
class | regina::IntegerBase< supportInfinity >::NativeInteger
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)
std::ostream & | regina::Matrix2::operator<< (std::ostream &out, const Matrix2 &mat)
| Writes the given matrix to the given output stream. More...
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]

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

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

## Code [2/5]

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

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

## Code [3/5]

typedef uint8_t regina::Perm< 2 >::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]

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.

## Index [1/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 [2/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!).

## Index [3/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 [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]

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!).

## 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

typedef IntegerBase<true> regina::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.

## Native

template<int bytes>

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

The native data type used to store this integer.

## NCyclotomic

typedef Cyclotomic regina::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

typedef Integer regina::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

typedef LargeInteger regina::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>

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

typedef Matrix2 regina::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

typedef MatrixInt regina::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 MatrixRing<T>

Deprecated typedef for backward compatibility.

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

Deprecated:
  The class NMatrixRing has now been renamed to MatrixRing.

## 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

typedef Primes regina::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

typedef Rational regina::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]

Rational regina::Rational::abs | ( |  | ) | const

Determines the absolute value of this rational.

This rational is not changed.

Returns
  the absolute value of this rational.

## abs() [2/2]

template<bool supportInfinity>

IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::abs | ( |  | ) | const

inline

Determines the absolute value of this integer.

This integer is not changed.

Returns
  the absolute value of this integer.

## addCol() [1/2]

template<class T >

void regina::MatrixRing< T >::addCol | ( | unsigned long | source,
|  | unsigned long | dest
| ) |  |

inline

Adds the given source column to the given destination column.

Precondition
  The two given columns are distinct and between 0 and columns()-1 inclusive.

Parameters

  source | the columns to add.
  dest | the column that will be added to.

## addCol() [2/2]

template<class T >

void regina::MatrixRing< T >::addCol | ( | unsigned long | source,
|  | unsigned long | dest,
|  | T | 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.

Precondition
  The two given columns are distinct and between 0 and columns()-1 inclusive.

Parameters

  source | the columns to add.
  dest | the column that will be added to.
  copies | the 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

  other | the vector a multiple of which will be added to this vector.
  multiple | the multiple of other to be added to this vector.

## addRow() [1/2]

template<class T >

void regina::MatrixRing< T >::addRow | ( | unsigned long | source,
|  | unsigned long | dest
| ) |  |

inline

Adds the given source row to the given destination row.

Precondition
  The two given rows are distinct and between 0 and rows()-1 inclusive.

Parameters

  source | the row to add.
  dest | the row that will be added to.

## addRow() [2/2]

template<class T >

void regina::MatrixRing< T >::addRow | ( | unsigned long | source,
|  | unsigned long | dest,
|  | T | 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.

Precondition
  The two given rows are distinct and between 0 and rows()-1 inclusive.

Parameters

  source | the row to add.
  dest | the row that will be added to.
  copies | the 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

  i | the 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 | ) |

inline static

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

  i | the 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 | ) |

inline static

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

  i | the lexicographical index of the permutation; this must be between 0 and 5 inclusive.

Returns
  the ith permutation.

## atIndex() [4/5]

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

inline static

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

  i | the lexicographical index of the permutation; this must be between 0 and 119 inclusive.

Returns
  the ith permutation.

## atIndex() [5/5]

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

inline static

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

  i | the lexicographical index of the permutation; this must be between 0 and 23 inclusive.

Returns
  the ith permutation.

## 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

  from | the 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

  from | the 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

  from | the first integer whose image should be reset. This must be between 0 and 3 inclusive.

## clear() [4/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

  from | the first integer whose image should be reset. This must be between 0 and 5 inclusive.

## clear() [5/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

  from | the first integer whose image should be reset. This must be between 0 and 4 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

  M | the matrix to reduce.
  R | used to return the row-reduction matrix, as described above.
  Ri | used to return the inverse of R.
  rowList | the 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 >

unsigned long regina::Matrix< T >::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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  k | the number of elements for the input permutation; this must be strictly greater than n.

Parameters

  p | a 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

  k | the number of elements for the input permutation; this must be strictly greater than 2.

Parameters

  p | a 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

  k | the number of elements for the input permutation; this must be strictly greater than 3.

Parameters

  p | a permutation on k elements.

Returns
  the same permutation restricted to a permutation on 3 elements.

## contract() [4/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

  k | the number of elements for the input permutation; this must be strictly greater than 5.

Parameters

  p | a permutation on k elements.

Returns
  the same permutation restricted to a permutation on 5 elements.

## contract() [5/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

  k | the number of elements for the input permutation; this must be strictly greater than 4.

Parameters

  p | a permutation on k elements.

Returns
  the same permutation restricted to a permutation on 4 elements.

## Cyclotomic() [1/5]

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/5]

regina::Cyclotomic::Cyclotomic | ( | const Cyclotomic & | value | ) |

inline

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

Parameters

  value | the field element to copy.

## Cyclotomic() [3/5]

regina::Cyclotomic::Cyclotomic | ( | size_t | field | ) |

inline explicit

Creates the zero element of the given cyclotomic field.

Parameters

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

## Cyclotomic() [4/5]

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

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

## Cyclotomic() [5/5]

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

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

## 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

  n | indicates 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 | ( |  | ) | const

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 >

T regina::MatrixRing< T >::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.

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 | ) |

inline constexpr

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

  i | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

## divColExact()

template<typename T>

void regina::MatrixIntDomain< T >::divColExact | ( | unsigned long | col,
|  | const T & | divBy
| ) |  |

Divides all elements of the given column by the given integer.

This can only be used when the given integer divides into all column elements exactly (with no remainder). For the Integer class, this may be much faster than ordinary division.

Precondition
  The argument divBy is neither zero nor infinity, and none of the elements of the given column are infinity.
  The argument divBy divides exactly into every element of the given column (i.e., it leaves no remainder).
  The given column number is between 0 and columns()-1 inclusive.

Parameters

  col | the index of the column whose elements should be divided by divBy.
  divBy | the integer to divide each column element by.

## 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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  divisor | the divisor d.
  remainder | used 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

  divisor | the divisor d.
  remainder | used 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

  divisor | the polynomial to divide by this.
  quotient | a polynomial whose contents will be destroyed and replaced with the quotient q, as described above.
  remainder | a polynomial whose contents will be destroyed and replaced with the remainder r, as described above.

## divRowExact()

template<typename T>

void regina::MatrixIntDomain< T >::divRowExact | ( | unsigned long | row,
|  | const T & | divBy
| ) |  |

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.

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

  row | the index of the row whose elements should be divided by divBy.
  divBy | the integer to divide each row element by.

## 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

  inRange | returns 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 >

T& regina::Matrix< T >::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

  row | the row of the desired entry.
  column | the column of the desired entry.

Returns
  a reference to the entry in the given row and column.

## entry() [2/2]

template<class T >

const T& regina::Matrix< T >::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

  row | the row of the desired entry.
  column | the 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 `n`th 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

  whichRoot | indicates 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

  k | the number of elements for the input permutation; this must be at least 2, and strictly less than n.

Parameters

  p | a 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

  k | the number of elements for the input permutation; this must be exactly 2.

Parameters

  p | a permutation on two elements.

Returns
  the same permutation expressed as a permutation on three elements.

## extend() [3/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

  k | the number of elements for the input permutation; this must be 2, 3 or 4.

Parameters

  p | a permutation on k elements.

Returns
  the same permutation expressed as a permutation on five elements.

## extend() [4/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

  k | the number of elements for the input permutation; this must be 2 or 3.

Parameters

  p | a permutation on k elements.

Returns
  the same permutation expressed as a permutation on four elements.

## factorial()

constexpr int64_t regina::factorial | ( | int | n | ) |

inline constexpr

Returns the factorial of n.

Parameters

  n | any 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 | ) |

inline static

Creates a permutation from the given internal code.

Precondition
  the given code is a valid permutation code; see isPermCode() for details.

Parameters

  code | the 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 | ) |

inline static

Creates a permutation from the given internal code.

Precondition
  the given code is a valid permutation code; see isPermCode() for details.

Parameters

  code | the 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 | ) |

inline static

Creates a permutation from the given internal code.

Precondition
  the given code is a valid permutation code; see isPermCode() for details.

Parameters

  code | the 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 | ) |

inline static

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

  code | the 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 | ) |

inline static

Creates a permutation from the given internal code.

Precondition
  the given code is a valid permutation code; see isPermCode() for details.

Parameters

  newCode | the internal code for the new permutation.

Returns
  the permutation reprsented by the given internal code.

## fromPermCode2()

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

inline static

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

  code | the 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

  other | the 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

  other | the 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

  a | one of the two integers to work with.
  b | the other integer with which to work.

Returns
  the greatest common divisor of a and b.

## gcdCol()

template<typename T >

T regina::MatrixIntDomain< T >::gcdCol | ( | unsigned long | col | ) |

Computes the greatest common divisor of all elements of the given column.

The value returned is guaranteed to be non-negative.

Precondition
  The given column number is between 0 and columns()-1 inclusive.

Parameters

  col | the index of the column whose gcd should be computed.

Returns
  the greatest common divisor of all elements of this column.

## gcdRow()

template<typename T >

T regina::MatrixIntDomain< T >::gcdRow | ( | unsigned long | row | ) |

Computes the greatest common divisor of all elements of the given row.

The value returned is guaranteed to be non-negative.

Precondition
  The given row number is between 0 and rows()-1 inclusive.

Parameters

  row | the index of the row whose gcd should be computed.

Returns
  the greatest common divisor of all elements of this row.

## 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

  other | the 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

  other | the 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

  other | the integer whose greatest common divisor with this will be found.
  u | a variable into which the final coefficient of this will be placed.
  v | a 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

  other | the polynomial whose greatest common divisor with this polynomial we should compute.
  gcd | a polynomial whose contents will be destroyed and replaced with the greatest common divisor d, as described above.
  u | a polynomial whose contents will be destroyed and replaced with u, as described above.
  v | a 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.

Parameters

  a | one of the integers to work with.
  b | the other integer with which to work.
  u | a variable into which the final coefficient of a will be placed.
  v | a 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 | ( |  | ) | const

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< 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.

## index() [5/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.

## init() [1/4]

template<typename T >

void regina::Polynomial< T >::init | ( |  | ) |

inline

Sets this to become the zero polynomial.

## init() [2/4]

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.

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

  begin | the beginning of the sequence of coefficients.
  end | a past-the-end iterator indicating the end of the sequence of coefficients.

## init() [3/4]

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

  degree | the new degree of this polynomial.

## init() [4/4]

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

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

## initialise() [1/2]

template<class T >

void regina::Matrix< T >::initialise | ( | const T & | value | ) |

inline

Sets every entry in the matrix to the given value.

Parameters

  value | the value to assign to each entry.

## initialise() [2/2]

template<class T >

void regina::Matrix< T >::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

  allValues | the individual elements to place into the matrix.

## IntegerBase() [1/11]

template<bool supportInfinity>

regina::IntegerBase< supportInfinity >::IntegerBase | ( |  | ) |

inline

Initialises this integer to zero.

## IntegerBase() [2/11]

template<bool supportInfinity = false>

regina::IntegerBase< supportInfinity >::IntegerBase | ( | const char * | value,
|  | int | base = `10`,
|  | bool * | valid = `0`
| ) |  |

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

  value | the new value of this integer, represented as a string of digits in base base.
  base | the base in which value is given.
  valid | if 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/11]

template<bool supportInfinity>

regina::IntegerBase< supportInfinity >::IntegerBase | ( | const IntegerBase< supportInfinity > & | value | ) |

inline

Initialises this integer to the given value.

Parameters

  value | the new value of this integer.

## IntegerBase() [4/11]

template<bool supportInfinity>

regina::IntegerBase< supportInfinity >::IntegerBase | ( | const IntegerBase<! supportInfinity > & | value | ) |

inline explicit

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

  value | the new value of this integer.

## IntegerBase() [5/11]

template<bool supportInfinity>
template<int bytes>

regina::IntegerBase< supportInfinity >::IntegerBase | ( | const NativeInteger< bytes > & | value | ) |

inline explicit

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

  value | the new value of this integer.

## IntegerBase() [6/11]

template<bool supportInfinity = false>

regina::IntegerBase< supportInfinity >::IntegerBase | ( | const std::string & | value,
|  | int | base = `10`,
|  | bool * | valid = `0`
| ) |  |

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

  value | the new value of this integer, represented as a string of digits in base base.
  base | the base in which value is given.
  valid | if 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/11]

template<bool supportInfinity>

regina::IntegerBase< supportInfinity >::IntegerBase | ( | double | value | ) |

inline

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

Parameters

  value | the real number to be truncated.

## IntegerBase() [8/11]

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

  value | the new value of this integer.

## IntegerBase() [9/11]

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

  value | the new value of this integer.

## IntegerBase() [10/11]

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

  value | the new value of this integer.

## IntegerBase() [11/11]

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

  value | the new value of this integer.

## inverse() [1/7]

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() [2/7]

Rational regina::Rational::inverse | ( |  | ) | const

Calculates the inverse of this rational.

This rational is not changed.

Returns
  the inverse 1 / this.

## inverse() [3/7]

template<int n>

Perm< n > regina::Perm< n >::inverse | ( |  | ) | const

inline

Finds the inverse of this permutation.

Returns
  the inverse of this permutation.

## inverse() [4/7]

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

inline

Finds the inverse of this permutation.

Returns
  the inverse of this permutation.

## inverse() [5/7]

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

inline

Finds the inverse of this permutation.

Returns
  the inverse of this permutation.

## inverse() [6/7]

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

inline

Finds the inverse of this permutation.

Returns
  the inverse of this permutation.

## inverse() [7/7]

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

inline

Finds the inverse of this permutation.

Returns
  the inverse of this permutation.

## invert() [1/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() [2/3]

void regina::Rational::invert | ( |  | ) |

Inverts this rational.

This rational is changed to reflect the result.

## invert() [3/3]

void regina::Cyclotomic::invert | ( |  | ) |

Inverts this field element.

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

## isIdentity() [1/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() [2/7]

template<int n>

bool regina::Perm< n >::isIdentity | ( |  | ) | const

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() [3/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() [4/7]

template<class T >

bool regina::MatrixRing< T >::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).

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

## 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< 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.

## isIdentity() [7/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.

## 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 | ( |  | ) | const

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 | ( |  | ) | const

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 | ( | R | 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

  x | the number to examine.

Returns
  `true` if and only if the given number is strictly negative.

## isNonNegative()

template<class R >

bool regina::isNonNegative | ( | R | 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

  x | the number to examine.

Returns
  `true` if and only if the given number is non-negative.

## isNonPositive()

template<class R >

bool regina::isNonPositive | ( | R | 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

  x | the number to examine.

Returns
  `true` if and only if the given number is non-positive.

## isNonZero()

template<class R >

bool regina::isNonZero | ( | R | 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

  x | the 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 | ) |

inline 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() [2/5]

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

inline 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() [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

  code | the 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 | ) |

inline static

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

  code | the 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 | ( | R | 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

  x | the number to examine.

Returns
  `true` if and only if the given number is strictly positive.

## isZero() [1/6]

template<typename T >

bool regina::Polynomial< T >::isZero | ( |  | ) | const

inline

Returns whether this is the zero polynomial.

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

## isZero() [2/6]

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() [3/6]

template<bool supportInfinity>

bool regina::IntegerBase< supportInfinity >::isZero | ( |  | ) | const

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() [4/6]

template<class T >

bool regina::MatrixRing< T >::isZero | ( |  | ) | const

inline

Determines whether this is the zero matrix.

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

## isZero() [5/6]

template<int bytes>

bool regina::NativeInteger< bytes >::isZero | ( |  | ) | const

inline

Returns whether or not this integer is zero.

Returns
  `true` if and only if this integer is zero.

## isZero() [6/6]

template<class R >

bool regina::isZero | ( | R | 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

  x | the number to examine.

Returns
  `true` if and only if the given number is approximately zero.

## 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

  other | the 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

  a | one of the two integers to work with.
  b | the 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

  other | the integer whose lowest common multiple with this will be found.

## leading()

template<typename T >

const T & regina::Polynomial< T >::leading | ( |  | ) | const

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

  p | the 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 | ( |  | ) | const

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 >

void regina::MatrixRing< T >::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 `one` if `r == c` and `zero` otherwise.

## 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/2]

template<class T >

regina::Matrix< T >::Matrix | ( | const Matrix< T > & | cloneMe | ) |

inline

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

Parameters

  cloneMe | the matrix to clone.

## Matrix() [2/2]

template<class T >

regina::Matrix< T >::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.

Precondition
  The given number of rows and columns are both strictly positive.

Parameters

  rows | the number of rows in the new matrix.
  cols | the 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

  values | the 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

  cloneMe | the 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

  val00 | the value to place in row 0, column 0.
  val01 | the value to place in row 0, column 1.
  val10 | the value to place in row 1, column 0.
  val11 | the value to place in row 1, column 1.

## MatrixIntDomain() [1/2]

template<typename T>

regina::MatrixIntDomain< T >::MatrixIntDomain | ( | const MatrixIntDomain< T > & | cloneMe | ) |

inline

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

Parameters

  cloneMe | the matrix to clone.

## MatrixIntDomain() [2/2]

template<typename T >

regina::MatrixIntDomain< T >::MatrixIntDomain | ( | unsigned long | rows,
|  | unsigned long | cols
| ) |  |

inline

Creates a new matrix of the given size.

All entries will be initialised using their default constructors.

Note that, for MatrixIntDomain<Integer>, this means that all entries will be initialised to zero.

Precondition
  The given number of rows and columns are both strictly positive.

Parameters

  rows | the number of rows in the new matrix.
  cols | the number of columns in the new matrix.

## MatrixRing() [1/2]

template<class T >

regina::MatrixRing< T >::MatrixRing | ( | const Matrix< T > & | cloneMe | ) |

inline

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

Parameters

  cloneMe | the matrix to clone.

## MatrixRing() [2/2]

template<class T >

regina::MatrixRing< T >::MatrixRing | ( | unsigned long | rows,
|  | unsigned long | cols
| ) |  |

inline

Creates a new matrix of the given size.

All entries will be initialised using their default constructors.

Precondition
  The given number of rows and columns are both strictly positive.

Parameters

  rows | the number of rows in the new matrix.
  cols | the number of columns in the new matrix.

## 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

  matrix | the 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.
  rowSpaceBasis | used to return a change of basis matrix (see above for details). This is optional; you may pass a null pointer instead.
  rowSpaceBasisInv | used to return the inverse of rowSpaceBasis. This is optional; you may pass a null pointer instead.
  colSpaceBasis | used to return a change of basis matrix (see above for details). This is optional; you may pass a null pointer instead.
  colSpaceBasisInv | used to return the inverse of colSpaceBasis. This is optional; you may pass a null pointer instead.

Author
  Ryan Budney

## 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

  n | the modular base in which to work.
  k | the number whose multiplicative inverse should be found.

Returns
  the inverse v for which `k * v == 1 (mod n)`.

## multCol()

template<class T >

void regina::MatrixRing< T >::multCol | ( | unsigned long | column,
|  | T | 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.

Precondition
  The given column is between 0 and columns()-1 inclusive.

Parameters

  column | the column to work with.
  factor | the factor by which to multiply the given column.

## multiplyAs()

template<class T >
template<class MatrixClass >

std::unique_ptr<MatrixClass> regina::MatrixRing< T >::multiplyAs | ( | const MatrixRing< T > & | other | ) | const

inline

Multiplies this by the given matrix, and returns a new matrix of subclass MatrixClass.

This matrix is not changed.

Precondition
  The number of columns in this matrix equals the number of rows in the given matrix.
  The class MatrixClass is a subclass of MatrixRing<T>, and can be fully initialised by calling the two-argument constructor (passing the row and column counts) and then settng individual elements via data[r][c]. In particular, there should not be any new data members that need explicit initialisation.

Python:\n Not present, but the python multiplication operator
  performs the same task (see the python notes for operator *).

Parameters

  other | the matrix by which to multiply this matrix.

Returns
  a newly allocated matrix representing `this * other`.

## multRow()

template<class T >

void regina::MatrixRing< T >::multRow | ( | unsigned long | row,
|  | T | 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.

Precondition
  The given row is between 0 and rows()-1 inclusive.

Parameters

  row | the row to work with.
  factor | the 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 | ) |

inline explicit

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

  value | the 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

  value | the 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

  value | the new value of this integer.

## nativeValue() [1/2]

template<bool supportInfinity>
template<int bytes>

IntOfSize< bytes >::type regina::IntegerBase< supportInfinity >::nativeValue | ( |  | ) | const

inline

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 | ( |  | ) | const

inline

Returns the value of this integer in its native type.

Returns
  the value of this integer.

## negate() [1/7]

void regina::Ray::negate | ( |  | ) |

inline

Negates every element of this vector.

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

## negate() [2/7]

void regina::Matrix2::negate | ( |  | ) |

inline

Negates this matrix.

This matrix is changed to reflect the result.

## negate() [3/7]

template<class T>

void regina::Vector< T >::negate | ( |  | ) |

inline

Negates every element of this vector.

## negate() [4/7]

void regina::Rational::negate | ( |  | ) |

inline

Negates this rational.

This rational is changed to reflect the result.

## negate() [5/7]

void regina::Cyclotomic::negate | ( |  | ) |

inline

Negates this field element.

## negate() [6/7]

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() [7/7]

template<int bytes>

void regina::NativeInteger< bytes >::negate | ( |  | ) |

inline

Negates this integer.

This integer is changed to reflect the result.

## 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/15]

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

  rhs | the 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/15]

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

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are not equal.

## operator!=() [3/15]

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

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are not equal.

## operator!=() [4/15]

bool regina::Matrix2::operator!= | ( | const Matrix2 & | compare | ) | const

inline

Determines if this is not equal to the given matrix.

Parameters

  compare | the matrix with which this will be compared.

Returns
  `true` if and only if this matrix is not equal to compare.

## operator!=() [5/15]

template<class T >

bool regina::Matrix< T >::operator!= | ( | const Matrix< T > & | 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

  other | the matrix to compare with this.

Returns
  `true` if the matrices are different as described above, or `false` otherwise.

## operator!=() [6/15]

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

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are not equal.

## operator!=() [7/15]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation differ.

## operator!=() [8/15]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation differ.

## operator!=() [9/15]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation differ.

## operator!=() [10/15]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation differ.

## operator!=() [11/15]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation differ.

## operator!=() [12/15]

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

  rhs | the polynomial to compare with this.

Returns
  `true` if and only if this and the given polynomial are not equal.

## operator!=() [13/15]

bool regina::Rational::operator!= | ( | const Rational & | compare | ) | const

inline

Determines if this is not equal to the given rational.

Parameters

  compare | the rational with which this will be compared.

Returns
  `true` if and only if this rational is not equal to compare.

## operator!=() [14/15]

template<bool supportInfinity>

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

inline

Determines if this is not equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are not equal.

## operator!=() [15/15]

template<int bytes>

bool regina::NativeInteger< bytes >::operator!= | ( | Native | rhs | ) | const

inline

Determines if this is not equal to the given integer.

Parameters

  rhs | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the 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

  other | the integer modulo which this integer will be reduced.

Returns
  a reference to this integer with its new value.

## operator*() [1/15]

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

  other | the integer to multiply by this integer.

Returns
  the product this times other.

## operator*() [2/15]

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

  other | the matrix that this should be multiplied by.

Returns
  the product this * other.

## operator*() [3/15]

template<class T >

std::unique_ptr<MatrixRing<T> > regina::MatrixRing< T >::operator* | ( | const MatrixRing< T > & | other | ) | const

inline

Multiplies this by the given matrix, and returns the result.

This matrix is not changed.

Precondition
  The number of columns in this matrix equals the number of rows in the given matrix.

Warning
  The returned matrix will be of the exact class MatrixRing<T>, even if both this and other are of some common subclass of MatrixRing<T>. If you need a subclass to be returned, consider calling multiplyAs() instead.

Python:\n The multiplication operator for a subclass (such as
  MatrixIntDomain) will return a new matrix of that same subclass. That is, the python multiplication operator really calls multiplyAs(), not this routine.

Parameters

  other | the matrix by which to multiply this matrix.

Returns
  a newly allocated matrix representing `this * other`.

## operator*() [4/15]

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

  other | the integer to multiply by this integer.

Returns
  the product this times other.

## operator*() [5/15]

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

  q | the permutation to compose this with.

Returns
  the composition of both permutations.

## operator*() [6/15]

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

  q | the permutation with which to compose this.

Returns
  the composition of both permutations.

## operator*() [7/15]

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

  q | the permutation with which to compose this.

Returns
  the composition of both permutations.

## operator*() [8/15]

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

  q | the permutation with which to compose this.

Returns
  the composition of both permutations.

## operator*() [9/15]

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

  q | the permutation with which to compose this.

Returns
  the composition of both permutations.

## operator*() [10/15]

Rational regina::Rational::operator* | ( | const Rational & | r | ) | const

Calculates the product of two rationals.

This rational is not changed.

Parameters

  r | the rational with which to multiply this.

Returns
  the product this * r.

## operator*() [11/15]

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

  other | the vector with which this will be multiplied.

Returns
  the dot product of this and the given vector.

## operator*() [12/15]

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

  lhs | the native integer to multiply.
  rhs | the large integer to multiply.

Returns
  the product lhs times rhs.

## operator*() [13/15]

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

  other | the integer to multiply by this integer.

Returns
  the product this times other.

## operator*() [14/15]

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

  scalar | the integer that this matrix should be multiplied by.

Returns
  the product this * scalar.

## operator*() [15/15]

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

  other | the integer to multiply by this integer.

Returns
  the product this times other.

## operator*=() [1/12]

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

  other | the field element to multiply this by.

Returns
  a reference to this field element.

## operator*=() [2/12]

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

  other | the integer to multiply with this integer.

Returns
  a reference to this integer with its new value.

## operator*=() [3/12]

Matrix2& regina::Matrix2::operator*= | ( | const Matrix2 & | other | ) |

Multiplies this by the given matrix.

This matrix is changed to reflect the result.

Parameters

  other | the matrix by which this should be multiplied.

Returns
  a reference to this matrix with its new value.

## operator*=() [4/12]

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

  other | the integer to multiply with this integer.

Returns
  a reference to this integer with its new value.

## operator*=() [5/12]

template<typename T >

Polynomial< T > & regina::Polynomial< T >::operator*= | ( | const Polynomial< T > & | other | ) |

Multiplies this by the given polynomial.

Parameters

  other | the polynomial to multiply this by.

Returns
  a reference to this polynomial.

## operator*=() [6/12]

Rational& regina::Rational::operator*= | ( | const Rational & | other | ) |

Multiplies the given rational by this.

This rational is changed to reflect the result.

Parameters

  other | the rational to multiply by this.

Returns
  a reference to this rational with its new value.

## operator*=() [7/12]

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

  scalar | the rational to multiply this by.

Returns
  a reference to this field element.

## operator*=() [8/12]

template<class T>

void regina::Vector< T >::operator*= | ( | const T & | factor | ) |

inline

Multiplies this vector by the given scalar.

Parameters

  factor | the scalar with which this will be multiplied.

## operator*=() [9/12]

template<typename T >

Polynomial< T > & regina::Polynomial< T >::operator*= | ( | const T & | scalar | ) |

Multiplies this polynomial by the given constant.

Parameters

  scalar | the scalar factor to multiply by.

Returns
  a reference to this polynomial.

## operator*=() [10/12]

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

  other | the integer to multiply with this integer.

Returns
  a reference to this integer with its new value.

## operator*=() [11/12]

Matrix2 & regina::Matrix2::operator*= | ( | long | scalar | ) |

inline

Multiplies this by the given scalar.

This matrix is changed to reflect the result.

Parameters

  scalar | the scalar by which this should be multiplied.

Returns
  a reference to this matrix with its new value.

## operator*=() [12/12]

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

  other | the integer to multiply with this integer.

Returns
  a reference to this integer with its new value.

## operator+() [1/7]

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

  other | the integer to add to this integer.

Returns
  the sum this plus other.

## operator+() [2/7]

Matrix2 regina::Matrix2::operator+ | ( | const Matrix2 & | other | ) | const

inline

Calculates the sum of two matrices.

Neither this nor the given matrix is changed.

Parameters

  other | the matrix to add to this.

Returns
  the sum this + other.

## operator+() [3/7]

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

  other | the integer to add to this integer.

Returns
  the sum this plus other.

## operator+() [4/7]

Rational regina::Rational::operator+ | ( | const Rational & | r | ) | const

Calculates the sum of two rationals.

This rational is not changed.

Parameters

  r | the rational to add to this.

Returns
  the sum this + r.

## operator+() [5/7]

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

  lhs | the native integer to add.
  rhs | the large integer to add.

Returns
  the sum lhs plus rhs.

## operator+() [6/7]

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

  other | the integer to add to this integer.

Returns
  the sum this plus other.

## operator+() [7/7]

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

  other | the integer to add to this integer.

Returns
  the sum this plus other.

## 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/9]

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

  other | the field element to add to this.

Returns
  a reference to this field element.

## operator+=() [2/9]

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

  other | the integer to add to this integer.

Returns
  a reference to this integer with its new value.

## operator+=() [3/9]

Matrix2 & regina::Matrix2::operator+= | ( | const Matrix2 & | other | ) |

inline

Adds the given matrix to this.

This matrix is changed to reflect the result.

Parameters

  other | the matrix to add to this.

Returns
  a reference to this matrix with its new value.

## operator+=() [4/9]

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

  other | the integer to add to this integer.

Returns
  a reference to this integer with its new value.

## operator+=() [5/9]

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.

Parameters

  other | the polynomial to add to this.

Returns
  a reference to this polynomial.

## operator+=() [6/9]

Rational& regina::Rational::operator+= | ( | const Rational & | other | ) |

Adds the given rational to this.

This rational is changed to reflect the result.

Parameters

  other | the rational to add to this.

Returns
  a reference to this rational with its new value.

## operator+=() [7/9]

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

  other | the vector to add to this vector.

## operator+=() [8/9]

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

  other | the integer to add to this integer.

Returns
  a reference to this integer with its new value.

## operator+=() [9/9]

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

  other | the integer to add to this integer.

Returns
  a reference to this integer with its new value.

## operator-() [1/10]

Matrix2 regina::Matrix2::operator- | ( |  | ) | const

inline

Determines the negative of this matrix.

This matrix is not changed.

Returns
  the negative of this matrix.

## operator-() [2/10]

Rational regina::Rational::operator- | ( |  | ) | const

Determines the negative of this rational.

This rational is not changed.

Returns
  the negative of this rational.

## operator-() [3/10]

template<bool supportInfinity>

IntegerBase< supportInfinity > regina::IntegerBase< supportInfinity >::operator- | ( |  | ) | const

inline

Determines the negative of this integer.

This integer is not changed.

Negative infinity will return infinity.

Returns
  the negative of this integer.

## operator-() [4/10]

template<int bytes>

NativeInteger< bytes > regina::NativeInteger< bytes >::operator- | ( |  | ) | const

inline

Determines the negative of this integer.

This integer is not changed.

Returns
  the negative of this integer.

## operator-() [5/10]

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

  other | the integer to subtract from this integer.

Returns
  the difference this minus other.

## operator-() [6/10]

Matrix2 regina::Matrix2::operator- | ( | const Matrix2 & | other | ) | const

inline

Calculates the difference of two matrices.

Neither this nor the given matrix is changed.

Parameters

  other | the matrix to subtract from this.

Returns
  the difference this - other.

## operator-() [7/10]

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

  other | the integer to subtract from this integer.

Returns
  the difference this minus other.

## operator-() [8/10]

Rational regina::Rational::operator- | ( | const Rational & | r | ) | const

Calculates the difference of two rationals.

This rational is not changed.

Parameters

  r | the rational to subtract from this.

Returns
  the difference this - r.

## operator-() [9/10]

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

  other | the integer to subtract from this integer.

Returns
  the difference this minus other.

## operator-() [10/10]

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

  other | the integer to subtract from this integer.

Returns
  the difference this minus other.

## 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/9]

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

  other | the field element to subtract from this.

Returns
  a reference to this field element.

## operator-=() [2/9]

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

  other | the integer to subtract from this integer.

Returns
  a reference to this integer with its new value.

## operator-=() [3/9]

Matrix2 & regina::Matrix2::operator-= | ( | const Matrix2 & | other | ) |

inline

Subtracts the given matrix from this.

This matrix is changed to reflect the result.

Parameters

  other | the matrix to subtract from this.

Returns
  a reference to this matrix with its new value.

## operator-=() [4/9]

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

  other | the integer to subtract from this integer.

Returns
  a reference to this integer with its new value.

## operator-=() [5/9]

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

  other | the polynomial to subtract from this.

Returns
  a reference to this polynomial.

## operator-=() [6/9]

Rational& regina::Rational::operator-= | ( | const Rational & | other | ) |

Subtracts the given rational from this.

This rational is changed to reflect the result.

Parameters

  other | the rational to subtract from this.

Returns
  a reference to this rational with its new value.

## operator-=() [7/9]

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

  other | the vector to subtract from this vector.

## operator-=() [8/9]

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

  other | the integer to subtract from this integer.

Returns
  a reference to this integer with its new value.

## operator-=() [9/9]

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

  other | the integer to subtract from this integer.

Returns
  a reference to this integer with its new value.

## operator/() [1/5]

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

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

## operator/() [2/5]

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

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

## operator/() [3/5]

Rational regina::Rational::operator/ | ( | const Rational & | r | ) | const

Calculates the ratio of two rationals.

This rational is not changed.

Parameters

  r | the rational to divide this by.

Returns
  the ratio this / r.

## operator/() [4/5]

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

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

## operator/() [5/5]

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

  other | the integer to divide this by.

Returns
  the quotient this divided by other.

## operator/=() [1/9]

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

  other | the field element to divide this by.

Returns
  a reference to this field element.

## operator/=() [2/9]

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

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

## operator/=() [3/9]

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

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

## operator/=() [4/9]

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

  other | the polynomial to divide this by.

Returns
  a reference to this polynomial.

## operator/=() [5/9]

Rational& regina::Rational::operator/= | ( | const Rational & | other | ) |

Divides this by the given rational.

This rational is changed to reflect the result.

Parameters

  other | the rational to divide this by.

Returns
  a reference to this rational with its new value.

## operator/=() [6/9]

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

  scalar | the rational to divide this by.

Returns
  a reference to this field element.

## operator/=() [7/9]

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

  scalar | the scalar factor to divide by.

Returns
  a reference to this polynomial.

## operator/=() [8/9]

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

  other | the integer to divide this by.

Returns
  a reference to this integer with its new value.

## operator/=() [9/9]

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

  other | the 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

  rhs | the 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

  rhs | the 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

  compare | the 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

  rhs | the 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

  rhs | the 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

  out | the output stream to which to write.
  i | the 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

  out | the output stream to which to write.
  mat | the 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

  out | the output stream to which to write.
  i | the 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

  out | the output stream to which to write.
  p | the permutation to write.

Returns
  a reference to out.

Template Parameters

  n | the 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

  out | the output stream to which to write.
  rat | the 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

  out | the output stream to which to write.
  vector | the 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

  rhs | the 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

  rhs | the 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

  compare | the 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

  rhs | the 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

  rhs | the 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/25]

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

  value | the 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/25]

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.

Parameters

  value | the new value to assign to this field element.

Returns
  a reference to this field element.

## operator=() [3/25]

template<bool supportInfinity>

IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= | ( | const IntegerBase< supportInfinity > & | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [4/25]

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

  value | the new value of this rational.

Returns
  a reference to this rational with its new value.

## operator=() [5/25]

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

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [6/25]

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

  values | the four values to copy into this matrix.

Returns
  a reference to this matrix.

## operator=() [7/25]

Matrix2 & regina::Matrix2::operator= | ( | const Matrix2 & | cloneMe | ) |

inline

Sets this matrix to be a copy of the given matrix.

Parameters

  cloneMe | the matrix to be copied.

Returns
  a reference to this matrix.

## operator=() [8/25]

template<int bytes>

NativeInteger< bytes > & regina::NativeInteger< bytes >::operator= | ( | const NativeInteger< bytes > & | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [9/25]

template<int n>

Perm< n > & regina::Perm< n >::operator= | ( | const Perm< n > & | cloneMe | ) |

inline

Sets this permutation to be equal to the given permutation.

Parameters

  cloneMe | the permutation whose value will be assigned to this permutation.

Returns
  a reference to this permutation.

## operator=() [10/25]

Perm< 2 > & regina::Perm< 2 >::operator= | ( | const Perm< 2 > & | cloneMe | ) |

inline

Sets this permutation to be equal to the given permutation.

Parameters

  cloneMe | the permutation whose value will be assigned to this permutation.

Returns
  a reference to this permutation.

## operator=() [11/25]

Perm< 3 > & regina::Perm< 3 >::operator= | ( | const Perm< 3 > & | cloneMe | ) |

inline

Sets this permutation to be equal to the given permutation.

Parameters

  cloneMe | the permutation whose value will be assigned to this permutation.

Returns
  a reference to this permutation.

## operator=() [12/25]

Perm< 4 > & regina::Perm< 4 >::operator= | ( | const Perm< 4 > & | cloneMe | ) |

inline

Sets this permutation to be equal to the given permutation.

Parameters

  cloneMe | the permutation whose value will be assigned to this permutation.

Returns
  a reference to this permutation.

## operator=() [13/25]

Perm< 5 > & regina::Perm< 5 >::operator= | ( | const Perm< 5 > & | cloneMe | ) |

inline

Sets this permutation to be equal to the given permutation.

Parameters

  cloneMe | the permutation whose value will be assigned to this permutation.

Returns
  a reference to this permutation.

## operator=() [14/25]

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).

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

  value | the polynomial to copy.

Returns
  a reference to this polynomial.

## operator=() [15/25]

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).

Parameters

  value | the polynomial to copy.

Returns
  a reference to this polynomial.

## operator=() [16/25]

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

  scalar | the new rational value of this field element.

Returns
  a reference to this field element.

## operator=() [17/25]

Rational & regina::Rational::operator= | ( | const Rational & | value | ) |

inline

Sets this rational to the given rational value.

Parameters

  value | the new value of this rational.

Returns
  a reference to this rational with its new value.

## operator=() [18/25]

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

  value | the 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=() [19/25]

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

  cloneMe | the vector whose value shall be assigned to this vector.

## operator=() [20/25]

template<bool supportInfinity>

IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= | ( | int | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [21/25]

Rational & regina::Rational::operator= | ( | long | value | ) |

inline

Sets this rational to the given integer value.

Parameters

  value | the new value of this rational.

Returns
  a reference to this rational with its new value.

## operator=() [22/25]

template<bool supportInfinity>

IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= | ( | long | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [23/25]

template<int bytes>

NativeInteger< bytes > & regina::NativeInteger< bytes >::operator= | ( | Native | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [24/25]

template<bool supportInfinity>

IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= | ( | unsigned long | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator=() [25/25]

template<bool supportInfinity>

IntegerBase< supportInfinity > & regina::IntegerBase< supportInfinity >::operator= | ( | unsigned | value | ) |

inline

Sets this integer to the given value.

Parameters

  value | the new value of this integer.

Returns
  a reference to this integer with its new value.

## operator==() [1/16]

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

  rhs | the 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/16]

template<bool supportInfinity>

bool regina::IntegerBase< supportInfinity >::operator== | ( | const IntegerBase< supportInfinity > & | rhs | ) | const

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are equal.

## operator==() [3/16]

template<bool supportInfinity>

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

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are equal.

## operator==() [4/16]

bool regina::Matrix2::operator== | ( | const Matrix2 & | compare | ) | const

inline

Determines if this is equal to the given matrix.

Parameters

  compare | the matrix with which this will be compared.

Returns
  `true` if and only if this matrix is equal to compare.

## operator==() [5/16]

template<class T >

bool regina::Matrix< T >::operator== | ( | const Matrix< T > & | 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

  other | the matrix to compare with this.

Returns
  `true` if the matrices are equal as described above, or `false` otherwise.

## operator==() [6/16]

template<int bytes>

bool regina::NativeInteger< bytes >::operator== | ( | const NativeInteger< bytes > & | rhs | ) | const

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are equal.

## operator==() [7/16]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation are equal.

## operator==() [8/16]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation are equal.

## operator==() [9/16]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation are equal.

## operator==() [10/16]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation are equal.

## operator==() [11/16]

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

  other | the permutation with which to compare this.

Returns
  `true` if and only if this and the given permutation are equal.

## operator==() [12/16]

template<typename T >

bool regina::Polynomial< T >::operator== | ( | const Polynomial< T > & | rhs | ) | const

inline

Tests whether this and the given polynomial are equal.

Parameters

  rhs | the polynomial to compare with this.

Returns
  `true` if and only if this and the given polynomial are equal.

## operator==() [13/16]

bool regina::Rational::operator== | ( | const Rational & | compare | ) | const

Determines if this is equal to the given rational.

Parameters

  compare | the rational with which this will be compared.

Returns
  `true` if and only if this rational is equal to compare.

## operator==() [14/16]

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

  compare | the vector with which this will be compared.

Returns
  `true` if and only if the this and the given vector are equal.

## operator==() [15/16]

template<bool supportInfinity>

bool regina::IntegerBase< supportInfinity >::operator== | ( | long | rhs | ) | const

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the integer with which this will be compared.

Returns
  `true` if and only if this and the given integer are equal.

## operator==() [16/16]

template<int bytes>

bool regina::NativeInteger< bytes >::operator== | ( | Native | rhs | ) | const

inline

Determines if this is equal to the given integer.

Parameters

  rhs | the 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

  rhs | the 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

  rhs | the 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

  compare | the 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

  rhs | the 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

  rhs | the 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

  rhs | the 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

  rhs | the 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

  compare | the 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

  rhs | the 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

  rhs | the 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/11]

template<int n>

int regina::Perm< n >::operator[] | ( | int | source | ) | const

inline

Determines the image of the given integer under this permutation.

Parameters

  source | the integer whose image we wish to find. This should be between 0 and n-1 inclusive.

Returns
  the image of source.

## operator[]() [2/11]

int regina::Perm< 2 >::operator[] | ( | int | source | ) | const

inline

Determines the image of the given integer under this permutation.

Parameters

  source | the integer whose image we wish to find. This should be 0 or 1.

Returns
  the image of source.

## operator[]() [3/11]

int regina::Perm< 3 >::operator[] | ( | int | source | ) | const

inline

Determines the image of the given integer under this permutation.

Parameters

  source | the integer whose image we wish to find. This should be between 0 and 2 inclusive.

Returns
  the image of source.

## operator[]() [4/11]

int regina::Perm< 5 >::operator[] | ( | int | source | ) | const

inline

Determines the image of the given integer under this permutation.

Parameters

  source | the integer whose image we wish to find. This should be between 0 and 4 inclusive.

Returns
  the image of source.

## operator[]() [5/11]

int regina::Perm< 4 >::operator[] | ( | int | source | ) | const

inline

Determines the image of the given integer under this permutation.

Parameters

  source | the integer whose image we wish to find. This should be between 0 and 3 inclusive.

Returns
  the image of source.

## operator[]() [6/11]

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

  exp | indicates which coefficient to access; this must be between 0 and degree()-1 inclusive.

Returns
  a reference to the corresponding rational coefficient.

## operator[]() [7/11]

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

  exp | indicates which coefficient to return; this must be between 0 and degree()-1 inclusive.

Returns
  a constant reference to the corresponding rational coefficient.

## operator[]() [8/11]

template<typename T >

const T & regina::Polynomial< T >::operator[] | ( | size_t | exp | ) | const

inline

Returns the given coefficient of this polynomial.

Parameters

  exp | the 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[]() [9/11]

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

  index | the vector index to examine.

Returns
  the vector element at the given index.

## operator[]() [10/11]

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

  row | the index of the requested row; this must be 0 or 1.

Returns
  a two-integer array containing the elements of the requested row.

## operator[]() [11/11]

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

  row | the 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< 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.

## orderedSnIndex() [4/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.

## 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

  a | the array of preimages; this must have length n.
  b | the 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

  a | the array of preimages; this must have length 2.
  b | the 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

  a | the array of preimages; this must have length 3.
  b | the 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

  a | the array of preimages; this must have length 4.
  b | the 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

  a | the array of preimages; this must have length 5.
  b | the 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

  image | the 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

  image | the 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

  image | the 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

  image | the 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

  image | the array of images.

## Perm() [16/30]

regina::Perm< 2 >::Perm | ( | const Perm< 2 > & | cloneMe | ) |

inline

Creates a permutation that is a clone of the given permutation.

Parameters

  cloneMe | the permutation to clone.

## Perm() [17/30]

regina::Perm< 3 >::Perm | ( | const Perm< 3 > & | cloneMe | ) |

inline

Creates a permutation that is a clone of the given permutation.

Parameters

  cloneMe | the permutation to clone.

## Perm() [18/30]

regina::Perm< 4 >::Perm | ( | const Perm< 4 > & | cloneMe | ) |

inline

Creates a permutation that is a clone of the given permutation.

Parameters

  cloneMe | the permutation to clone.

## Perm() [19/30]

regina::Perm< 5 >::Perm | ( | const Perm< 5 > & | cloneMe | ) |

inline

Creates a permutation that is a clone of the given permutation.

Parameters

  cloneMe | the permutation to clone.

## Perm() [20/30]

template<int n>

regina::Perm< n >::Perm | ( | const Perm< n > & | cloneMe | ) |

inline

Creates a permutation that is a clone of the given permutation.

Parameters

  cloneMe | the 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

  a | the element to switch with b.
  b | the 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

  a | the element to switch with b.
  b | the 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

  a | the element to switch with b.
  b | the 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

  a | the element to switch with b.
  b | the 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

  a | the element to switch with b.
  b | the 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

  a | the desired image of 0.
  b | the desired image of 1.
  c | the 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

  a | the desired image of 0.
  b | the desired image of 1.
  c | the desired image of 2.
  d | the 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

  a | the desired image of 0.
  b | the desired image of 1.
  c | the desired image of 2.
  d | the desired image of 3.
  e | the 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

  a0 | the desired preimage of a1.
  b0 | the desired preimage of b1.
  c0 | the desired preimage of c1.
  d0 | the desired preimage of d1.
  a1 | the desired image of a0.
  b1 | the desired image of b0.
  c1 | the desired image of c0.
  d1 | the 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

  a0 | the desired preimage of a1.
  b0 | the desired preimage of b1.
  c0 | the desired preimage of c1.
  d0 | the desired preimage of d1.
  e0 | the desired preimage of e1.
  a1 | the desired image of a0.
  b1 | the desired image of b0.
  c1 | the desired image of c0.
  d1 | the desired image of d0.
  e1 | the desired image of e0.

## permCode() [1/5]

template<int n>

Perm< n >::Code regina::Perm< n >::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() [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/5]

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/5]

template<typename T >

regina::Polynomial< T >::Polynomial | ( | const Polynomial< T > & | value | ) |

inline

Creates a new copy of the given polynomial.

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

  value | the polynomial to clone.

## Polynomial() [3/5]

template<typename T >
template<typename U >

regina::Polynomial< T >::Polynomial | ( | const Polynomial< U > & | value | ) |

inline

Creates a new copy of the given polynomial.

Precondition
  Objects of type T can be assigned values of type U.

Parameters

  value | the polynomial to clone.

## Polynomial() [4/5]

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.

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

  begin | the beginning of the sequence of coefficients.
  end | a past-the-end iterator indicating the end of the sequence of coefficients.

## Polynomial() [5/5]

template<typename T >

regina::Polynomial< T >::Polynomial | ( | size_t | degree | ) |

inline explicit

Creates the polynomial `x^d` for the given degree d.

Parameters

  degree | the degree of the new polynomial.

## 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

  image | the 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

  image | the 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

  image | the 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< 5 >::preImageOf | ( | int | image | ) | const

inline

Determines the preimage of the given integer under this permutation.

Parameters

  image | the integer whose preimage we wish to find. This should be between 0 and 4 inclusive.

Returns
  the preimage of image.

## preImageOf() [5/5]

int regina::Perm< 4 >::preImageOf | ( | int | image | ) | const

inline

Determines the preimage of the given integer under this permutation.

Parameters

  image | the integer whose preimage we wish to find. This should be between 0 and 3 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

  hom | the matrix representing the homomorphism from Z^n to Z^k; this must be a k by n matrix.
  sublattice | a 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

  which | indicates which prime is requested.
  autoGrow | specifies 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

  n | the 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

  n | the 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

  exp | the power to which this integer will be raised.

## rand() [1/5]

template<int n>

Perm< n > regina::Perm< n >::rand | ( |  | ) |

static

Returns a random permutation on n elements.

All permutations are returned with equal probability.

The implementation uses the C standard ::rand() function for its random number generation.

Returns
  a random permutation.

## rand() [2/5]

Perm< 2 > regina::Perm< 2 >::rand | ( |  | ) |

inline static

Returns a random permutation on two elements.

All permutations are returned with equal probability.

The implementation uses the C standard ::rand() function for its random number generation.

Returns
  a random permutation.

## rand() [3/5]

Perm< 3 > regina::Perm< 3 >::rand | ( |  | ) |

inline static

Returns a random permutation on three elements.

All permutations are returned with equal probability.

The implementation uses the C standard ::rand() function for its random number generation.

Returns
  a random permutation.

## rand() [4/5]

Perm< 5 > regina::Perm< 5 >::rand | ( |  | ) |

inline static

Returns a random permutation on five elements.

All permutations are returned with equal probability.

The implementation uses the C standard ::rand() function for its random number generation.

Returns
  a random permutation.

## rand() [5/5]

Perm< 4 > regina::Perm< 4 >::rand | ( |  | ) |

inline static

Returns a random permutation on four elements.

All permutations are returned with equal probability.

The implementation uses the C standard ::rand() function for its random number generation.

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).

Parameters

  n | the 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).

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.

Parameters

  n | the 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

  newNum | the new numerator.
  newDen | the 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

  value | the new integer value of this rational.

## Rational() [4/6]

regina::Rational::Rational | ( | const Rational & | value | ) |

inline

Initialises to the given rational value.

Parameters

  value | the 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

  newNum | the new numerator.
  newDen | the new denominator.

## Rational() [6/6]

regina::Rational::Rational | ( | long | value | ) |

inline

Initialises to the given integer value.

Parameters

  value | the 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 | ( |  | ) | const

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

  cloneMe | the 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

  length | the number of elements in the new vector.

## reduceCol()

template<typename T >

void regina::MatrixIntDomain< T >::reduceCol | ( | unsigned long | col | ) |

inline

Reduces the given column by dividing all its elements by their greatest common divisor.

It is guaranteed that, if the column is changed at all, it will be divided by a positive integer.

Precondition
  The given column number is between 0 and columns()-1 inclusive.

Parameters

  col | the index of the column to reduce.

## 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

  k | the number to reduce modulo modBase.
  modBase | the modular base in which to work.

## reduceRow()

template<typename T >

void regina::MatrixIntDomain< T >::reduceRow | ( | unsigned long | row | ) |

Reduces the given row by dividing all its elements by their greatest common divisor.

It is guaranteed that, if the row is changed at all, it will be divided by a positive integer.

Precondition
  The given row number is between 0 and rows()-1 inclusive.

Parameters

  row | the index of the row to reduce.

## reverse() [1/5]

template<int n>

Perm< n > regina::Perm< n >::reverse | ( |  | ) | const

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< 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.

## reverse() [5/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.

## 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

  matrix | the 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

  input | the input matrix whose row space we will describe; this matrix will be changed (though only by swapping rows).
  complement | the 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 >

unsigned long regina::Matrix< T >::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()

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.

## set()

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

  exp | the exponent of the term whose coefficient should be changed.
  value | the 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

  index | the vector index to examine.
  value | the 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

  code | the 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

  code | the 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

  code | the 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

  code | the 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

  newCode | the 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

  code | the 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

  fromData | the raw GMP integer to clone.

## sign() [1/7]

template<int n>

int regina::Perm< n >::sign | ( |  | ) | const

Determines the sign of this permutation.

Returns
  1 if this permutation is even, or -1 if this permutation is odd.

## sign() [2/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() [3/7]

template<bool supportInfinity>

int regina::IntegerBase< supportInfinity >::sign | ( |  | ) | const

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() [4/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() [5/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.

## 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]

template<int bytes>

int regina::NativeInteger< bytes >::sign | ( |  | ) | const

inline

Returns the sign of this integer.

Returns
  +1, -1 or 0 according to whether this integer is positive, negative or zero.

## 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

  m1 | the first matrix to examine.
  m2 | the 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

  pair1first | the first matrix of the first pair to examine.
  pair1second | the second matrix of the first pair to examine.
  pair2first | the first matrix of the second pair to examine.
  pair2second | the 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 | ( |  | ) |

inline static

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

  matrix | the 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

  matrix | the 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.
  rowSpaceBasis | used to return a change of basis matrix (see above for details).
  rowSpaceBasisInv | used to return the inverse of rowSpaceBasis.
  colSpaceBasis | used to return a change of basis matrix (see above for details).
  colSpaceBasisInv | used 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< 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.

## SnIndex() [4/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.

## str() [1/7]

template<int n>

std::string regina::Perm< n >::str | ( |  | ) | const

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/7]

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/7]

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/7]

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() [5/7]

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() [6/7]

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

  variable | the 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() [7/7]

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

  variable | the 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.

## 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

  other | the vector a multiple of which will be subtracted from this vector.
  multiple | the multiple of other to be subtracted from this vector.

## swap() [1/4]

template<bool supportInfinity = false>

void regina::IntegerBase< supportInfinity >::swap | ( | IntegerBase< supportInfinity > & | other | ) |

Swaps the values of this and the given integer.

Parameters

  other | the integer whose value will be swapped with this.

## swap() [2/4]

template<int bytes>

void regina::NativeInteger< bytes >::swap | ( | NativeInteger< bytes > & | other | ) |

inline

Swaps the values of this and the given integer.

Parameters

  other | the integer whose value will be swapped with this.

## swap() [3/4]

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

  other | the polynomial whose contents should be swapped with this.

## swap() [4/4]

void regina::Rational::swap | ( | Rational & | other | ) |

inline

Swaps the values of this and the given rational.

Parameters

  other | the rational whose value will be swapped with this.

## swapColumns()

template<class T >

void regina::Matrix< T >::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

  first | the first column to swap.
  second | the second column to swap.

## swapRows()

template<class T >

void regina::Matrix< T >::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

  first | the first row to swap.
  second | the 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

  input | the n-by-n matrix A, which must be a lift of a genuine automorphism as described above.
  invF | the 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

  len | the 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

  len | the 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

  len | the 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< 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

  len | the length of the prefix required; this must be between 0 and 5 inclusive.

Returns
  the corresponding prefix of the string representation of this permutation.

## trunc() [5/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

  len | the length of the prefix required; this must be between 0 and 4 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< 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.

## trunc2() [3/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.

## trunc3() [1/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.

## trunc3() [2/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.

## 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/2]

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

  variable | the 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() [2/2]

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

  variable | the 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.

## 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

  cloneMe | the 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

  newVectorSize | the 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

  newVectorSize | the number of elements in the new vector; this must be strictly positive.
  initValue | the value to assign to every element of the vector.

## writeMatrix()

template<class T >

void regina::Matrix< T >::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

  out | the 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

  out | the output stream to which to write.

Returns
  a reference to the given output stream.

Author
  Ryan Budney

## writeTextLong()

template<class T >

void regina::Matrix< T >::writeTextLong | ( | std::ostream & | out | ) | const

inline

Writes a detailed text representation of this object to the given output stream.

Python:\n Not present.

Parameters

  out | the output stream to which to write.

## writeTextShort() [1/3]

template<class T >

void regina::Matrix< T >::writeTextShort | ( | std::ostream & | out | ) | const

inline

Writes a short text representation of this object to the given output stream.

Python:\n Not present.

Parameters

  out | the output stream to which to write.

## writeTextShort() [2/3]

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

  out | the output stream to which to write.
  utf8 | `true` if unicode superscript characters may be used.
  variable | the 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/3]

void regina::Cyclotomic::writeTextShort | ( | std::ostream & | out,
|  | bool | utf8 = `false`,
|  | const char * | variable = `0`
| ) |  | 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

  out | the output stream to which to write.
  utf8 | `true` if unicode superscript characters may be used.
  variable | the symbol to use for the polynomial variable. This may be `null`, in which case the default variable `x` 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.

## ~Matrix()

template<class T >

regina::Matrix< T >::~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

## data

template<class T >

T** regina::Matrix< T >::data

protected

The actual entries in the matrix.

`data[r][c]` is the element in row r, column c.

## 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

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]

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.

## imageBits [2/2]

template<int n>

constexpr int regina::Perm< n >::imageBits = regina::bitsRequired(n)

static constexpr

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.

## infinity [1/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.

## infinity [2/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.

## 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< 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 [2/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 [3/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.

## invSn [4/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.

## 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!

## nCols

template<class T >

unsigned long regina::Matrix< T >::nCols

protected

The number of columns in the matrix.

## nPerms [1/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 [2/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 [3/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 [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]

template<int n>

constexpr Perm< n >::Index regina::Perm< n >::nPerms = factorial(n)

static constexpr

The total number of permutations on n elements.

This is the size of the symmetric group Sn.

## nPerms_1 [1/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 [2/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.

## nPerms_1 [3/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 [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]

template<int n>

constexpr Perm< n >::Index regina::Perm< n >::nPerms_1 = factorial(n-1)

static constexpr

The total number of permutations on n-1 elements.

This is the size of the symmetric group Sn-1.

## nRows

template<class T >

unsigned long regina::Matrix< T >::nRows

protected

The number of rows in the matrix.

## one [1/4]

const Rational regina::Rational::one

static

Globally available one.

## one [2/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!

## one [3/4]

template<bool supportInfinity = false>

const IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::one

static

Globally available one.

## one [4/4]

template<class T >

const T regina::MatrixRing< T >::one

static

One (the multiplicative identity) in the underlying ring.

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<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.

## 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<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 [4/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.

## 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<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 [2/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 [3/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 [4/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_1 [1/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 [2/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).

## Sn_1 [3/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 [4/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).

## undefined

const Rational regina::Rational::undefined

static

Globally available undefined.

This is represented as 0/0.

## zero [1/4]

const Rational regina::Rational::zero

static

Globally available zero.

## zero [2/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!

## zero [3/4]

template<bool supportInfinity = false>

const IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::zero

static

Globally available zero.

## zero [4/4]

template<class T >

const T regina::MatrixRing< T >::zero

static

Zero in the underlying ring.

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<< [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

  out | the output stream to which to write.
  mat | the 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

  out | the output stream to which to write.
  rat | the rational to write.

Returns
  a reference to out.

Copyright © 1999-2016, 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).