Regina Calculation Engine
|
Underlying mathematical gruntwork. More...
Namespaces | |
regina::detail | |
Contains implementation details and common functionality for Regina's dimension-agnostic classes. | |
Classes | |
class | regina::Cyclotomic |
Represents an element of a cyclotomic field. More... | |
class | regina::NativeInteger< bytes > |
A wrapper class for a native, fixed-precision integer type of the given size. More... | |
struct | regina::InfinityBase< supportInfinity > |
Internal base classes for use with IntegerBase, templated on whether we should support infinity as an allowed value. More... | |
class | regina::IntegerBase< supportInfinity > |
Represents an arbitrary precision integer. More... | |
class | regina::Laurent< T > |
Represents a single-variable Laurent polynomial with coefficients of type T. More... | |
class | regina::Laurent2< T > |
Represents a Laurent polynomial in the two variables x, y with coefficients of type T. More... | |
struct | regina::MatrixRingIdentities< T, ring > |
Provides additive and multiplicative identity constants for the Matrix class. More... | |
class | regina::Matrix< T, ring > |
Represents a matrix of elements of the given type T. More... | |
class | regina::Matrix2 |
Represents a 2-by-2 integer matrix. More... | |
class | regina::Perm< n > |
Represents a permutation of {0,1,...,n-1}. More... | |
class | regina::Polynomial< T > |
Represents a single-variable polynomial with coefficients of type T. More... | |
class | regina::Primes |
A helper class for finding primes and factorising integers. More... | |
class | regina::Rational |
Represents an arbitrary precision rational number. More... | |
class | regina::Ray |
A fast class for storing a ray rooted at the origin that passes through an integer point. More... | |
class | regina::Perm< 2 > |
Represents a permutation of {0,1}. More... | |
class | regina::Perm< 3 > |
Represents a permutation of {0,1,2}. More... | |
class | regina::Perm< 4 > |
Represents a permutation of {0,1,2,3}. More... | |
class | regina::Perm< 5 > |
Represents a permutation of {0,1,2,3,4}. More... | |
class | regina::Vector< T > |
An optimised vector class of elements from a given ring T. More... | |
Typedefs | |
typedef Rational | regina::Cyclotomic::Coefficient |
The type of each coefficient of the polynomial that is used to store a field element. More... | |
typedef Cyclotomic | regina::NCyclotomic |
Deprecated typedef for backward compatibility. More... | |
typedef IntegerBase< true > | regina::LargeInteger |
LargeInteger is a typedef for IntegerBase<true>, which offers arbitrary precision integers with support for infinity. More... | |
typedef IntegerBase< false > | regina::Integer |
Integer is a typedef for IntegerBase<false>, which offers arbitrary precision integers without support for infinity. More... | |
typedef IntOfSize< bytes >::type | regina::NativeInteger< bytes >::Native |
The native data type used to store this integer. More... | |
typedef NativeInteger< sizeof(long)> | regina::NNativeLong |
NNativeLong is a typedef for the NativeInteger template class whose underlying integer type is a native long. More... | |
typedef Integer | regina::NInteger |
Deprecated typedef for backward compatibility. More... | |
typedef LargeInteger | regina::NLargeInteger |
Deprecated typedef for backward compatibility. More... | |
template<int bytes> | |
using | regina::NNativeInteger = NativeInteger< bytes > |
Deprecated typedef for backward compatibility. More... | |
typedef T | regina::Laurent< T >::Coefficient |
The type of each coefficient of the polynomial. More... | |
typedef T | regina::Laurent2< T >::Coefficient |
The type of each coefficient of the polynomial. More... | |
typedef T | regina::Matrix< T, ring >::Coefficient |
The type of each entry in the matrix. More... | |
template<class T > | |
using | regina::MatrixRing = Matrix< T, true > |
Deprecated typedef for backward compatibility. More... | |
template<class T > | |
using | regina::MatrixIntDomain = Matrix< T, true > |
Deprecated typedef for backward compatibility. More... | |
template<class T > | |
using | regina::NMatrix = Matrix< T, false > |
Deprecated typedef for backward compatibility. More... | |
template<class T > | |
using | regina::NMatrixRing = Matrix< T, true > |
Deprecated typedef for backward compatibility. More... | |
typedef MatrixInt | regina::NMatrixInt |
Deprecated typedef for backward compatibility. More... | |
typedef Matrix2 | regina::NMatrix2 |
Deprecated typedef for backward compatibility. More... | |
typedef IntOfMinSize<(imageBits *n+7)/8 >::type | regina::Perm< n >::Index |
Denotes a native signed integer type large enough to count all permutations on n elements. More... | |
typedef IntOfMinSize<(imageBits *n+7)/8 >::utype | regina::Perm< n >::Code |
Indicates the native unsigned integer type used to store the internal permutation code. More... | |
template<int n> | |
using | regina::NPerm = Perm< n > |
Deprecated typedef for backward compatibility. More... | |
typedef T | regina::Polynomial< T >::Coefficient |
The type of each coefficient of the polynomial. More... | |
template<typename T > | |
using | regina::NPolynomial = Polynomial< T > |
Deprecated typedef for backward compatibility. More... | |
typedef Primes | regina::NPrimes |
Deprecated typedef for backward compatibility. More... | |
typedef Rational | regina::NRational |
Deprecated typedef for backward compatibility. More... | |
typedef Ray | regina::NRay |
Deprecated typedef for backward compatibility. More... | |
typedef int | regina::Perm< 2 >::Index |
Denotes a native signed integer type large enough to count all permutations on two elements. More... | |
typedef uint8_t | regina::Perm< 2 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code. More... | |
typedef Perm< 2 > | regina::NPerm2 |
Deprecated typedef for backward compatibility. More... | |
typedef int | regina::Perm< 3 >::Index |
Denotes a native signed integer type large enough to count all permutations on three elements. More... | |
typedef uint8_t | regina::Perm< 3 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code. More... | |
typedef Perm< 3 > | regina::NPerm3 |
Deprecated typedef for backward compatibility. More... | |
typedef int | regina::Perm< 4 >::Index |
Denotes a native signed integer type large enough to count all permutations on four elements. More... | |
typedef uint8_t | regina::Perm< 4 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code. More... | |
typedef Perm< 4 > | regina::NPerm4 |
Deprecated typedef for backward compatibility. More... | |
typedef int | regina::Perm< 5 >::Index |
Denotes a native signed integer type large enough to count all permutations on five elements. More... | |
typedef uint16_t | regina::Perm< 5 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code. More... | |
typedef Perm< 5 > | regina::NPerm5 |
Deprecated typedef for backward compatibility. More... | |
template<class T > | |
using | regina::NVector = Vector< T > |
Deprecated typedef for backward compatibility. More... | |
Enumerations | |
enum | { regina::Perm< 3 >::code012 = 0, regina::Perm< 3 >::code021 = 1, regina::Perm< 3 >::code120 = 2, regina::Perm< 3 >::code102 = 3, regina::Perm< 3 >::code201 = 4, regina::Perm< 3 >::code210 = 5 } |
Functions | |
template<class R > | |
bool | regina::isZero (R x) |
Deprecated routine for managing floating-point roundoff errors. More... | |
template<class R > | |
bool | regina::isNonZero (R x) |
Deprecated routine for managing floating-point roundoff errors. More... | |
template<class R > | |
bool | regina::isPositive (R x) |
Deprecated routine for managing floating-point roundoff errors. More... | |
template<class R > | |
bool | regina::isNegative (R x) |
Deprecated routine for managing floating-point roundoff errors. More... | |
template<class R > | |
bool | regina::isNonNegative (R x) |
Deprecated routine for managing floating-point roundoff errors. More... | |
template<class R > | |
bool | regina::isNonPositive (R x) |
Deprecated routine for managing floating-point roundoff errors. More... | |
int | regina::binomSmall (int n, int k) |
Returns the binomial coefficient n choose k in constant time for small arguments (n ≤ 16). More... | |
long | regina::binomMedium (int n, int k) |
Returns the binomial coefficient n choose k in linear time for medium-sized arguments (n ≤ 29). More... | |
regina::Cyclotomic::Cyclotomic () | |
Creates an uninitialised field element. More... | |
regina::Cyclotomic::Cyclotomic (size_t field) | |
Creates the zero element of the given cyclotomic field. More... | |
regina::Cyclotomic::Cyclotomic (size_t field, int value) | |
Creates the given integer element within the given cyclotomic field. More... | |
regina::Cyclotomic::Cyclotomic (size_t field, const Rational &value) | |
Creates the given rational element within the given cyclotomic field. More... | |
regina::Cyclotomic::Cyclotomic (const Cyclotomic &value) | |
Creates a copy of the given field element, within the same cyclotomic field. More... | |
regina::Cyclotomic::Cyclotomic (Cyclotomic &&value) noexcept | |
Moves the contents of the given field element to this new field element. More... | |
regina::Cyclotomic::Cyclotomic (size_t field, std::initializer_list< Rational > coefficients) | |
Creates a new field element from a hard-coded sequence of coefficients. More... | |
regina::Cyclotomic::~Cyclotomic () | |
Destroys this field element. More... | |
void | regina::Cyclotomic::init (size_t field) |
Initialises this to be the zero element of the given cyclotomic field. More... | |
size_t | regina::Cyclotomic::field () const |
Returns the order n of the underlying cyclotomic field to which this element belongs. More... | |
size_t | regina::Cyclotomic::degree () const |
Returns the degree of the polynomial that defines the underlying cyclotomic field. More... | |
const 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= (Cyclotomic &&value) noexcept |
Moves the contents of the given field element to this 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::inverse () const |
Returns the inverse of 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=nullptr) const |
Writes this field element to the given output stream, using the given variable name instead of x . More... | |
std::string | regina::Cyclotomic::str (const char *variable) const |
Returns this field element as a human-readable string, using the given variable name instead of x . More... | |
std::string | regina::Cyclotomic::utf8 (const char *variable) const |
Returns this field element as a human-readable string using unicode characters, using the given variable name instead of x . More... | |
Cyclotomic | regina::operator* (Cyclotomic elt, const Rational &scalar) |
Multiplies the given field element by the given rational. More... | |
Cyclotomic | regina::operator* (const Rational &scalar, Cyclotomic elt) |
Multiplies the given field element by the given rational. More... | |
Cyclotomic | regina::operator/ (Cyclotomic elt, const Rational &scalar) |
Divides the given field element by the given rational. More... | |
Cyclotomic | regina::operator+ (const Cyclotomic &lhs, const Cyclotomic &rhs) |
Adds the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator+ (Cyclotomic &&lhs, const Cyclotomic &rhs) |
Adds the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator+ (const Cyclotomic &lhs, Cyclotomic &&rhs) |
Adds the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator+ (Cyclotomic &&lhs, Cyclotomic &&rhs) |
Adds the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator- (Cyclotomic arg) |
Returns the negative of the given field element. More... | |
Cyclotomic | regina::operator- (const Cyclotomic &lhs, const Cyclotomic &rhs) |
Subtracts the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator- (Cyclotomic &&lhs, const Cyclotomic &rhs) |
Subtracts the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator- (const Cyclotomic &lhs, Cyclotomic &&rhs) |
Subtracts the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator- (Cyclotomic &&lhs, Cyclotomic &&rhs) |
Subtracts the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator* (const Cyclotomic &lhs, const Cyclotomic &rhs) |
Multiplies the two given cyclotomic field elements. More... | |
Cyclotomic | regina::operator/ (const Cyclotomic &lhs, const Cyclotomic &rhs) |
Divides the two given cyclotomic field elements. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase () | |
Initialises this integer to zero. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (int value) | |
Initialises this integer to the given value. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (unsigned value) | |
Initialises this integer to the given value. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (long value) | |
Initialises this integer to the given value. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (unsigned long value) | |
Initialises this integer to the given value. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (const IntegerBase< supportInfinity > &value) | |
Initialises this integer to the given value. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (const IntegerBase<! supportInfinity > &value) | |
Initialises this integer to the given value. More... | |
template<int bytes> | |
regina::IntegerBase< supportInfinity >::IntegerBase (const NativeInteger< bytes > &value) | |
Initialises this integer to the given value. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (Long value) | |
Initialises this to the given Python arbitrary-precision integer. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (double value) | |
Initialises this integer to the truncation of the given real number. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (const char *value, int base=10, bool *valid=nullptr) | |
Initialises this integer to the given value which is represented as a string of digits in a given base. More... | |
regina::IntegerBase< supportInfinity >::IntegerBase (const std::string &value, int base=10, bool *valid=nullptr) | |
Initialises this integer to the given value which is represented as a string of digits in a given base. More... | |
regina::IntegerBase< supportInfinity >::~IntegerBase () | |
Destroys this integer. More... | |
bool | regina::IntegerBase< supportInfinity >::isNative () const |
Returns whether we are currently working with a native C/C++ long, or whether we have switched to GMP large integer arithmetic for this integer. More... | |
bool | regina::IntegerBase< supportInfinity >::isZero () const |
Returns whether or not this integer is zero. More... | |
int | regina::IntegerBase< supportInfinity >::sign () const |
Returns the sign of this integer. More... | |
bool | regina::IntegerBase< supportInfinity >::isInfinite () const |
Returns whether this integer is infinity. More... | |
void | regina::IntegerBase< supportInfinity >::makeInfinite () |
Sets this integer to be infinity. More... | |
long | regina::IntegerBase< supportInfinity >::longValue () const |
Returns the value of this integer as a long. More... | |
template<int bytes> | |
IntOfSize< bytes >::type | regina::IntegerBase< supportInfinity >::nativeValue () const |
Returns the value of this integer as a native integer of some fixed byte length. More... | |
std::string | regina::IntegerBase< supportInfinity >::stringValue (int base=10) const |
Returns the value of this integer as a string in the given base. More... | |
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::Laurent< T >::Laurent () | |
Creates the zero polynomial. More... | |
regina::Laurent< T >::Laurent (long exponent) | |
Creates the polynomial x^d for the given exponent d. More... | |
regina::Laurent< T >::Laurent (const Laurent< T > &value) | |
Creates a new copy of the given polynomial. More... | |
template<typename U > | |
regina::Laurent< T >::Laurent (const Laurent< U > &value) | |
Creates a new copy of the given polynomial. More... | |
regina::Laurent< T >::Laurent (Laurent< T > &&value) noexcept | |
Moves the contents of the given polynomial to this new polynomial. More... | |
template<typename iterator > | |
regina::Laurent< T >::Laurent (long minExp, iterator begin, iterator end) | |
Creates a new polynomial from the given sequence of coefficients. More... | |
regina::Laurent< T >::Laurent (long minExp, std::initializer_list< T > coefficients) | |
Creates a new polynomial from a hard-coded sequence of coefficients. More... | |
regina::Laurent< T >::~Laurent () | |
Destroys this polynomial. More... | |
void | regina::Laurent< T >::init () |
Sets this to become the zero polynomial. More... | |
void | regina::Laurent< T >::init (long exponent) |
Sets this to become the polynomial x^d for the given exponent d. More... | |
template<typename iterator > | |
void | regina::Laurent< T >::init (long minExp, iterator begin, iterator end) |
Sets this to become the polynomial described by the given sequence of coefficients. More... | |
long | regina::Laurent< T >::minExp () const |
Returns the smallest exponent that appears in this polynomial with a non-zero coefficient. More... | |
long | regina::Laurent< T >::maxExp () const |
Returns the largest exponent that appears in this polynomial with a non-zero coefficient. More... | |
bool | regina::Laurent< T >::isZero () const |
Returns whether this is the zero polynomial. More... | |
const T & | regina::Laurent< T >::operator[] (long exp) const |
Returns the given coefficient of this polynomial. More... | |
void | regina::Laurent< T >::set (long exp, const T &value) |
Changes the given coefficient of this polynomial. More... | |
bool | regina::Laurent< T >::operator== (const Laurent< T > &rhs) const |
Tests whether this and the given polynomial are equal. More... | |
bool | regina::Laurent< T >::operator!= (const Laurent< T > &rhs) const |
Tests whether this and the given polynomial are not equal. More... | |
Laurent & | regina::Laurent< T >::operator= (const Laurent< T > &value) |
Sets this to be a copy of the given polynomial. More... | |
template<typename U > | |
Laurent & | regina::Laurent< T >::operator= (const Laurent< U > &value) |
Sets this to be a copy of the given polynomial. More... | |
Laurent & | regina::Laurent< T >::operator= (Laurent< T > &&value) noexcept |
Moves the contents of the given polynomial to this polynomial. More... | |
void | regina::Laurent< T >::swap (Laurent< T > &other) |
Swaps the contents of this and the given polynomial. More... | |
void | regina::Laurent< T >::shift (long s) |
Multiplies this polynomial by x^s for some integer s. More... | |
void | regina::Laurent< T >::scaleUp (long k) |
Multiplies all exponents in this polynomial by k for some integer k. More... | |
void | regina::Laurent< T >::scaleDown (long k) |
Divides all exponents in this polynomial by k for some integer k. More... | |
void | regina::Laurent< T >::negate () |
Negates this polynomial. More... | |
Laurent & | regina::Laurent< T >::operator*= (const T &scalar) |
Multiplies this polynomial by the given constant. More... | |
Laurent & | regina::Laurent< T >::operator/= (const T &scalar) |
Divides this polynomial by the given constant. More... | |
Laurent & | regina::Laurent< T >::operator+= (const Laurent< T > &other) |
Adds the given polynomial to this. More... | |
Laurent & | regina::Laurent< T >::operator-= (const Laurent< T > &other) |
Subtracts the given polynomial from this. More... | |
Laurent & | regina::Laurent< T >::operator*= (const Laurent< T > &other) |
Multiplies this by the given polynomial. More... | |
void | regina::Laurent< T >::writeTextShort (std::ostream &out, bool utf8=false, const char *variable=nullptr) const |
Writes this polynomial to the given output stream, using the given variable name instead of x . More... | |
std::string | regina::Laurent< T >::str (const char *variable) const |
Returns this polynomial as a human-readable string, using the given variable name instead of x . More... | |
std::string | regina::Laurent< T >::utf8 (const char *variable) const |
Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x . More... | |
template<typename T > | |
Laurent< T > | regina::operator* (Laurent< T > poly, const typename Laurent< T >::Coefficient &scalar) |
Multiplies the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Laurent< T > | regina::operator* (const typename Laurent< T >::Coefficient &scalar, Laurent< T > poly) |
Multiplies the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Laurent< T > | regina::operator/ (Laurent< T > poly, const typename Laurent< T >::Coefficient &scalar) |
Divides the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Laurent< T > | regina::operator+ (const Laurent< T > &lhs, const Laurent< T > &rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator+ (Laurent< T > &&lhs, const Laurent< T > &rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator+ (const Laurent< T > &lhs, Laurent< T > &&rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator+ (Laurent< T > &&lhs, Laurent< T > &&rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator- (Laurent< T > arg) |
Returns the negative of the given polynomial. More... | |
template<typename T > | |
Laurent< T > | regina::operator- (const Laurent< T > &lhs, const Laurent< T > &rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator- (Laurent< T > &&lhs, const Laurent< T > &rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator- (const Laurent< T > &lhs, Laurent< T > &&rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator- (Laurent< T > &&lhs, Laurent< T > &&rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent< T > | regina::operator* (const Laurent< T > &lhs, const Laurent< T > &rhs) |
Multiplies the two given polynomials. More... | |
regina::Laurent2< T >::Laurent2 ()=default | |
Creates the zero polynomial. More... | |
regina::Laurent2< T >::Laurent2 (long xExp, long yExp) | |
Creates the polynomial x^d y^e for the given exponents d and e. More... | |
regina::Laurent2< T >::Laurent2 (const Laurent2< T > &value) | |
Creates a new copy of the given polynomial. More... | |
regina::Laurent2< T >::Laurent2 (Laurent2< T > &&value) noexcept=default | |
Moves the contents of the given polynomial to this new polynomial. More... | |
regina::Laurent2< T >::Laurent2 (const Laurent2< T > &toShift, long xShift, long yShift) | |
Creates a copy of the given polynomial with all terms multiplied by x^d y^e for some integers d and e. More... | |
template<typename U > | |
regina::Laurent2< T >::Laurent2 (const Laurent2< U > &value) | |
Creates a new copy of the given polynomial. More... | |
regina::Laurent2< T >::Laurent2 (std::initializer_list< std::tuple< long, long, T >> coefficients) | |
Creates a new polynomial from a hard-coded collection of non-zero coefficients. More... | |
void | regina::Laurent2< T >::init () |
Sets this to become the zero polynomial. More... | |
void | regina::Laurent2< T >::init (long xExp, long yExp) |
Sets this to become the polynomial x^d y^e for the given exponents d and e. More... | |
bool | regina::Laurent2< T >::isZero () const |
Returns whether this is the zero polynomial. More... | |
const T & | regina::Laurent2< T >::operator() (long xExp, long yExp) const |
Returns the given coefficient of this polynomial. More... | |
void | regina::Laurent2< T >::set (long xExp, long yExp, const T &value) |
Changes the given coefficient of this polynomial. More... | |
bool | regina::Laurent2< T >::operator== (const Laurent2< T > &rhs) const |
Tests whether this and the given polynomial are equal. More... | |
bool | regina::Laurent2< T >::operator!= (const Laurent2< T > &rhs) const |
Tests whether this and the given polynomial are not equal. More... | |
Laurent2 & | regina::Laurent2< T >::operator= (const Laurent2< T > &value) |
Sets this to be a copy of the given polynomial. More... | |
template<typename U > | |
Laurent2 & | regina::Laurent2< T >::operator= (const Laurent2< U > &value) |
Sets this to be a copy of the given polynomial. More... | |
Laurent2 & | regina::Laurent2< T >::operator= (Laurent2< T > &&value) noexcept=default |
Moves the contents of the given polynomial to this polynomial. More... | |
void | regina::Laurent2< T >::swap (Laurent2< T > &other) |
Swaps the contents of this and the given polynomial. More... | |
void | regina::Laurent2< T >::negate () |
Negates this polynomial. More... | |
Laurent2 & | regina::Laurent2< T >::operator*= (const T &scalar) |
Multiplies this polynomial by the given constant. More... | |
Laurent2 & | regina::Laurent2< T >::operator/= (const T &scalar) |
Divides this polynomial by the given constant. More... | |
Laurent2 & | regina::Laurent2< T >::operator+= (const Laurent2< T > &other) |
Adds the given polynomial to this. More... | |
Laurent2 & | regina::Laurent2< T >::operator-= (const Laurent2< T > &other) |
Subtracts the given polynomial from this. More... | |
Laurent2 & | regina::Laurent2< T >::operator*= (const Laurent2< T > &other) |
Multiplies this by the given polynomial. More... | |
void | regina::Laurent2< T >::writeTextShort (std::ostream &out, bool utf8=false, const char *varX=nullptr, const char *varY=nullptr) const |
Writes this polynomial to the given output stream, using the given variable names instead of x and y . More... | |
std::string | regina::Laurent2< T >::str (const char *varX, const char *varY=nullptr) const |
Returns this polynomial as a human-readable string, using the given variable names instead of x and y . More... | |
std::string | regina::Laurent2< T >::utf8 (const char *varX, const char *varY=nullptr) const |
Returns this polynomial as a human-readable string using unicode characters, using the given variable names instead of x and y . More... | |
template<typename T > | |
Laurent2< T > | regina::operator* (Laurent2< T > poly, const typename Laurent2< T >::Coefficient &scalar) |
Multiplies the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Laurent2< T > | regina::operator* (const typename Laurent2< T >::Coefficient &scalar, Laurent2< T > poly) |
Multiplies the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Laurent2< T > | regina::operator/ (Laurent2< T > poly, const typename Laurent2< T >::Coefficient &scalar) |
Divides the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Laurent2< T > | regina::operator+ (const Laurent2< T > &lhs, const Laurent2< T > &rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator+ (Laurent2< T > &&lhs, const Laurent2< T > &rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator+ (const Laurent2< T > &lhs, Laurent2< T > &&rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator+ (Laurent2< T > &&lhs, Laurent2< T > &&rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator- (Laurent2< T > arg) |
Returns the negative of the given polynomial. More... | |
template<typename T > | |
Laurent2< T > | regina::operator- (const Laurent2< T > &lhs, const Laurent2< T > &rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator- (Laurent2< T > &&lhs, const Laurent2< T > &rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator- (const Laurent2< T > &lhs, Laurent2< T > &&rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator- (Laurent2< T > &&lhs, Laurent2< T > &&rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Laurent2< T > | regina::operator* (const Laurent2< T > &lhs, const Laurent2< T > &rhs) |
Multiplies the two given polynomials. More... | |
regina::Matrix< T, ring >::Matrix (unsigned long rows, unsigned long cols) | |
Creates a new matrix of the given size. More... | |
regina::Matrix< T, ring >::Matrix (const Matrix &src) | |
Creates a new matrix that is a clone of the given matrix. More... | |
regina::Matrix< T, ring >::Matrix (Matrix &&src) noexcept | |
Moves the given matrix into this new matrix. More... | |
regina::Matrix< T, ring >::~Matrix () | |
Destroys this matrix. More... | |
Matrix & | regina::Matrix< T, ring >::operator= (const Matrix &src) |
Copies the given matrix into this matrix. More... | |
Matrix & | regina::Matrix< T, ring >::operator= (Matrix &&src) noexcept |
Moves the given matrix into this matrix. More... | |
void | regina::Matrix< T, ring >::initialise (const T &value) |
Sets every entry in the matrix to the given value. More... | |
void | regina::Matrix< T, ring >::initialise (List allValues) |
A Python-only routine that fills the matrix with the given set of elements. More... | |
unsigned long | regina::Matrix< T, ring >::rows () const |
Returns the number of rows in this matrix. More... | |
unsigned long | regina::Matrix< T, ring >::columns () const |
Returns the number of columns in this matrix. More... | |
T & | regina::Matrix< T, ring >::entry (unsigned long row, unsigned long column) |
Returns the entry at the given row and column. More... | |
const T & | regina::Matrix< T, ring >::entry (unsigned long row, unsigned long column) const |
Returns the entry at the given row and column. More... | |
bool | regina::Matrix< T, ring >::operator== (const Matrix &other) const |
Determines whether this and the given matrix are identical. More... | |
bool | regina::Matrix< T, ring >::operator!= (const Matrix &other) const |
Determines whether this and the given matrix are different. More... | |
void | regina::Matrix< T, ring >::writeMatrix (std::ostream &out) const |
Writes a complete representation of the matrix to the given output stream. More... | |
void | regina::Matrix< T, ring >::swapRows (unsigned long first, unsigned long second) |
Swaps the elements of the two given rows in the matrix. More... | |
void | regina::Matrix< T, ring >::swapColumns (unsigned long first, unsigned long second) |
Swaps the elements of the two given columns in the matrix. More... | |
void | regina::Matrix< T, ring >::writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
void | regina::Matrix< T, ring >::writeTextLong (std::ostream &out) const |
Writes a detailed text representation of this object to the given output stream. More... | |
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_RING_STATIC (Matrix) identity(unsigned long size) | |
Returns an identity matrix of the given size. More... | |
void | regina::Matrix< T, ring >::makeIdentity () |
Turns this matrix into an identity matrix. More... | |
bool | regina::Matrix< T, ring >::isIdentity () const |
Determines whether this matrix is a square identity matrix. More... | |
bool | regina::Matrix< T, ring >::isZero () const |
Determines whether this is the zero matrix. More... | |
void | regina::Matrix< T, ring >::addRow (unsigned long source, unsigned long dest) |
Adds the given source row to the given destination row. More... | |
void | regina::Matrix< T, ring >::addRow (unsigned long source, unsigned long dest, T copies) |
Adds the given number of copies of the given source row to the given destination row. More... | |
void | regina::Matrix< T, ring >::addCol (unsigned long source, unsigned long dest) |
Adds the given source column to the given destination column. More... | |
void | regina::Matrix< T, ring >::addCol (unsigned long source, unsigned long dest, T copies) |
Adds the given number of copies of the given source column to the given destination column. More... | |
void | regina::Matrix< T, ring >::multRow (unsigned long row, T factor) |
Multiplies the given row by the given factor. More... | |
void | regina::Matrix< T, ring >::multCol (unsigned long column, T factor) |
Multiplies the given column by the given factor. More... | |
Matrix | regina::Matrix< T, ring >::operator* (const Matrix &other) const |
Multiplies this by the given matrix, and returns the result. More... | |
Matrix | regina::Matrix< T, ring >::multiplyAs (const Matrix &other) const |
Deprecated alias for the multiplication operator. More... | |
T | regina::Matrix< T, ring >::det () const |
Evaluates the determinant of the matrix. More... | |
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER (void) divRowExact(unsigned long row | |
Divides all elements of the given row by the given integer. More... | |
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER (T) gcdRow(unsigned long row) | |
Computes the greatest common divisor of all elements of the given row. More... | |
regina::Matrix2::Matrix2 () | |
Initialises to the zero matrix. More... | |
regina::Matrix2::Matrix2 (const Matrix2 &cloneMe) | |
Initialises to a copy of the given matrix. More... | |
regina::Matrix2::Matrix2 (const long values[2][2]) | |
Initialises to the given integer values. More... | |
regina::Matrix2::Matrix2 (long val00, long val01, long val10, long val11) | |
Initialises to the given integer values. More... | |
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)=default | |
Creates a permutation that is a clone of the given permutation. More... | |
Code | regina::Perm< n >::permCode () const |
Returns the internal code representing this permutation. More... | |
void | regina::Perm< n >::setPermCode (Code code) |
Sets this permutation to that represented by the given internal code. More... | |
static Perm | regina::Perm< n >::fromPermCode (Code code) |
Creates a permutation from the given internal code. More... | |
static bool | regina::Perm< n >::isPermCode (Code newCode) |
Determines whether the given integer is a valid internal permutation code. More... | |
Perm & | regina::Perm< n >::operator= (const Perm &cloneMe)=default |
Sets this permutation to be equal to the given permutation. More... | |
Perm | regina::Perm< n >::operator* (const Perm &q) const |
Returns the composition of this permutation with the given permutation. More... | |
Perm | regina::Perm< n >::inverse () const |
Finds the inverse of this permutation. More... | |
Perm | regina::Perm< n >::reverse () const |
Finds the reverse of this permutation. More... | |
int | regina::Perm< n >::sign () const |
Determines the sign of this permutation. More... | |
int | regina::Perm< n >::operator[] (int source) const |
Determines the image of the given integer under this permutation. More... | |
int | regina::Perm< n >::preImageOf (int image) const |
Determines the preimage of the given integer under this permutation. More... | |
bool | regina::Perm< n >::operator== (const Perm &other) const |
Determines if this is equal to the given permutation. More... | |
bool | regina::Perm< n >::operator!= (const Perm &other) const |
Determines if this differs from the given permutation. More... | |
int | regina::Perm< n >::compareWith (const Perm &other) const |
Lexicographically compares the images of (0,1,...,n-1) under this and the given permutation. More... | |
bool | regina::Perm< n >::isIdentity () const |
Determines if this is the identity permutation. More... | |
static Perm | regina::Perm< n >::atIndex (Index i) |
Returns the ith permutation on n elements, where permutations are numbered lexicographically beginning at 0. More... | |
Index | regina::Perm< n >::index () const |
Returns the lexicographical index of this permutation. More... | |
static Perm | regina::Perm< n >::rand (bool even=false) |
Returns a random permutation on n elements. More... | |
template<class URBG > | |
static Perm | regina::Perm< n >::rand (URBG &&gen, bool even=false) |
Returns a random permutation on n elements, using the given uniform random bit generator. More... | |
std::string | regina::Perm< n >::str () const |
Returns a string representation of this permutation. More... | |
std::string | regina::Perm< n >::trunc (unsigned len) const |
Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More... | |
void | regina::Perm< n >::clear (unsigned from) |
Resets the images of all integers from from onwards to the identity map. More... | |
template<int k> | |
static Perm | regina::Perm< n >::extend (Perm< k > p) |
Extends a k-element permutation to an n-element permutation, where 2 ≤ k < n. More... | |
template<int k> | |
static Perm | regina::Perm< n >::contract (Perm< k > p) |
Restricts a k-element permutation to an n-element permutation, where k > n. More... | |
template<int n> | |
std::ostream & | regina::operator<< (std::ostream &out, const Perm< n > &p) |
Writes a string representation of the given permutation to the given output stream. More... | |
regina::Polynomial< T >::Polynomial () | |
Creates the zero polynomial. More... | |
regina::Polynomial< T >::Polynomial (size_t degree) | |
Creates the polynomial x^d for the given degree d. More... | |
regina::Polynomial< T >::Polynomial (const Polynomial< T > &value) | |
Creates a new copy of the given polynomial. More... | |
template<typename U > | |
regina::Polynomial< T >::Polynomial (const Polynomial< U > &value) | |
Creates a new copy of the given polynomial. More... | |
regina::Polynomial< T >::Polynomial (Polynomial< T > &&value) noexcept | |
Moves the contents of the given polynomial to this new polynomial. More... | |
template<typename iterator > | |
regina::Polynomial< T >::Polynomial (iterator begin, iterator end) | |
Creates a new polynomial from the given sequence of coefficients. More... | |
regina::Polynomial< T >::Polynomial (std::initializer_list< T > coefficients) | |
Creates a new polynomial from a hard-coded sequence of coefficients. More... | |
regina::Polynomial< T >::~Polynomial () | |
Destroys this polynomial. More... | |
void | regina::Polynomial< T >::init () |
Sets this to become the zero polynomial. More... | |
void | regina::Polynomial< T >::init (size_t degree) |
Sets this to become the polynomial x^d for the given degree d. More... | |
template<typename iterator > | |
void | regina::Polynomial< T >::init (iterator begin, iterator end) |
Sets this to become the polynomial described by the given sequence of coefficients. More... | |
size_t | regina::Polynomial< T >::degree () const |
Returns the degree of this polynomial. More... | |
bool | regina::Polynomial< T >::isZero () const |
Returns whether this is the zero polynomial. More... | |
bool | regina::Polynomial< T >::isMonic () const |
Returns whether this polynomial is monic. More... | |
const T & | regina::Polynomial< T >::leading () const |
Returns the leading coefficient of this polynomial. More... | |
const T & | regina::Polynomial< T >::operator[] (size_t exp) const |
Returns the given coefficient of this polynomial. More... | |
void | regina::Polynomial< T >::set (size_t exp, const T &value) |
Changes the given coefficient of this polynomial. More... | |
bool | regina::Polynomial< T >::operator== (const Polynomial< T > &rhs) const |
Tests whether this and the given polynomial are equal. More... | |
bool | regina::Polynomial< T >::operator!= (const Polynomial< T > &rhs) const |
Tests whether this and the given polynomial are not equal. More... | |
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... | |
Polynomial & | regina::Polynomial< T >::operator= (Polynomial< T > &&value) noexcept |
Moves the contents of the given polynomial to this polynomial. More... | |
void | regina::Polynomial< T >::swap (Polynomial< T > &other) |
Swaps the contents of this and the given polynomial. More... | |
void | regina::Polynomial< T >::negate () |
Negates this polynomial. More... | |
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 > "ient, Polynomial< T > &remainder) const |
Divides this by the given divisor, and extracts both the quotient and the remainder. More... | |
template<typename U > | |
void | regina::Polynomial< T >::gcdWithCoeffs (const Polynomial< U > &other, Polynomial< T > &gcd, Polynomial< T > &u, Polynomial< T > &v) const |
Calculates the greatest common divisor of this and the given polynomial, and finds a linear combination of these polynomials that gives this gcd. More... | |
void | regina::Polynomial< T >::writeTextShort (std::ostream &out, bool utf8=false, const char *variable=0) const |
Writes this polynomial to the given output stream, using the given variable name instead of x . More... | |
std::string | regina::Polynomial< T >::str (const char *variable) const |
Returns this polynomial as a human-readable string, using the given variable name instead of x . More... | |
std::string | regina::Polynomial< T >::utf8 (const char *variable) const |
Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x . More... | |
template<typename T > | |
Polynomial< T > | regina::operator* (Polynomial< T > poly, const typename Polynomial< T >::Coefficient &scalar) |
Multiplies the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Polynomial< T > | regina::operator* (const typename Polynomial< T >::Coefficient &scalar, Polynomial< T > poly) |
Multiplies the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Polynomial< T > | regina::operator/ (Polynomial< T > poly, const typename Polynomial< T >::Coefficient &scalar) |
Divides the given polynomial by the given scalar constant. More... | |
template<typename T > | |
Polynomial< T > | regina::operator+ (const Polynomial< T > &lhs, const Polynomial< T > &rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator+ (Polynomial< T > &&lhs, const Polynomial< T > &rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator+ (const Polynomial< T > &lhs, Polynomial< T > &&rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator+ (Polynomial< T > &&lhs, Polynomial< T > &&rhs) |
Adds the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator- (Polynomial< T > arg) |
Returns the negative of the given polynomial. More... | |
template<typename T > | |
Polynomial< T > | regina::operator- (const Polynomial< T > &lhs, const Polynomial< T > &rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator- (Polynomial< T > &&lhs, const Polynomial< T > &rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator- (const Polynomial< T > &lhs, Polynomial< T > &&rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator- (Polynomial< T > &&lhs, Polynomial< T > &&rhs) |
Subtracts the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator* (const Polynomial< T > &lhs, const Polynomial< T > &rhs) |
Multiplies the two given polynomials. More... | |
template<typename T > | |
Polynomial< T > | regina::operator/ (Polynomial< T > lhs, const Polynomial< T > &rhs) |
Divides the two given polynomials. More... | |
static unsigned long | regina::Primes::size () |
Returns the number of primes (or suspected primes) currently stored. More... | |
static Integer | regina::Primes::prime (unsigned long which, bool autoGrow=true) |
Returns the requested prime (or suspected prime). More... | |
static std::vector< 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)=default | |
Creates a permutation that is a clone of the given permutation. More... | |
Code | regina::Perm< 2 >::permCode () const |
Returns the internal code representing this permutation. More... | |
void | regina::Perm< 2 >::setPermCode (Code code) |
Sets this permutation to that represented by the given internal code. More... | |
static Perm< 2 > | regina::Perm< 2 >::fromPermCode (Code code) |
Creates a permutation from the given internal code. More... | |
static bool | regina::Perm< 2 >::isPermCode (Code code) |
Determines whether the given integer is a valid internal permutation code. More... | |
Perm< 2 > & | regina::Perm< 2 >::operator= (const Perm< 2 > &cloneMe)=default |
Sets this permutation to be equal to the given permutation. More... | |
Perm< 2 > | regina::Perm< 2 >::operator* (const Perm< 2 > &q) const |
Returns the composition of this permutation with the given permutation. More... | |
Perm< 2 > | regina::Perm< 2 >::inverse () const |
Finds the inverse of this permutation. More... | |
Perm< 2 > | regina::Perm< 2 >::reverse () const |
Finds the reverse of this permutation. More... | |
int | regina::Perm< 2 >::sign () const |
Determines the sign of this permutation. More... | |
int | regina::Perm< 2 >::operator[] (int source) const |
Determines the image of the given integer under this permutation. More... | |
int | regina::Perm< 2 >::preImageOf (int image) const |
Determines the preimage of the given integer under this permutation. More... | |
bool | regina::Perm< 2 >::operator== (const Perm< 2 > &other) const |
Determines if this is equal to the given permutation. More... | |
bool | regina::Perm< 2 >::operator!= (const Perm< 2 > &other) const |
Determines if this differs from the given permutation. More... | |
int | regina::Perm< 2 >::compareWith (const Perm< 2 > &other) const |
Lexicographically compares the images of (0,1) under this and the given permutation. More... | |
bool | regina::Perm< 2 >::isIdentity () const |
Determines if this is the identity permutation. More... | |
static Perm | regina::Perm< 2 >::atIndex (Index i) |
Returns the ith permutation on two elements, where permutations are numbered lexicographically beginning at 0. More... | |
static Perm | regina::Perm< 2 >::rand (bool even=false) |
Returns a random permutation on two elements. More... | |
template<class URBG > | |
static Perm | regina::Perm< 2 >::rand (URBG &&gen, bool even=false) |
Returns a random permutation on two elements, using the given uniform random bit generator. More... | |
Index | regina::Perm< 2 >::index () const |
Returns the lexicographical index of this permutation. More... | |
std::string | regina::Perm< 2 >::str () const |
Returns a string representation of this permutation. More... | |
std::string | regina::Perm< 2 >::trunc (unsigned len) const |
Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More... | |
void | regina::Perm< 2 >::clear (unsigned from) |
Resets the images of all integers from from onwards to the identity map. More... | |
int | regina::Perm< 2 >::S2Index () const |
Returns the index of this permutation in the Perm<2>::S2 array. More... | |
int | regina::Perm< 2 >::SnIndex () const |
Returns the index of this permutation in the Perm<2>::S2 array. More... | |
int | regina::Perm< 2 >::orderedS2Index () const |
Returns the index of this permutation in the Perm<2>::orderedS2 array. More... | |
int | regina::Perm< 2 >::orderedSnIndex () const |
Returns the index of this permutation in the Perm<2>::orderedS2 array. More... | |
template<int k> | |
static Perm< 2 > | regina::Perm< 2 >::contract (Perm< k > p) |
Restricts a k-element permutation to an 2-element permutation, where k > 2. More... | |
regina::Perm< 3 >::Perm () | |
Creates the identity permutation. More... | |
regina::Perm< 3 >::Perm (int a, int b) | |
Creates the transposition of a and b. More... | |
regina::Perm< 3 >::Perm (int a, int b, int c) | |
Creates a permutation mapping (0,1,2) to (a,b,c) respectively. More... | |
regina::Perm< 3 >::Perm (const int *image) | |
Creates a permutation mapping i to image[i] for each i = 0,1,2. More... | |
regina::Perm< 3 >::Perm (const int *a, const int *b) | |
Creates a permutation mapping (a[0], ..., a[2]) to (b[0], ..., b[2]) respectively. More... | |
regina::Perm< 3 >::Perm (const Perm< 3 > &cloneMe)=default | |
Creates a permutation that is a clone of the given permutation. More... | |
Code | regina::Perm< 3 >::permCode () const |
Returns the internal code representing this permutation. More... | |
void | regina::Perm< 3 >::setPermCode (Code code) |
Sets this permutation to that represented by the given internal code. More... | |
static Perm< 3 > | regina::Perm< 3 >::fromPermCode (Code code) |
Creates a permutation from the given internal code. More... | |
static bool | regina::Perm< 3 >::isPermCode (Code code) |
Determines whether the given integer is a valid internal permutation code. More... | |
Perm< 3 > & | regina::Perm< 3 >::operator= (const Perm< 3 > &cloneMe)=default |
Sets this permutation to be equal to the given permutation. More... | |
Perm< 3 > | regina::Perm< 3 >::operator* (const Perm< 3 > &q) const |
Returns the composition of this permutation with the given permutation. More... | |
Perm< 3 > | regina::Perm< 3 >::inverse () const |
Finds the inverse of this permutation. More... | |
Perm< 3 > | regina::Perm< 3 >::reverse () const |
Finds the reverse of this permutation. More... | |
int | regina::Perm< 3 >::sign () const |
Determines the sign of this permutation. More... | |
int | regina::Perm< 3 >::operator[] (int source) const |
Determines the image of the given integer under this permutation. More... | |
int | regina::Perm< 3 >::preImageOf (int image) const |
Determines the preimage of the given integer under this permutation. More... | |
bool | regina::Perm< 3 >::operator== (const Perm< 3 > &other) const |
Determines if this is equal to the given permutation. More... | |
bool | regina::Perm< 3 >::operator!= (const Perm< 3 > &other) const |
Determines if this differs from the given permutation. More... | |
int | regina::Perm< 3 >::compareWith (const Perm< 3 > &other) const |
Lexicographically compares the images of (0,1,2) under this and the given permutation. More... | |
bool | regina::Perm< 3 >::isIdentity () const |
Determines if this is the identity permutation. More... | |
static Perm | regina::Perm< 3 >::atIndex (Index i) |
Returns the ith permutation on three elements, where permutations are numbered lexicographically beginning at 0. More... | |
static Perm | regina::Perm< 3 >::rand (bool even=false) |
Returns a random permutation on three elements. More... | |
template<class URBG > | |
static Perm | regina::Perm< 3 >::rand (URBG &&gen, bool even=false) |
Returns a random permutation on three elements, using the given uniform random bit generator. More... | |
Index | regina::Perm< 3 >::index () const |
Returns the lexicographical index of this permutation. More... | |
std::string | regina::Perm< 3 >::str () const |
Returns a string representation of this permutation. More... | |
std::string | regina::Perm< 3 >::trunc (unsigned len) const |
Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More... | |
std::string | regina::Perm< 3 >::trunc2 () const |
Returns a string representation of this permutation with only the images of 0 and 1. More... | |
void | regina::Perm< 3 >::clear (unsigned from) |
Resets the images of all integers from from onwards to the identity map. More... | |
int | regina::Perm< 3 >::S3Index () const |
Returns the index of this permutation in the Perm<3>::S3 array. More... | |
int | regina::Perm< 3 >::SnIndex () const |
Returns the index of this permutation in the Perm<3>::S3 array. More... | |
REGINA_INLINE_REQUIRED int | regina::Perm< 3 >::orderedS3Index () const |
Returns the index of this permutation in the Perm<3>::orderedS3 array. More... | |
int | regina::Perm< 3 >::orderedSnIndex () const |
Returns the index of this permutation in the Perm<3>::orderedS3 array. More... | |
template<int k> | |
static Perm< 3 > | regina::Perm< 3 >::extend (Perm< k > p) |
Extends a k-element permutation to an 3-element permutation. More... | |
template<int k> | |
static Perm< 3 > | regina::Perm< 3 >::contract (Perm< k > p) |
Restricts a k-element permutation to an 3-element permutation, where k > 3. More... | |
regina::Perm< 4 >::Perm () | |
Creates the identity permutation. More... | |
regina::Perm< 4 >::Perm (int a, int b) | |
Creates the transposition of a and b. More... | |
regina::Perm< 4 >::Perm (int a, int b, int c, int d) | |
Creates a permutation mapping (0,1,2,3) to (a,b,c,d) respectively. More... | |
regina::Perm< 4 >::Perm (const int *image) | |
Creates a permutation mapping i to image[i] for each i = 0,1,2,3. More... | |
regina::Perm< 4 >::Perm (const int *a, const int *b) | |
Creates a permutation mapping (a[0], ..., a[3]) to (b[0], ..., b[3]) respectively. More... | |
regina::Perm< 4 >::Perm (int a0, int a1, int b0, int b1, int c0, int c1, int d0, int d1) | |
Creates a permutation mapping (a0,b0,c0,d0) to (a1,b1,c1,d1) respectively. More... | |
regina::Perm< 4 >::Perm (const Perm< 4 > &cloneMe)=default | |
Creates a permutation that is a clone of the given permutation. More... | |
Code | regina::Perm< 4 >::permCode () const |
Returns the first-generation code representing this permutation. More... | |
Code | regina::Perm< 4 >::permCode2 () const |
Returns the second-generation code representing this permutation. More... | |
void | regina::Perm< 4 >::setPermCode (Code code) |
Sets this permutation to that represented by the given first-generation permutation code. More... | |
void | regina::Perm< 4 >::setPermCode2 (Code code) |
Sets this permutation to that represented by the given second-generation permutation code. More... | |
static Perm< 4 > | regina::Perm< 4 >::fromPermCode (Code code) |
Creates a permutation from the given first-generation permutation code. More... | |
static Perm< 4 > | regina::Perm< 4 >::fromPermCode2 (Code code) |
Creates a permutation from the given second-generation permutation code. More... | |
static bool | regina::Perm< 4 >::isPermCode (Code code) |
Determines whether the given character is a valid first-generation permutation code. More... | |
static bool | regina::Perm< 4 >::isPermCode2 (Code code) |
Determines whether the given character is a valid second-generation permutation code. More... | |
Perm< 4 > & | regina::Perm< 4 >::operator= (const Perm< 4 > &cloneMe)=default |
Sets this permutation to be equal to the given permutation. More... | |
Perm< 4 > | regina::Perm< 4 >::operator* (const Perm< 4 > &q) const |
Returns the composition of this permutation with the given permutation. More... | |
Perm< 4 > | regina::Perm< 4 >::inverse () const |
Finds the inverse of this permutation. More... | |
Perm< 4 > | regina::Perm< 4 >::reverse () const |
Finds the reverse of this permutation. More... | |
int | regina::Perm< 4 >::sign () const |
Determines the sign of this permutation. More... | |
int | regina::Perm< 4 >::operator[] (int source) const |
Determines the image of the given integer under this permutation. More... | |
int | regina::Perm< 4 >::preImageOf (int image) const |
Determines the preimage of the given integer under this permutation. More... | |
bool | regina::Perm< 4 >::operator== (const Perm< 4 > &other) const |
Determines if this is equal to the given permutation. More... | |
bool | regina::Perm< 4 >::operator!= (const Perm< 4 > &other) const |
Determines if this differs from the given permutation. More... | |
int | regina::Perm< 4 >::compareWith (const Perm< 4 > &other) const |
Lexicographically compares the images of (0,1,2,3) under this and the given permutation. More... | |
bool | regina::Perm< 4 >::isIdentity () const |
Determines if this is the identity permutation. More... | |
static Perm | regina::Perm< 4 >::atIndex (Index i) |
Returns the ith permutation on four elements, where permutations are numbered lexicographically beginning at 0. More... | |
Index | regina::Perm< 4 >::index () const |
Returns the lexicographical index of this permutation. More... | |
static Perm | regina::Perm< 4 >::rand (bool even=false) |
Returns a random permutation on four elements. More... | |
template<class URBG > | |
static Perm | regina::Perm< 4 >::rand (URBG &&gen, bool even=false) |
Returns a random permutation on four elements, using the given uniform random bit generator. More... | |
std::string | regina::Perm< 4 >::str () const |
Returns a string representation of this permutation. More... | |
std::string | regina::Perm< 4 >::trunc (unsigned len) const |
Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More... | |
std::string | regina::Perm< 4 >::trunc2 () const |
Returns a string representation of this permutation with only the images of 0 and 1. More... | |
std::string | regina::Perm< 4 >::trunc3 () const |
Returns a string representation of this permutation with only the images of 0, 1 and 2 included. More... | |
void | regina::Perm< 4 >::clear (unsigned from) |
Resets the images of all integers from from onwards to the identity map. More... | |
int | regina::Perm< 4 >::S4Index () const |
Returns the index of this permutation in the Perm<4>::S4 array. More... | |
int | regina::Perm< 4 >::SnIndex () const |
Returns the index of this permutation in the Perm<4>::S4 array. More... | |
REGINA_INLINE_REQUIRED int | regina::Perm< 4 >::orderedS4Index () const |
Returns the index of this permutation in the Perm<4>::orderedS4 array. More... | |
int | regina::Perm< 4 >::orderedSnIndex () const |
Returns the index of this permutation in the Perm<4>::orderedS4 array. More... | |
template<int k> | |
static Perm< 4 > | regina::Perm< 4 >::extend (Perm< k > p) |
Extends a k-element permutation to a 4-element permutation, where 2 ≤ k < 4. More... | |
template<int k> | |
static Perm< 4 > | regina::Perm< 4 >::contract (Perm< k > p) |
Restricts a k-element permutation to an 4-element permutation, where k > 4. More... | |
regina::Perm< 5 >::Perm () | |
Creates the identity permutation. More... | |
regina::Perm< 5 >::Perm (int a, int b) | |
Creates the transposition of a and b. More... | |
regina::Perm< 5 >::Perm (int a, int b, int c, int d, int e) | |
Creates a permutation mapping (0,1,2,3,4) to (a,b,c,d,e) respectively. More... | |
regina::Perm< 5 >::Perm (const int *image) | |
Creates a permutation mapping i to image[i] for each i = 0,1,2,3,4. More... | |
regina::Perm< 5 >::Perm (const int *a, const int *b) | |
Creates a permutation mapping (a[0], ..., a[4]) to (b[0], ..., b[4]) respectively. More... | |
regina::Perm< 5 >::Perm (int a0, int a1, int b0, int b1, int c0, int c1, int d0, int d1, int e0, int e1) | |
Creates a permutation mapping (a0,b0,c0,d0,e0) to (a1,b1,c1,d1,e1) respectively. More... | |
regina::Perm< 5 >::Perm (const Perm< 5 > &cloneMe)=default | |
Creates a permutation that is a clone of the given permutation. More... | |
Code | regina::Perm< 5 >::permCode () const |
Returns the internal code representing this permutation. More... | |
void | regina::Perm< 5 >::setPermCode (Code newCode) |
Sets this permutation to that represented by the given internal code. More... | |
static Perm< 5 > | regina::Perm< 5 >::fromPermCode (Code newCode) |
Creates a permutation from the given internal code. More... | |
static bool | regina::Perm< 5 >::isPermCode (Code newCode) |
Determines whether the given integer is a valid internal permutation code. More... | |
Perm< 5 > & | regina::Perm< 5 >::operator= (const Perm< 5 > &cloneMe)=default |
Sets this permutation to be equal to the given permutation. More... | |
Perm< 5 > | regina::Perm< 5 >::operator* (const Perm< 5 > &q) const |
Returns the composition of this permutation with the given permutation. More... | |
Perm< 5 > | regina::Perm< 5 >::inverse () const |
Finds the inverse of this permutation. More... | |
Perm< 5 > | regina::Perm< 5 >::reverse () const |
Finds the reverse of this permutation. More... | |
int | regina::Perm< 5 >::sign () const |
Determines the sign of this permutation. More... | |
REGINA_INLINE_REQUIRED int | regina::Perm< 5 >::operator[] (int source) const |
Determines the image of the given integer under this permutation. More... | |
int | regina::Perm< 5 >::preImageOf (int image) const |
Determines the preimage of the given integer under this permutation. More... | |
bool | regina::Perm< 5 >::operator== (const Perm< 5 > &other) const |
Determines if this is equal to the given permutation. More... | |
bool | regina::Perm< 5 >::operator!= (const Perm< 5 > &other) const |
Determines if this differs from the given permutation. More... | |
int | regina::Perm< 5 >::compareWith (const Perm< 5 > &other) const |
Lexicographically compares the images of (0,1,2,3,4) under this and the given permutation. More... | |
bool | regina::Perm< 5 >::isIdentity () const |
Determines if this is the identity permutation. More... | |
static Perm | regina::Perm< 5 >::atIndex (Index i) |
Returns the ith permutation on five elements, where permutations are numbered lexicographically beginning at 0. More... | |
Index | regina::Perm< 5 >::index () const |
Returns the lexicographical index of this permutation. More... | |
static Perm | regina::Perm< 5 >::rand (bool even=false) |
Returns a random permutation on five elements. More... | |
template<class URBG > | |
static Perm | regina::Perm< 5 >::rand (URBG &&gen, bool even=false) |
Returns a random permutation on five elements, using the given uniform random bit generator. More... | |
std::string | regina::Perm< 5 >::str () const |
Returns a string representation of this permutation. More... | |
std::string | regina::Perm< 5 >::trunc (unsigned len) const |
Returns a prefix of the string representation of this permutation, containing only the images of the first len integers. More... | |
std::string | regina::Perm< 5 >::trunc2 () const |
Returns a string representation of this permutation with only the images of 0 and 1. More... | |
std::string | regina::Perm< 5 >::trunc3 () const |
Returns a string representation of this permutation with only the images of 0, 1 and 2. More... | |
std::string | regina::Perm< 5 >::trunc4 () const |
Returns a string representation of this permutation with only the images of 0, 1, 2 and 3. More... | |
void | regina::Perm< 5 >::clear (unsigned from) |
Resets the images of all integers from from onwards to the identity map. More... | |
int | regina::Perm< 5 >::S5Index () const |
Returns the index of this permutation in the Perm<5>::S5 array. More... | |
int | regina::Perm< 5 >::SnIndex () const |
Returns the index of this permutation in the Perm<5>::S5 array. More... | |
int | regina::Perm< 5 >::orderedS5Index () const |
Returns the index of this permutation in the Perm<5>::orderedS5 array. More... | |
int | regina::Perm< 5 >::orderedSnIndex () const |
Returns the index of this permutation in the Perm<5>::orderedS5 array. More... | |
template<int k> | |
static Perm< 5 > | regina::Perm< 5 >::extend (Perm< k > p) |
Extends a k-element permutation to a 5-element permutation, where 2 ≤ k < 5. More... | |
template<int k> | |
static Perm< 5 > | regina::Perm< 5 >::contract (Perm< k > p) |
Restricts a k-element permutation to an 5-element permutation, where k > 5. More... | |
regina::Vector< T >::Vector (size_t newVectorSize) | |
Creates a new vector. More... | |
regina::Vector< T >::Vector (size_t newVectorSize, const T &initValue) | |
Creates a new vector and initialises every element to the given value. More... | |
regina::Vector< T >::Vector (const Vector< T > &cloneMe) | |
Creates a new vector that is a clone of the given vector. More... | |
regina::Vector< T >::~Vector () | |
Destroys this vector. More... | |
size_t | regina::Vector< T >::size () const |
Returns the number of elements in the vector. More... | |
const T & | regina::Vector< T >::operator[] (size_t index) const |
Returns the element at the given index in the vector. More... | |
void | regina::Vector< T >::setElement (size_t index, const T &value) |
Sets the element at the given index in the vector to the given value. More... | |
bool | regina::Vector< T >::operator== (const Vector< T > &compare) const |
Determines if this vector is equal to the given vector. More... | |
Vector< T > & | regina::Vector< T >::operator= (const Vector< T > &cloneMe) |
Sets this vector equal to the given vector. More... | |
void | regina::Vector< T >::operator+= (const Vector< T > &other) |
Adds the given vector to this vector. More... | |
void | regina::Vector< T >::operator-= (const Vector< T > &other) |
Subtracts the given vector from this vector. More... | |
void | regina::Vector< T >::operator*= (const T &factor) |
Multiplies this vector by the given scalar. More... | |
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... | |
const int *const | regina::detail::binomSmall_ [17] |
A lookup table that stores (n choose k) for all n ≤ 16. More... | |
static const IntegerBase< supportInfinity > | regina::IntegerBase< supportInfinity >::zero |
Globally available zero. More... | |
static const IntegerBase< supportInfinity > | regina::IntegerBase< supportInfinity >::one |
Globally available one. More... | |
static const IntegerBase< supportInfinity > | regina::IntegerBase< supportInfinity >::infinity |
Globally available infinity. More... | |
static const T | regina::MatrixRingIdentities< T, ring >::zero |
The additive identity in the underlying ring. More... | |
static const T | regina::MatrixRingIdentities< T, ring >::one |
The multiplicative identity in the underlying ring. More... | |
const T & | regina::Matrix< T, ring >::divBy |
static constexpr int | regina::Perm< n >::imageBits = regina::bitsRequired(n) |
Indicates the number of bits used by the permutation code to store the image of a single integer. More... | |
static constexpr Index | regina::Perm< n >::nPerms = factorial(n) |
The total number of permutations on n elements. More... | |
static constexpr Index | regina::Perm< n >::nPerms_1 = factorial(n-1) |
The total number of permutations on n-1 elements. More... | |
static const Rational | regina::Rational::zero |
Globally available zero. More... | |
static const Rational | regina::Rational::one |
Globally available one. More... | |
static const Rational | regina::Rational::infinity |
Globally available infinity. More... | |
static const Rational | regina::Rational::undefined |
Globally available undefined. More... | |
static const Index | regina::Perm< 2 >::nPerms = 2 |
The total number of permutations on two elements. More... | |
static const Index | regina::Perm< 2 >::nPerms_1 = 1 |
The total number of permutations on one element. More... | |
static const Perm< 2 > | regina::Perm< 2 >::S2 [2] |
Contains all possible permutations of two elements. More... | |
static const Perm< 2 > * | regina::Perm< 2 >::Sn |
A dimension-agnostic alias for Perm<2>::S2. More... | |
static const unsigned | regina::Perm< 2 >::invS2 [2] |
Contains the inverses of the permutations in the array S2. More... | |
static const unsigned * | regina::Perm< 2 >::invSn |
A dimension-agnostic alias for Perm<2>::invS2. More... | |
static const Perm< 2 > * | regina::Perm< 2 >::orderedS2 |
Contains all possible permutations of two elements in lexicographical order. More... | |
static const Perm< 2 > * | regina::Perm< 2 >::orderedSn |
A dimension-agnostic alias for Perm<2>::orderedS2. More... | |
static const Perm< 2 > * | regina::Perm< 2 >::S1 |
Contains all possible permutations of one element. More... | |
static const Perm< 2 > * | regina::Perm< 2 >::Sn_1 |
A dimension-agnostic alias for Perm<2>::S1. More... | |
static const Index | regina::Perm< 3 >::nPerms = 6 |
The total number of permutations on three elements. More... | |
static const Index | regina::Perm< 3 >::nPerms_1 = 2 |
The total number of permutations on two elements. More... | |
static const Perm< 3 > | regina::Perm< 3 >::S3 [6] |
Contains all possible permutations of three elements. More... | |
static const Perm< 3 > * | regina::Perm< 3 >::Sn |
A dimension-agnostic alias for Perm<3>::S3. More... | |
static const unsigned | regina::Perm< 3 >::invS3 [6] |
Contains the inverses of the permutations in the array S3. More... | |
static const unsigned * | regina::Perm< 3 >::invSn |
A dimension-agnostic alias for Perm<3>::invS3. More... | |
static const Perm< 3 > | regina::Perm< 3 >::orderedS3 [6] |
Contains all possible permutations of three elements in lexicographical order. More... | |
static const Perm< 3 > * | regina::Perm< 3 >::orderedSn |
A dimension-agnostic alias for Perm<3>::orderedS3. More... | |
static const Perm< 3 > | regina::Perm< 3 >::S2 [2] |
Contains all possible permutations of two elements. More... | |
static const Perm< 3 > * | regina::Perm< 3 >::Sn_1 |
A dimension-agnostic alias for Perm<3>::S2. More... | |
static const Index | regina::Perm< 4 >::nPerms = 24 |
The total number of permutations on four elements. More... | |
static const Index | regina::Perm< 4 >::nPerms_1 = 6 |
The total number of permutations on three elements. More... | |
static const Perm< 4 > | regina::Perm< 4 >::S4 [24] |
Contains all possible permutations of four elements. More... | |
static const Perm< 4 > * | regina::Perm< 4 >::Sn |
A dimension-agnostic alias for Perm<4>::S4. More... | |
static const unsigned | regina::Perm< 4 >::invS4 [24] |
Contains the inverses of the permutations in the array S4. More... | |
static const unsigned * | regina::Perm< 4 >::invSn |
A dimension-agnostic alias for Perm<4>::invS4. More... | |
static const Perm< 4 > | regina::Perm< 4 >::orderedS4 [24] |
Contains all possible permutations of four elements in lexicographical order. More... | |
static const Perm< 4 > * | regina::Perm< 4 >::orderedSn |
A dimension-agnostic alias for Perm<4>::orderedS4. More... | |
static const Perm< 4 > | regina::Perm< 4 >::S3 [6] |
Contains all possible permutations of three elements. More... | |
static const Perm< 4 > * | regina::Perm< 4 >::Sn_1 |
A dimension-agnostic alias for Perm<4>::S3. More... | |
static const Perm< 4 > | regina::Perm< 4 >::orderedS3 [6] |
Contains all possible permutations of three elements in lexicographical order. More... | |
static const Perm< 4 > | regina::Perm< 4 >::S2 [2] |
Contains all possible permutations of two elements. More... | |
static const Index | regina::Perm< 5 >::nPerms = 120 |
The total number of permutations on five elements. More... | |
static const Index | regina::Perm< 5 >::nPerms_1 = 24 |
The total number of permutations on four elements. More... | |
static const int | regina::Perm< 5 >::imageBits = 3 |
Indicates the number of bits used by the permutation code to store the image of a single integer. More... | |
static const Perm< 5 > | regina::Perm< 5 >::S5 [120] |
Contains all possible permutations of five elements. More... | |
static const Perm< 5 > * | regina::Perm< 5 >::Sn |
A dimension-agnostic alias for Perm<5>::S5. More... | |
static const Perm< 5 > | regina::Perm< 5 >::orderedS5 [120] |
Contains all possible permutations of five elements in lexicographical order. More... | |
static const Perm< 5 > * | regina::Perm< 5 >::orderedSn |
A dimension-agnostic alias for Perm<5>::orderedS5. More... | |
static const unsigned | regina::Perm< 5 >::invS5 [120] |
Contains the inverses of the permutations in the array S5. More... | |
static const unsigned * | regina::Perm< 5 >::invSn |
A dimension-agnostic alias for Perm<5>::invS5. More... | |
static const Perm< 5 > | regina::Perm< 5 >::S4 [24] |
Contains all possible permutations of four elements. More... | |
static const Perm< 5 > * | regina::Perm< 5 >::Sn_1 |
A dimension-agnostic alias for Perm<5>::S4. More... | |
static const Perm< 5 > | regina::Perm< 5 >::orderedS4 [24] |
Contains all possible permutations of four elements in lexicographical order. More... | |
static const Perm< 5 > | regina::Perm< 5 >::S3 [6] |
Contains all possible permutations of three elements. More... | |
static const Perm< 5 > | regina::Perm< 5 >::orderedS3 [6] |
Contains all possible permutations of three elements in lexicographical order. More... | |
static const Perm< 5 > | regina::Perm< 5 >::S2 [2] |
Contains all possible permutations of two elements. More... | |
static T | regina::Vector< T >::zero |
Zero in the underlying number system. More... | |
static T | regina::Vector< T >::one |
One in the underlying number system. More... | |
static T | regina::Vector< T >::minusOne |
Negative one in the underlying number system. More... | |
T * | regina::Vector< T >::elements |
The internal array containing all vector elements. More... | |
T * | regina::Vector< T >::end |
A pointer just beyond the end of the internal array. More... | |
Friends | |
template<int bytes> | |
class | regina::IntegerBase< supportInfinity >::NativeInteger |
class | regina::Laurent2< T >::Link |
Cyclotomic | regina::Cyclotomic::operator+ (const Cyclotomic &, const Cyclotomic &) |
Adds the two given cyclotomic field elements. More... | |
Cyclotomic | regina::Cyclotomic::operator- (const Cyclotomic &, const Cyclotomic &) |
Subtracts the two given cyclotomic field elements. More... | |
Cyclotomic | regina::Cyclotomic::operator* (const Cyclotomic &, const Cyclotomic &) |
Multiplies the two given cyclotomic field elements. More... | |
template<bool supportInfinity_> | |
std::ostream & | regina::IntegerBase< supportInfinity >::operator<< (std::ostream &out, const IntegerBase< supportInfinity_ > &large) |
template<int bytes_> | |
std::ostream & | regina::NativeInteger< bytes >::operator<< (std::ostream &out, const NativeInteger< bytes_ > &large) |
template<typename U > | |
Laurent< U > | regina::Laurent< T >::operator+ (const Laurent< U > &, const Laurent< U > &) |
template<typename U > | |
Laurent< U > | regina::Laurent< T >::operator+ (Laurent< U > &&, Laurent< U > &&) |
template<typename U > | |
Laurent< U > | regina::Laurent< T >::operator- (const Laurent< U > &, const Laurent< U > &) |
template<typename U > | |
Laurent< U > | regina::Laurent< T >::operator- (const Laurent< U > &, Laurent< U > &&) |
template<typename U > | |
Laurent< U > | regina::Laurent< T >::operator- (Laurent< U > &&, Laurent< U > &&) |
template<typename U > | |
Laurent< U > | regina::Laurent< T >::operator* (const Laurent< U > &, const Laurent< U > &) |
template<typename U > | |
Laurent2< U > | regina::Laurent2< T >::operator* (const Laurent2< U > &, const Laurent2< U > &) |
std::ostream & | regina::Matrix2::operator<< (std::ostream &out, const Matrix2 &mat) |
Writes the given matrix to the given output stream. More... | |
template<typename U > | |
Polynomial< U > | regina::Polynomial< T >::operator+ (const Polynomial< U > &, const Polynomial< U > &) |
template<typename U > | |
Polynomial< U > | regina::Polynomial< T >::operator- (const Polynomial< U > &, const Polynomial< U > &) |
template<typename U > | |
Polynomial< U > | regina::Polynomial< T >::operator- (const Polynomial< U > &, Polynomial< U > &&) |
template<typename U > | |
Polynomial< U > | regina::Polynomial< T >::operator- (Polynomial< U > &&, Polynomial< U > &&) |
template<typename U > | |
Polynomial< U > | regina::Polynomial< T >::operator* (const Polynomial< U > &, const Polynomial< U > &) |
std::ostream & | regina::Rational::operator<< (std::ostream &out, const Rational &rat) |
Writes the given rational to the given output stream. More... | |
Underlying mathematical gruntwork.
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.
typedef uint8_t regina::Perm< 2 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code.
typedef uint8_t regina::Perm< 3 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code.
typedef uint8_t regina::Perm< 4 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code.
typedef uint16_t regina::Perm< 5 >::Code |
Indicates the native unsigned integer type used to store the internal permutation code.
The type of each coefficient of the polynomial that is used to store a field element.
typedef T regina::Laurent< T >::Coefficient |
The type of each coefficient of the polynomial.
typedef T regina::Laurent2< T >::Coefficient |
The type of each coefficient of the polynomial.
typedef T regina::Matrix< T, ring >::Coefficient |
The type of each entry in the matrix.
typedef T regina::Polynomial< T >::Coefficient |
The type of each coefficient of the polynomial.
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!).
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!).
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!).
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!).
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!).
typedef IntegerBase<false> regina::Integer |
Integer is a typedef for IntegerBase<false>, which offers arbitrary precision integers without support for infinity.
typedef IntegerBase<true> regina::LargeInteger |
LargeInteger is a typedef for IntegerBase<true>, which offers arbitrary precision integers with support for infinity.
using regina::MatrixIntDomain = typedef Matrix<T, true> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
using regina::MatrixRing = typedef Matrix<T, true> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
true
. typedef IntOfSize<bytes>::type regina::NativeInteger< bytes >::Native |
The native data type used to store this integer.
typedef Cyclotomic regina::NCyclotomic |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Integer regina::NInteger |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef LargeInteger regina::NLargeInteger |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
using regina::NMatrix = typedef Matrix<T, false> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Matrix2 regina::NMatrix2 |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef MatrixInt regina::NMatrixInt |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
using regina::NMatrixRing = typedef Matrix<T, true> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
true
. using regina::NNativeInteger = typedef NativeInteger<bytes> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef NativeInteger<sizeof(long)> regina::NNativeLong |
NNativeLong is a typedef for the NativeInteger template class whose underlying integer type is a native long.
using regina::NPerm = typedef Perm<n> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Perm<2> regina::NPerm2 |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Perm<3> regina::NPerm3 |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Perm<4> regina::NPerm4 |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Perm<5> regina::NPerm5 |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
using regina::NPolynomial = typedef Polynomial<T> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Primes regina::NPrimes |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Rational regina::NRational |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Ray regina::NRay |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
using regina::NVector = typedef Vector<T> |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
anonymous enum |
|
inline |
Determines the absolute value of this integer.
This integer is not changed.
Rational regina::Rational::abs | ( | ) | const |
Determines the absolute value of this rational.
This rational is not changed.
|
inline |
Adds the given source column to the given destination column.
This routine is only available when the template argument ring is true
.
source | the columns to add. |
dest | the column that will be added to. |
|
inline |
Adds the given number of copies of the given source column to the given destination column.
Note that copies is passed by value in case it is an element of the row to be changed.
This routine is only available when the template argument ring is true
.
source | the columns to add. |
dest | the column that will be added to. |
copies | the number of copies of source to add to dest. |
|
inline |
Adds the given multiple of the given vector to this vector.
This behaves correctly in the case where other is this
.
other | the vector a multiple of which will be added to this vector. |
multiple | the multiple of other to be added to this vector. |
|
inline |
Adds the given source row to the given destination row.
This routine is only available when the template argument ring is true
.
source | the row to add. |
dest | the row that will be added to. |
|
inline |
Adds the given number of copies of the given source row to the given destination row.
Note that copies is passed by value in case it is an element of the row to be changed.
This routine is only available when the template argument ring is true
.
source | the row to add. |
dest | the row that will be added to. |
copies | the number of copies of source to add to dest. |
|
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]).
i | the lexicographical index of the permutation; this must be between 0 and n!-1 inclusive. |
|
inlinestatic |
Returns the ith permutation on two elements, where permutations are numbered lexicographically beginning at 0.
Lexicographical ordering treats each permutation p as the pair (p[0], p[1]).
The return value will be identical to orderedS2[i].
i | the lexicographical index of the permutation; this must be 0 or 1. |
|
inlinestatic |
Returns the ith permutation on three elements, where permutations are numbered lexicographically beginning at 0.
Lexicographical ordering treats each permutation p as the 3-tuple (p[0], p[1], p[2]).
The return value will be identical to orderedS3[i].
i | the lexicographical index of the permutation; this must be between 0 and 5 inclusive. |
|
inlinestatic |
Returns the ith permutation on four elements, where permutations are numbered lexicographically beginning at 0.
Lexicographical ordering treats each permutation p as the 4-tuple (p[0], p[1], p[2], p[3]).
The return value will be identical to orderedS4[i].
i | the lexicographical index of the permutation; this must be between 0 and 23 inclusive. |
|
inlinestatic |
Returns the ith permutation on five elements, where permutations are numbered lexicographically beginning at 0.
Lexicographical ordering treats each permutation p as the 5-tuple (p[0], p[1], p[2], p[3], p[4]).
The return value will be identical to orderedS5[i].
i | the lexicographical index of the permutation; this must be between 0 and 119 inclusive. |
long regina::binomMedium | ( | int | n, |
int | k | ||
) |
Returns the binomial coefficient n choose k in linear time for medium-sized arguments (n ≤ 29).
This routine computes the binomial coefficient using the standard formula. It works entirely with native long integers; the constraint n ≤ 29 is designed to avoid overflow (since all intermediate results are guaranteed to stay below 2^31).
If n ≤ 16 then this routine will use the same constant-time lookup as binomSmall() (i.e., there is no penalty for calling this routine with very small arguments).
n | the parameter n in (n choose k); this must be between 0 and 29 inclusive. |
k | the parameter k in (n choose k); this must be between 0 and n inclusive. |
|
inline |
Returns the binomial coefficient n choose k in constant time for small arguments (n ≤ 16).
This routine is very fast, since it uses a constant-time lookup. The trade-off is that it can only be used for n ≤ 16.
If you need a compile-time constant, you should use the constant FaceNumbering<n-1, k-1>::nFaces instead. This function is provided for situations where n and/or k are not known until runtime.
n | the parameter n in (n choose k); this must be between 0 and 16 inclusive. |
k | the parameter k in (n choose k); this must be between 0 and n inclusive. |
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.
from | the first integer whose image should be reset. This must be between 0 and n inclusive. |
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.
from | the first integer whose image should be reset. This must be between 0 and 2 inclusive. |
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.
from | the first integer whose image should be reset. This must be between 0 and 3 inclusive. |
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.
from | the first integer whose image should be reset. This must be between 0 and 4 inclusive. |
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.
from | the first integer whose image should be reset. This must be between 0 and 5 inclusive. |
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:
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).Our convention is that a matrix is in column echelon form if:
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.
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). |
|
inline |
Returns the number of columns in this matrix.
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.
other | the permutation with which to compare this. |
|
inline |
Lexicographically compares the images of (0,1) under this and the given permutation.
other | the permutation with which to compare this. |
|
inline |
Lexicographically compares the images of (0,1,2) under this and the given permutation.
other | the permutation with which to compare this. |
|
inline |
Lexicographically compares the images of (0,1,2,3) under this and the given permutation.
other | the permutation with which to compare this. |
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.
other | the permutation with which to compare this. |
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].
k | the number of elements for the input permutation; this must be strictly greater than n. |
p | a permutation on k elements. |
|
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].
k | the number of elements for the input permutation; this must be strictly greater than 2. |
p | a permutation on k elements. |
|
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].
k | the number of elements for the input permutation; this must be strictly greater than 3. |
p | a permutation on k elements. |
|
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].
k | the number of elements for the input permutation; this must be strictly greater than 4. |
p | a permutation on k elements. |
|
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].
k | the number of elements for the input permutation; this must be strictly greater than 5. |
p | a permutation on k elements. |
|
inline |
|
inline |
Creates a copy of the given field element, within the same cyclotomic field.
This constructor induces a deep copy of value.
value | the field element to copy. |
|
inlinenoexcept |
Moves the contents of the given field element to this new field element.
This is a fast (constant time) operation.
The element that was passed (value) will no longer be usable.
value | the field element to move. |
|
inlineexplicit |
Creates the zero element of the given cyclotomic field.
field | the order of the underlying cyclotomic field; this must be strictly positive. |
|
inline |
Creates the given rational element within the given cyclotomic field.
The polynomial representation of this element will simply be a rational constant.
field | the order of the underlying cyclotomic field; this must be strictly positive. |
value | the value of this element; that is, the rational constant. |
|
inline |
Creates the given integer element within the given cyclotomic field.
The polynomial representation of this element will simply be an integer constant.
field | the order of the underlying cyclotomic field; this must be strictly positive. |
value | the value of this element; that is, the integer constant. |
|
inline |
Creates a new field element from a hard-coded sequence of coefficients.
This constructor takes a C++11 initialiser list, which should contain the coefficients of the field element's polynomial representation, in order from the constant coefficient upwards. See operator[] for details on what this polynomial representation means.
There should be at most deg(Φ_n) = φ(n)
coefficients in the list, where n is the given order of the underlying field; any missing coefficients are assumed to be zero. In particular, an empty sequence is allowed (and represents the zero field element).
field | the order of the underlying cyclotomic field; this must be strictly positive. |
coefficients | a sequence of at most φ(n) coefficients, as described above. |
|
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.
n | indicates which cyclotomic polynomial to return. |
Φ_n
.
|
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).
|
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.
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.
|
inline |
Evaluates the determinant of the matrix.
This algorithm has quartic complexity, and uses the dynamic programming approach of Mahajan and Vinay. For further details, see Meena Mahajan and V. Vinay, "Determinant: Combinatorics, algorithms, and complexity", Chicago J. Theor. Comput. Sci., Vol. 1997, Article 5.
This routine is only available when the template argument ring is true
.
|
inline |
Returns the determinant of this matrix.
|
inlineconstexpr |
Returns the character used to express the integer i in a permutation.
i | the integer to represent; this must be between 0 and 35 inclusive. |
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.
other | the integer to divide this by. |
|
inline |
Divides this by the given integer.
For native integers, this routine is identical to operator /=.
other | the integer to divide this by. |
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.
other | the integer to divide this by. |
|
inline |
Divides this by the given integer.
For native integers, this routine is identical to operator /=.
other | the integer to divide this by. |
|
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.
other | the integer to divide this by. |
|
inline |
Divides this by the given integer and returns the result.
For native integers, this is identical to operator /.
other | the integer to divide this by. |
|
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.
other | the integer to divide this by. |
|
inline |
Divides this by the given integer and returns the result.
For native integers, this is identical to operator /.
other | the integer to divide this by. |
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.
divisor | the divisor d. |
remainder | used to store the remainder r when the functon returns. The initial value of this argument is ignored. |
|
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.
divisor | the divisor d. |
remainder | used to store the remainder r when the functon returns. The initial value of this argument is ignored. |
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.
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. |
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).
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. |
|
inline |
Returns the sum of all elements of this vector.
|
inline |
Returns the entry at the given row and column.
Rows and columns are numbered beginning at zero.
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).row | the row of the desired entry. |
column | the column of the desired entry. |
|
inline |
Returns the entry at the given row and column.
Rows and columns are numbered beginning at zero.
row | the row of the desired entry. |
column | the column of the desired entry. |
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.
whichRoot | indicates which root of unity will be used to convert the polynomial representation of this field element into a complex number. |
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.
k | the number of elements for the input permutation; this must be at least 2, and strictly less than n. |
p | a permutation on k elements. |
|
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.
k | the number of elements for the input permutation; this must be exactly 2. |
p | a permutation on two elements. |
|
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.
k | the number of elements for the input permutation; this must be 2 or 3. |
p | a permutation on k elements. |
|
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.
k | the number of elements for the input permutation; this must be 2, 3 or 4. |
p | a permutation on k elements. |
|
inlineconstexpr |
Returns the factorial of n.
n | any non-negative integer; this must be at most 20 (since otherwise the factorial will overflow). |
|
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).
|
inlinestatic |
Creates a permutation from the given internal code.
code | the internal code for the new permutation. |
|
inlinestatic |
Creates a permutation from the given internal code.
code | the internal code for the new permutation. |
|
inlinestatic |
Creates a permutation from the given internal code.
code | the internal code for the new permutation. |
|
inlinestatic |
Creates a permutation from the given first-generation permutation code.
code | the first-generation code for the new permutation. |
|
inlinestatic |
Creates a permutation from the given internal code.
newCode | the internal code for the new permutation. |
|
inlinestatic |
Creates a permutation from the given second-generation permutation code.
Second-generation codes are fast to work with, since they are used internally by the Perm<4> class.
code | the second-generation code for the new permutation. |
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.
other | the integer whose greatest common divisor with this will be found. |
|
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.
other | the integer whose greatest common divisor with this will be found. |
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.
a | one of the two integers to work with. |
b | the other integer with which to work. |
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.
other | the integer whose greatest common divisor with this will be found. |
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.
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.
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.
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. |
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.
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. |
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.
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. |
Perm< n >::Index regina::Perm< n >::index |
Returns the lexicographical index of this permutation.
This indicates where this permutation sits within a full lexicographical ordering of all n! permutations on n elements.
Lexicographical ordering treats each permutation p as the n-tuple (p[0], p[1], ..., p[n-1]). In particular, the identity permutation has index 0, and the "reverse" permutation (which maps each i to n-i-1) has index n!-1.
|
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().
|
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().
|
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().
|
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().
|
inline |
Sets this to become the zero polynomial.
|
inline |
Sets this to become the zero polynomial.
|
inline |
Sets this to become the zero polynomial.
void regina::Polynomial< T >::init | ( | iterator | begin, |
iterator | end | ||
) |
Sets this to become the polynomial described by the given sequence of coefficients.
The coefficients should appear in order from the constant coefficient to the leading coefficient.
There is no problem if the leading coefficient (i.e., the last coefficient in the sequence) is zero. An empty sequence will be treated as the zero polynomial.
This routine induces a deep copy of the given range.
begin | the beginning of the sequence of coefficients. |
end | a past-the-end iterator indicating the end of the sequence of coefficients. |
|
inline |
Sets this to become the polynomial x^d
for the given exponent d.
exponent | the new exponent to use for this polynomial. |
void regina::Laurent< T >::init | ( | long | minExp, |
iterator | begin, | ||
iterator | end | ||
) |
Sets this to become the polynomial described by the given sequence of coefficients.
The coefficients should appear in order from the smallest exponent term to the largest. The first coefficient in the sequence will be associated with the exponent minExp.
There is no problem if the first and/or last coefficient in the sequence is zero. An empty sequence will be treated as the zero polynomial.
This routine induces a deep copy of the given range.
minExp | the exponent corresponding to the first coefficient in the sequence. |
begin | the beginning of the sequence of coefficients. |
end | a past-the-end iterator indicating the end of the sequence of coefficients. |
|
inline |
Sets this to become the polynomial x^d y^e
for the given exponents d and e.
xExp | the new exponent d, which is attached to x. |
yExp | the new exponent e, which is attached to y. |
|
inline |
Sets this to become the polynomial x^d
for the given degree d.
degree | the new degree of this polynomial. |
|
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.
field | the order of the cyclotomic field to which this field element will now belong; this must be strictly positive. |
|
inline |
Sets every entry in the matrix to the given value.
value | the value to assign to each entry. |
void regina::Matrix< T, ring >::initialise | ( | List | allValues | ) |
A Python-only routine that fills the matrix with the given set of elements.
The argument allValues must be a Python list of length rows() * columns(). Its values will be inserted into the matrix row by row (i.e., the first row will be filled, then the second row, and so on).
allValues | the individual elements to place into the matrix. |
|
inline |
Initialises this integer to zero.
regina::IntegerBase< supportInfinity >::IntegerBase | ( | const char * | value, |
int | base = 10 , |
||
bool * | valid = nullptr |
||
) |
Initialises this integer to the given value which is represented as a string of digits in a given base.
If not specified, the base defaults to 10. If the given base is zero, the base will be automatically determined. If the given string begins with 0x
or 0X
, the base will be assumed to be 16. Otherwise, if the string begins with 0
, the base will be assumed to be 8. Otherwise it will be taken as base 10.
Whitespace may be present at the beginning or the end of the given string, and will simply be ignored.
Error detection is possible by passing a non-null boolean pointer as the third parameter to this constructor.
For finer details on how the string parsing works, see strtol() from the standard C library (on which this method is based).
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. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
|
inlineexplicit |
Initialises this integer to the given value.
This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of template parameters.
value | the new value of this integer. |
|
inlineexplicit |
Initialises this integer to the given value.
This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of integer classes.
value | the new value of this integer. |
regina::IntegerBase< supportInfinity >::IntegerBase | ( | const std::string & | value, |
int | base = 10 , |
||
bool * | valid = nullptr |
||
) |
Initialises this integer to the given value which is represented as a string of digits in a given base.
If not specified, the base defaults to 10. If the given base is zero, the base will be automatically determined. If the given string begins with 0x
or 0X
, the base will be assumed to be 16. Otherwise, if the string begins with 0
, the base will be assumed to be 8. Otherwise it will be taken as base 10.
Whitespace may be present at the beginning or the end of the given string, and will simply be ignored.
Error detection is possible by passing a non-null boolean pointer as the third parameter to this constructor.
For finer details on how the string parsing works, see strtol() from the standard C library (on which this method is based).
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. |
|
inline |
Initialises this integer to the truncation of the given real number.
value | the real number to be truncated. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
regina::IntegerBase< supportInfinity >::IntegerBase | ( | Long | value | ) |
Initialises this to the given Python arbitrary-precision integer.
The argument is of the Python type long
, which Python uses to store integers of arbitrary magnitude (much like Regina does with its Integer and LargeInteger classes).
value | the new value of this integer. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
Cyclotomic regina::Cyclotomic::inverse | ( | ) | const |
Returns the inverse of this field element.
This field element is not changed.
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.
|
inline |
Finds the inverse of this permutation.
Rational regina::Rational::inverse | ( | ) | const |
Calculates the inverse of this rational.
This rational is not changed.
|
inline |
Finds the inverse of this permutation.
|
inline |
Finds the inverse of this permutation.
|
inline |
Finds the inverse of this permutation.
|
inline |
Finds the inverse of this permutation.
void regina::Cyclotomic::invert | ( | ) |
Inverts this field element.
This field element is changed directly.
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.
true
if this matrix was successfully inverted (i.e., its determinant was +1 or -1), or false
otherwise. void regina::Rational::invert | ( | ) |
Inverts this rational.
This rational is changed to reflect the result.
|
inline |
Determines whether this matrix is a square identity matrix.
If this matrix is square, isIdentity() will return true
if and only if the matrix has ones in the main diagonal and zeroes everywhere else.
If this matrix is not square, isIdentity() will always return false
(even if makeIdentity() was called earlier).
This routine is only available when the template argument ring is true
.
true
if and only if this is a square identity matrix.
|
inline |
Determines if this is the 2x2 identity matrix.
true
if this is the identity matrix, or false
otherwise.
|
inline |
Determines if this is the identity permutation.
This is true if and only if every integer 0 ≤ i < n is mapped to itself.
true
if and only if this is the identity permutation.
|
inline |
Determines if this is the identity permutation.
This is true if and only if each of 0 and 1 is mapped to itself.
true
if and only if this is the identity permutation.
|
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.
true
if and only if this is the identity permutation.
|
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.
true
if and only if this is the identity permutation.
|
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.
true
if and only if this is the identity permutation. bool regina::IntegerBase< supportInfinity >::isInfinite | ( | ) | const |
Returns whether this integer is infinity.
true
if and only if this integer is infinity.
|
inline |
Returns whether this polynomial is monic.
A monic polynomial is a non-zero polynomial whose leading coefficient is one.
true
if and only if this is monic.
|
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
.
true
if and only if we are still using a native C/C++ long.
|
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.
x | the number to examine. |
true
if and only if the given number is strictly negative.
|
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.
x | the number to examine. |
true
if and only if the given number is non-negative.
|
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.
x | the number to examine. |
true
if and only if the given number is non-positive.
|
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.
x | the number to examine. |
true
if and only if the given number is approximately non-zero.
|
inlinestatic |
Determines whether the given integer is a valid internal permutation code.
Valid permutation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().
true
if and only if the given code is a valid internal permutation code.
|
inlinestatic |
Determines whether the given integer is a valid internal permutation code.
Valid permutation codes can be passed to setPermCode() or fromPermCode(), and are returned by permCode().
true
if and only if the given code is a valid internal permutation 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().
code | the permutation code to test. |
true
if and only if the given code is a valid first-generation permutation code.
|
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().
true
if and only if the given code is a valid internal permutation code.
|
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().
true
if and only if the given code is a valid internal permutation code.
|
inlinestatic |
Determines whether the given character is a valid second-generation permutation code.
Valid second-generation codes can be passed to setPermCode2() or fromPermCode2(), and are returned by permCode2().
Second-generation codes are fast to work with, since they are used internally by the Perm<4> class.
code | the permutation code to test. |
true
if and only if the given code is a valid second-generation permutation code.
|
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.
x | the number to examine. |
true
if and only if the given number is strictly positive.
|
inline |
Returns whether or not this integer is zero.
This is micro-optimised to be faster than simply testing whether (*this) == 0.
true
if and only if this integer is zero.
|
inline |
Returns whether or not this integer is zero.
true
if and only if this integer is zero.
|
inline |
Returns whether this is the zero polynomial.
true
if and only if this is the zero polynomial.
|
inline |
Returns whether this is the zero polynomial.
true
if and only if this is the zero polynomial.
|
inline |
Determines whether this is the zero matrix.
This routine is only available when the template argument ring is true
.
true
if and only if all entries in the matrix are zero.
|
inline |
Determines if this is the 2x2 zero matrix.
true
if this is the zero matrix, or false
otherwise.
|
inline |
Returns whether this is the zero polynomial.
true
if and only if this is the zero polynomial.
|
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.
x | the number to examine. |
true
if and only if the given number is approximately zero.
|
inline |
Creates the zero polynomial.
|
inline |
Creates a new copy of the given polynomial.
This constructor induces a deep copy of value.
A note for developers: even though this routine is identical to the templated copy constructor, it must be declared and implemented separately. Otherwise the compiler might create its own (incorrect) copy constructor automatically.
value | the polynomial to clone. |
|
inline |
Creates a new copy of the given polynomial.
This constructor induces a deep copy of value.
value | the polynomial to clone. |
|
inlinenoexcept |
Moves the contents of the given polynomial to this new polynomial.
This is a fast (constant time) operation.
The polynomial that was passed (value) will no longer be usable.
value | the polynomial to move. |
|
inlineexplicit |
Creates the polynomial x^d
for the given exponent d.
exponent | the exponent to use for the new polynomial. |
|
inline |
Creates a new polynomial from the given sequence of coefficients.
The coefficients should appear in order from the smallest exponent term to the largest. The first coefficient in the sequence will be associated with the exponent minExp.
There is no problem if the first and/or last coefficient in the sequence is zero. An empty sequence will be treated as the zero polynomial.
This constructor induces a deep copy of the given range.
minExp | the exponent corresponding to the first coefficient in the sequence. |
begin | the beginning of the sequence of coefficients. |
end | a past-the-end iterator indicating the end of the sequence of coefficients. |
|
inline |
Creates a new polynomial from a hard-coded sequence of coefficients.
This constructor takes a C++11 initialiser list, which should contain the coefficients in order from the smallest exponent term to the largest. The first coefficient in the sequence will be associated with the exponent minExp.
There is no problem if the first and/or last coefficient in the sequence is zero. An empty sequence will be treated as the zero polynomial.
minExp | the exponent corresponding to the first coefficient in the sequence. |
coefficients | the full sequence of coefficients. |
|
default |
Creates the zero polynomial.
regina::Laurent2< T >::Laurent2 | ( | const Laurent2< T > & | toShift, |
long | xShift, | ||
long | yShift | ||
) |
Creates a copy of the given polynomial with all terms multiplied by x^d y^e
for some integers d and e.
This constructor induces a deep (and modified) copy of value.
toShift | the polynomial to clone and shift. |
xShift | the integer d, which will be added to all exponents for x. |
yShift | the integer e, which will be added to all exponents for y. |
|
inline |
Creates a new copy of the given polynomial.
This constructor induces a deep copy of value.
A note for developers: even though this routine is identical to the templated copy constructor, it must be declared and implemented separately. Otherwise the compiler might create its own (incorrect) copy constructor automatically.
value | the polynomial to clone. |
|
inline |
Creates a new copy of the given polynomial.
This constructor induces a deep copy of value.
value | the polynomial to clone. |
|
defaultnoexcept |
Moves the contents of the given polynomial to this new polynomial.
This is a fast (constant time) operation.
The polynomial that was passed (value) will no longer be usable.
value | the polynomial to move. |
|
inlineexplicit |
Creates the polynomial x^d y^e
for the given exponents d and e.
xExp | the exponent d, which is attached to x. |
yExp | the exponent e, which is attached to y. |
|
inline |
Creates a new polynomial from a hard-coded collection of non-zero coefficients.
This constructor takes a C++11 initialiser list, which should contain a collection of tuples of the form (d, e, v) each representing a term of the form v x^d y^e
.
The tuples may be given in any order. An empty sequence will be treated as the zero polynomial.
In practice, this means you can create a hard-coded polynomial using syntax such as:
coefficients | the set of all non-zero coefficients, as outlined above. |
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.
other | the integer whose lowest common multiple with this will be found. |
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.
a | one of the two integers to work with. |
b | the other integer with which to work. |
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.
other | the integer whose lowest common multiple with this will be found. |
|
inline |
Returns the leading coefficient of this polynomial.
If this is the zero polynomial, then the leading coefficient will be zero.
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.
p | the given odd prime. |
|
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.
|
inline |
Turns this matrix into an identity matrix.
This matrix need not be square; after this routine it will have entry(r,c)
equal to 1 if r == c
and 0 otherwise.
This routine is only available when the template argument ring is true
.
|
inline |
Sets this integer to be infinity.
If the template parameter supportInfinity is false
, this routine safely does nothing.
|
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.
|
inline |
Creates a new matrix that is a clone of the given matrix.
This constructor induces a deep copy of src.
src | the matrix to clone. |
|
inlinenoexcept |
Moves the given matrix into this new matrix.
This is a fast (constant time) operation.
The matrix that is passed (src) will no longer be usable.
src | the matrix to move. |
|
inline |
Creates a new matrix of the given size.
All entries will be initialised using their default constructors.
In particular, this means that for Regina's own integer classes (Integer, LargeInteger and NativeInteger), all entries will be initialised to zero.
int
or long
), then the matrix elements will not be initialised to any particular value.rows | the number of rows in the new matrix. |
cols | the number of columns in the new matrix. |
|
inline |
Initialises to the zero matrix.
|
inline |
Initialises to the given integer values.
Each given integer values[r][c]
will be placed in row r, column c.
values | the four values to insert into the new matrix. |
|
inline |
Initialises to a copy of the given matrix.
cloneMe | the matrix to be copied. |
|
inline |
Initialises to the given integer values.
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. |
|
inline |
Returns the largest exponent that appears in this polynomial with a non-zero coefficient.
If this is the zero polynomial, then this routine returns 0.
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:
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.
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. |
|
inline |
Returns the smallest exponent that appears in this polynomial with a non-zero coefficient.
If this is the zero polynomial, then this routine returns 0.
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.
n | the modular base in which to work. |
k | the number whose multiplicative inverse should be found. |
k * v == 1 (mod n)
.
|
inline |
Multiplies the given column by the given factor.
Note that factor is passed by value in case it is an element of the row to be changed.
This routine is only available when the template argument ring is true
.
column | the column to work with. |
factor | the factor by which to multiply the given column. |
|
inline |
Deprecated alias for the multiplication operator.
Multiplies this by the given matrix, and returns a new matrix (of this same class) as a result. This matrix is not changed.
As of Regina 5.3, the template parameter MatrixClass has been removed, since Regina's old matrix class hierarchy has been replaced with a single Matrix class. It is harmless if you still pass a template parameter, but your parameter will be ignored.
This routine is only available when the template argument ring is true
.
other | the other matrix to multiply this matrix by. |
this * other
.
|
inline |
Multiplies the given row by the given factor.
Note that factor is passed by value in case it is an element of the row to be changed.
This routine is only available when the template argument ring is true
.
row | the row to work with. |
factor | the factor by which to multiply the given row. |
|
inline |
Initialises this integer to zero.
|
inlineexplicit |
Initialises this integer to the given value.
This constructor is marked as explicit in the hope of avoiding accidental (and unintentional) mixing of integer classes.
It is the programmer's reponsibility to ensure that the given value fits within the required range. If the given value is too large or small to fit into this native type, then this new NativeInteger will have an undefined initial value.
value | the new value of this integer. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
|
inline |
Initialises this integer to the given value.
value | the new value of this integer. |
IntOfSize< bytes >::type regina::IntegerBase< supportInfinity >::nativeValue |
Returns the value of this integer as a native integer of some fixed byte length.
It is the programmer's reponsibility to ensure that this integer is within the required range. If this integer is too large or small to fit into the return type, then the result will be undefined.
Note that, assuming the value is within the required range, this routine will give correct results regardless of whether the underlying representation is a native or large integer.
|
inline |
Returns the value of this integer in its native type.
|
inline |
Negates this field element.
This field element is changed directly.
|
inline |
Negates this integer.
This integer is changed to reflect the result.
Negating infinity will result in infinity.
|
inline |
Negates this integer.
This integer is changed to reflect the result.
|
inline |
Negates this polynomial.
This field element is changed directly.
|
inline |
Negates this polynomial.
This field element is changed directly.
|
inline |
Negates this matrix.
This matrix is changed to reflect the result.
|
inline |
Negates this polynomial.
This field element is changed directly.
|
inline |
Negates this rational.
This rational is changed to reflect the result.
|
inline |
Negates every element of this vector.
This is an optimised implementation that overrides Vector<LargeInteger>::negate().
|
inline |
Negates every element of this vector.
|
inline |
Returns the norm of this vector.
This is the dot product of the vector with itself.
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.
|
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
.
rhs | the value to compare with this. |
false
if this and rhs are the same element of the same cyclotomic field, or true
if they are not.
|
inline |
Determines if this is not equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are not equal.
|
inline |
Determines if this is not equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are not equal.
|
inline |
Tests whether this and the given polynomial are not equal.
rhs | the polynomial to compare with this. |
true
if and only if this and the given polynomial are not equal.
|
inline |
Tests whether this and the given polynomial are not equal.
rhs | the polynomial to compare with this. |
true
if and only if this and the given polynomial are not equal.
|
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
.
other | the matrix to compare with this. |
true
if the matrices are different as described above, or false
otherwise.
|
inline |
Determines if this is not equal to the given matrix.
compare | the matrix with which this will be compared. |
true
if and only if this matrix is not equal to compare.
|
inline |
Determines if this is not equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are not equal.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation differ.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation differ.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation differ.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation differ.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation differ.
|
inline |
Tests whether this and the given polynomial are not equal.
rhs | the polynomial to compare with this. |
true
if and only if this and the given polynomial are not equal.
|
inline |
Determines if this is not equal to the given rational.
compare | the rational with which this will be compared. |
true
if and only if this rational is not equal to compare.
|
inline |
Determines if this is not equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are not equal.
|
inline |
Determines if this is not equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are not equal.
|
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
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().
other | the integer modulo which this integer will be reduced. |
|
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().
other | the integer modulo which this integer will be reduced. |
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().
other | the integer modulo which this integer will be reduced. |
|
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().
other | the integer modulo which this integer will be reduced. |
|
inline |
Returns the given coefficient of this polynomial.
There are no restrictions on the exponents xExp and yExp.
poly[xExp, yExp]
. Moreover, this operator can also set cofficients; that is, you can write poly[xExp, yExp] = value
. In contrast, C++ users must use the separate routine set(), due to the fact that in C++ this bracket operator is const.xExp | the exponent attached to x. |
yExp | the exponent attached to y. |
Cyclotomic regina::operator* | ( | const Cyclotomic & | lhs, |
const Cyclotomic & | rhs | ||
) |
Multiplies the two given cyclotomic field elements.
lhs | the first field element to multiply. |
rhs | the second field element to multiply. |
|
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.
other | the integer to multiply by this integer. |
|
inline |
Multiplies the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the first polynomial to multiply. |
rhs | the second polynomial to multiply. |
Laurent< T > regina::operator* | ( | const Laurent< T > & | lhs, |
const Laurent< T > & | rhs | ||
) |
Multiplies the two given polynomials.
lhs | the first polynomial to multiply. |
rhs | the second polynomial to multiply. |
|
inline |
Multiplies this by the given matrix, and returns the result.
This matrix is not changed.
This routine is only available when the template argument ring is true
.
other | the other matrix to multiply this matrix by. |
this * other
. Calculates the matrix product of this and the given matrix.
Neither this nor the given matrix is changed.
other | the matrix that this should be multiplied by. |
|
inline |
Multiplies this by the given integer and returns the result.
This integer is not changed.
other | the integer to multiply by this integer. |
|
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]]
.
q | the permutation to compose this with. |
|
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]]
.
q | the permutation with which to compose this. |
|
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]]
.
q | the permutation with which to compose this. |
|
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]]
.
q | the permutation with which to compose this. |
|
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]]
.
q | the permutation with which to compose this. |
Polynomial< T > regina::operator* | ( | const Polynomial< T > & | lhs, |
const Polynomial< T > & | rhs | ||
) |
Multiplies the two given polynomials.
lhs | the first polynomial to multiply. |
rhs | the second polynomial to multiply. |
Calculates the product of two rationals.
This rational is not changed.
r | the rational with which to multiply this. |
|
inline |
Multiplies the given field element by the given rational.
scalar | the rational to multiply by. |
elt | the field element to multiply by. |
|
inline |
Multiplies the given polynomial by the given scalar constant.
The scalar is simply of type T; we use the identical type Laurent2<T>::Coefficient here to assist with C++ template type matching.
scalar | the scalar to multiply by. |
poly | the polynomial to multiply by. |
|
inline |
Multiplies the given polynomial by the given scalar constant.
The scalar is simply of type T; we use the identical type Laurent<T>::Coefficient here to assist with C++ template type matching.
scalar | the scalar to multiply by. |
poly | the polynomial to multiply by. |
|
inline |
Multiplies the given polynomial by the given scalar constant.
The scalar is simply of type T; we use the identical type Polynomial<T>::Coefficient here to assist with C++ template type matching.
scalar | the scalar to multiply by. |
poly | the polynomial to multiply by. |
|
inline |
Calculates the dot product of this vector and the given vector.
other | the vector with which this will be multiplied. |
|
inline |
Multiplies the given field element by the given rational.
elt | the field element to multiply by. |
scalar | the rational to multiply by. |
|
inline |
Multiplies the given polynomial by the given scalar constant.
The scalar is simply of type T; we use the identical type Laurent2<T>::Coefficient here to assist with C++ template type matching.
poly | the polynomial to multiply by. |
scalar | the scalar to multiply by. |
|
inline |
Multiplies the given polynomial by the given scalar constant.
The scalar is simply of type T; we use the identical type Laurent<T>::Coefficient here to assist with C++ template type matching.
poly | the polynomial to multiply by. |
scalar | the scalar to multiply by. |
|
inline |
Multiplies the given native integer with the given large integer.
If the large integer is infinite, the result will also be infinity.
lhs | the native integer to multiply. |
rhs | the large integer to multiply. |
|
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.
other | the integer to multiply by this integer. |
|
inline |
Calculates the scalar product of this matrix and the given integer.
This matrix is not changed.
scalar | the integer that this matrix should be multiplied by. |
|
inline |
Multiplies this by the given integer and returns the result.
This integer is not changed.
other | the integer to multiply by this integer. |
|
inline |
Multiplies the given polynomial by the given scalar constant.
The scalar is simply of type T; we use the identical type Polynomial<T>::Coefficient here to assist with C++ template type matching.
poly | the polynomial to multiply by. |
scalar | the scalar to multiply by. |
Cyclotomic& regina::Cyclotomic::operator*= | ( | const Cyclotomic & | other | ) |
Multiplies this by the given field element.
other | the field element to multiply this by. |
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.
other | the integer to multiply with this integer. |
Laurent2< T > & regina::Laurent2< T >::operator*= | ( | const Laurent2< T > & | other | ) |
Multiplies this by the given polynomial.
This and the given polynomial need not have the same range of non-zero coefficients.
other | the polynomial to multiply this by. |
Laurent< T > & regina::Laurent< T >::operator*= | ( | const Laurent< T > & | other | ) |
Multiplies this by the given polynomial.
The given polynomial need not have the same minimum and/or maximum exponents as this.
other | the polynomial to multiply this by. |
Multiplies this by the given matrix.
This matrix is changed to reflect the result.
other | the matrix by which this should be multiplied. |
|
inline |
Multiplies the given integer by this.
This integer is changed to reflect the result.
other | the integer to multiply with this integer. |
Polynomial< T > & regina::Polynomial< T >::operator*= | ( | const Polynomial< T > & | other | ) |
Multiplies this by the given polynomial.
other | the polynomial to multiply this by. |
Multiplies the given rational by this.
This rational is changed to reflect the result.
other | the rational to multiply by this. |
|
inline |
Multiplies this field element by the given rational.
This has the effect of multiplying the polynomial representation by a scalar constant.
scalar | the rational to multiply this by. |
|
inline |
Multiplies this vector by the given scalar.
factor | the scalar with which this will be multiplied. |
Laurent< T > & regina::Laurent< T >::operator*= | ( | const T & | scalar | ) |
Multiplies this polynomial by the given constant.
scalar | the scalar factor to multiply by. |
|
inline |
Multiplies this polynomial by the given constant.
scalar | the scalar factor to multiply by. |
Polynomial< T > & regina::Polynomial< T >::operator*= | ( | const T & | scalar | ) |
Multiplies this polynomial by the given constant.
scalar | the scalar factor to multiply by. |
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.
other | the integer to multiply with this integer. |
|
inline |
Multiplies this by the given scalar.
This matrix is changed to reflect the result.
scalar | the scalar by which this should be multiplied. |
|
inline |
Multiplies the given integer by this.
This integer is changed to reflect the result.
other | the integer to multiply with this integer. |
|
inline |
Adds the two given cyclotomic field elements.
lhs | the first field element to add. |
rhs | the second field element to add. |
|
inline |
Adds the two given cyclotomic field elements.
lhs | the first field element to add. |
rhs | the second field element to add. |
|
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.
other | the integer to add to this integer. |
|
inline |
Adds the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
Laurent< T > regina::operator+ | ( | const Laurent< T > & | lhs, |
const Laurent< T > & | rhs | ||
) |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
Calculates the sum of two matrices.
Neither this nor the given matrix is changed.
other | the matrix to add to this. |
|
inline |
Adds this to the given integer and returns the result.
This integer is not changed.
other | the integer to add to this integer. |
Polynomial< T > regina::operator+ | ( | const Polynomial< T > & | lhs, |
const Polynomial< T > & | rhs | ||
) |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
Calculates the sum of two rationals.
This rational is not changed.
r | the rational to add to this. |
|
inline |
Adds the two given cyclotomic field elements.
lhs | the first field element to add. |
rhs | the second field element to add. |
|
inline |
Adds the two given cyclotomic field elements.
lhs | the first field element to add. |
rhs | the second field element to add. |
|
inline |
Adds the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the given native integer to the given large integer.
If the large integer is infinite, the result will also be infinity.
lhs | the native integer to add. |
rhs | the large integer to add. |
|
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.
other | the integer to add to this integer. |
|
inline |
Adds this to the given integer and returns the result.
This integer is not changed.
other | the integer to add to this integer. |
|
inline |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
Adds the two given polynomials.
This operator +
is sometimes faster than using +=
, since it has more flexibility to avoid an internal deep copy.
lhs | the first polynomial to add. |
rhs | the second polynomial to add. |
|
inline |
The preincrement operator.
This operator increments this integer by one, and returns a reference to the integer after the increment.
|
inline |
The preincrement operator.
This operator increments this integer by one, and returns a reference to the integer after the increment.
|
inline |
The postincrement operator.
This operator increments this integer by one, and returns a copy of the integer before the increment.
|
inline |
The postincrement operator.
This operator increments this integer by one, and returns a copy of the integer before the increment.
|
inline |
Adds the given field element to this.
other | the field element to add to this. |
|
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.
other | the integer to add to this integer. |
Laurent2< T > & regina::Laurent2< T >::operator+= | ( | const Laurent2< T > & | other | ) |
Adds the given polynomial to this.
This and the given polynomial need not have the same range of non-zero coefficients.
other | the polynomial to add to this. |
|
inline |
Adds the given polynomial to this.
The given polynomial need not have the same minimum and/or maximum exponents as this.
+
operator instead, which is better able to avoid this deep copy where possible.other | the polynomial to add to this. |
Adds the given matrix to this.
This matrix is changed to reflect the result.
other | the matrix to add to this. |
|
inline |
Adds the given integer to this.
This integer is changed to reflect the result.
other | the integer to add to this integer. |
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.
+
operator instead, which is better able to avoid this deep copy where possible.other | the polynomial to add to this. |
Adds the given rational to this.
This rational is changed to reflect the result.
other | the rational to add to this. |
|
inline |
Adds the given vector to this vector.
This behaves correctly in the case where other is this
.
other | the vector to add to this vector. |
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.
other | the integer to add to this integer. |
|
inline |
Adds the given integer to this.
This integer is changed to reflect the result.
other | the integer to add to this integer. |
|
inline |
Determines the negative of this integer.
This integer is not changed.
Negative infinity will return infinity.
|
inline |
Determines the negative of this integer.
This integer is not changed.
|
inline |
Determines the negative of this matrix.
This matrix is not changed.
Rational regina::Rational::operator- | ( | ) | const |
Determines the negative of this rational.
This rational is not changed.
|
inline |
Subtracts the two given cyclotomic field elements.
lhs | the field element to subtract from. |
rhs | the field element to subtract. |
|
inline |
Subtracts the two given cyclotomic field elements.
lhs | the field element to subtract from. |
rhs | the field element to subtract. |
|
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.
other | the integer to subtract from this integer. |
|
inline |
Subtracts the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the polynomial to subtract from. |
rhs | the polynomial to subtract. |
|
inline |
Subtracts the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the polynomial to subtract from. |
rhs | the polynomial to subtract. |
Laurent< T > regina::operator- | ( | const Laurent< T > & | lhs, |
const Laurent< T > & | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Laurent< T > regina::operator- | ( | const Laurent< T > & | lhs, |
Laurent< T > && | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Calculates the difference of two matrices.
Neither this nor the given matrix is changed.
other | the matrix to subtract from this. |
|
inline |
Subtracts the given integer from this and returns the result.
This integer is not changed.
other | the integer to subtract from this integer. |
Polynomial< T > regina::operator- | ( | const Polynomial< T > & | lhs, |
const Polynomial< T > & | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Polynomial< T > regina::operator- | ( | const Polynomial< T > & | lhs, |
Polynomial< T > && | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Calculates the difference of two rationals.
This rational is not changed.
r | the rational to subtract from this. |
|
inline |
Subtracts the two given cyclotomic field elements.
lhs | the field element to subtract from. |
rhs | the field element to subtract. |
|
inline |
Subtracts the two given cyclotomic field elements.
lhs | the field element to subtract from. |
rhs | the field element to subtract. |
|
inline |
Returns the negative of the given field element.
arg | the field element to negate. |
|
inline |
Subtracts the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the polynomial to subtract from. |
rhs | the polynomial to subtract. |
|
inline |
Subtracts the two given polynomials.
The two polynomials need not have the same range of non-zero coefficients.
lhs | the polynomial to subtract from. |
rhs | the polynomial to subtract. |
Returns the negative of the given polynomial.
arg | the polynomial to negate. |
Laurent< T > regina::operator- | ( | Laurent< T > && | lhs, |
const Laurent< T > & | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Returns the negative of the given polynomial.
arg | the polynomial to negate. |
|
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.
other | the integer to subtract from this integer. |
|
inline |
Subtracts the given integer from this and returns the result.
This integer is not changed.
other | the integer to subtract from this integer. |
Polynomial< T > regina::operator- | ( | Polynomial< T > && | lhs, |
const Polynomial< T > & | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
Polynomial< T > regina::operator- | ( | Polynomial< T > && | lhs, |
Polynomial< T > && | rhs | ||
) |
Subtracts the two given polynomials.
This operator -
is sometimes faster than using -=
, since it has more flexibility to avoid an internal deep copy.
lhs | the polynomial to sutract rhs from. |
rhs | the polynomial to subtract from lhs. |
|
inline |
Returns the negative of the given polynomial.
arg | the polynomial to negate. |
|
inline |
The predecrement operator.
This operator decrements this integer by one, and returns a reference to the integer after the decrement.
|
inline |
The predecrement operator.
This operator decrements this integer by one, and returns a reference to the integer after the decrement.
|
inline |
The postdecrement operator.
This operator decrements this integer by one, and returns a copy of the integer before the decrement.
|
inline |
The postdecrement operator.
This operator decrements this integer by one, and returns a copy of the integer before the decrement.
|
inline |
Subtracts the given field element from this.
other | the field element to subtract from this. |
|
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.
other | the integer to subtract from this integer. |
Laurent2< T > & regina::Laurent2< T >::operator-= | ( | const Laurent2< T > & | other | ) |
Subtracts the given polynomial from this.
This and the given polynomial need not have the same range of non-zero coefficients.
other | the polynomial to subtract from this. |
|
inline |
Subtracts the given polynomial from this.
The given polynomial need not have the same minimum and/or maximum exponents as this.
other | the polynomial to subtract from this. |
Subtracts the given matrix from this.
This matrix is changed to reflect the result.
other | the matrix to subtract from this. |
|
inline |
Subtracts the given integer from this.
This integer is changed to reflect the result.
other | the integer to subtract from this integer. |
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.
other | the polynomial to subtract from this. |
Subtracts the given rational from this.
This rational is changed to reflect the result.
other | the rational to subtract from this. |
|
inline |
Subtracts the given vector from this vector.
This behaves correctly in the case where other is this
.
other | the vector to subtract from this vector. |
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.
other | the integer to subtract from this integer. |
|
inline |
Subtracts the given integer from this.
This integer is changed to reflect the result.
other | the integer to subtract from this integer. |
|
inline |
Divides the two given cyclotomic field elements.
lhs | the field element to divide by rhs. |
rhs | the field element to divide lhs by. |
|
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
Calculates the ratio of two rationals.
This rational is not changed.
r | the rational to divide this by. |
|
inline |
Divides the given field element by the given rational.
elt | the field element to divide by the given rational. |
scalar | the rational to divide by. |
|
inline |
Divides the given polynomial by the given scalar constant.
This uses the division operator /= for the coefficient type T.
The scalar is simply of type T; we use the identical type Laurent2<T>::Coefficient here to assist with C++ template type matching.
poly | the polynomial to divide by the given scalar. |
scalar | the scalar factor to divide by. |
|
inline |
Divides the given polynomial by the given scalar constant.
This uses the division operator /= for the coefficient type T.
The scalar is simply of type T; we use the identical type Laurent<T>::Coefficient here to assist with C++ template type matching.
poly | the polynomial to divide by the given scalar. |
scalar | the scalar factor to divide by. |
|
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
|
inline |
Divides the two given polynomials.
More precisely: suppose there exist polynomials q and r with coefficients of type T for which lhs = q.rhs + r
, and where r has smaller degree than rhs. Then we call q the quotient, and r the remainder.
This routine returns the quotient q, and discards the remainder. If you need to keep the remainder also, then call Polynomial::divisionAlg() instead.
Coefficients are divided using the operator /= on type T.
If your coefficient type T is not a field (e.g., if T is Integer), you must be sure to know in advance that the quotient exists (see the precondition below). Otherwise the behaviour of this routine is undefined.
lhs | the polynomial to divide by rhs. |
rhs | the polynomial that we will divide lhs by. |
|
inline |
Divides the given polynomial by the given scalar constant.
This uses the division operator /= for the coefficient type T.
The scalar is simply of type T; we use the identical type Polynomial<T>::Coefficient here to assist with C++ template type matching.
poly | the polynomial to divide by the given scalar. |
scalar | the scalar factor to divide by. |
|
inline |
Divides this by the given field element.
other | the field element to divide this by. |
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
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.
other | the polynomial to divide this by. |
Divides this by the given rational.
This rational is changed to reflect the result.
other | the rational to divide this by. |
|
inline |
Divides this field element by the given rational.
This has the effect of dividing the polynomial representation by a scalar constant.
scalar | the rational to divide this by. |
|
inline |
Divides this polynomial by the given constant.
This uses the division operator /= for the coefficient type T.
scalar | the scalar factor to divide by. |
|
inline |
Divides this polynomial by the given constant.
This uses the division operator /= for the coefficient type T.
scalar | the scalar factor to divide by. |
|
inline |
Divides this polynomial by the given constant.
This uses the division operator /= for the coefficient type T.
scalar | the scalar factor to divide by. |
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().
other | the integer to divide this by. |
|
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().
other | the integer to divide this by. |
|
inline |
Determines if this is less than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than the given integer.
|
inline |
Determines if this is less than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than the given integer. bool regina::Rational::operator< | ( | const Rational & | compare | ) | const |
Determines if this is less than the given rational.
compare | the rational with which this will be compared. |
true
if and only if this rational is less than compare.
|
inline |
Determines if this is less than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than the given integer.
|
inline |
Determines if this is less than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than the given integer. std::ostream& regina::operator<< | ( | std::ostream & | out, |
const IntegerBase< supportInfinity > & | i | ||
) |
Writes the given integer to the given output stream.
out | the output stream to which to write. |
i | the integer to write. |
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.
out | the output stream to which to write. |
mat | the matrix to write. |
std::ostream& regina::operator<< | ( | std::ostream & | out, |
const NativeInteger< bytes > & | i | ||
) |
Writes the given integer to the given output stream.
out | the output stream to which to write. |
i | the integer to write. |
|
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().
out | the output stream to which to write. |
p | the permutation to write. |
n | the number of objects being permuted. This must be between 3 and 16 inclusive. |
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
.
out | the output stream to which to write. |
rat | the rational to write. |
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.
out | the output stream to which to write. |
vector | the vector to write. |
|
inline |
Determines if this is less than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than or equal to the given integer.
|
inline |
Determines if this is less than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than or equal to the given integer.
|
inline |
Determines if this is less than or equal to the given rational.
compare | the rational with which this will be compared. |
true
if and only if this rational is less than or equal to compare.
|
inline |
Determines if this is less than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than or equal to the given integer.
|
inline |
Determines if this is less than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is less than or equal to the given integer. 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.
value | the new value of this integer, represented as a string of digits in base 10. |
|
inline |
Sets this to a copy of the given field element.
This assignment operator is safe even if this and value belong to different cyclotomic fields, or if this and/or value has not yet been initialised. The underlying field for this element will simply be changed to match the underlying field for value, and all old information stored for this element (if any) will be safely discarded. If value is uninitialised then this field element will become uninitialised also.
This operator induces a deep copy of value.
value | the new value to assign to this field element. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
inline |
Sets this rational to the given integer value.
The given integer may be infinite.
value | the new value of this rational. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
inline |
Sets this to be a copy of the given polynomial.
This and the given polynomial need not have the same range of non-zero coefficients.
This operator induces a deep copy of value.
A note to developers: although this is identical to the templated assignment operator, it must be declared and implemented separately. See the copy constructor for further details.
value | the polynomial to copy. |
Laurent2& regina::Laurent2< T >::operator= | ( | const Laurent2< U > & | value | ) |
Sets this to be a copy of the given polynomial.
This and the given polynomial need not have the same range of non-zero coefficients.
This operator induces a deep copy of value.
value | the polynomial to copy. |
Laurent< T > & regina::Laurent< T >::operator= | ( | const Laurent< T > & | value | ) |
Sets this to be a copy of the given polynomial.
This and the given polynomial need not have the same minimum and/or maximum exponents.
This operator induces a deep copy of value.
A note to developers: although this is identical to the templated assignment operator, it must be declared and implemented separately. See the copy constructor for further details.
value | the polynomial to copy. |
Laurent& regina::Laurent< T >::operator= | ( | const Laurent< U > & | value | ) |
Sets this to be a copy of the given polynomial.
This and the given polynomial need not have the same minimum and/or maximum exponents.
This operator induces a deep copy of value.
value | the polynomial to copy. |
|
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.
values | the four values to copy into this matrix. |
|
inline |
Copies the given matrix into this matrix.
It does not matter if this and the given matrix have different sizes; if they do then this matrix will be resized as a result.
This operator induces a deep copy of src.
src | the matrix to copy. |
Sets this matrix to be a copy of the given matrix.
cloneMe | the matrix to be copied. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
default |
Sets this permutation to be equal to the given permutation.
cloneMe | the permutation whose value will be assigned to this permutation. |
|
default |
Sets this permutation to be equal to the given permutation.
cloneMe | the permutation whose value will be assigned to this permutation. |
|
default |
Sets this permutation to be equal to the given permutation.
cloneMe | the permutation whose value will be assigned to this permutation. |
|
default |
Sets this permutation to be equal to the given permutation.
cloneMe | the permutation whose value will be assigned to this permutation. |
|
default |
Sets this permutation to be equal to the given permutation.
cloneMe | the permutation whose value will be assigned to this permutation. |
Polynomial< T > & regina::Polynomial< T >::operator= | ( | const Polynomial< T > & | value | ) |
Sets this to be a copy of the given polynomial.
This and the given polynomial need not have the same degree (but if they do not, then the degree of this polynomial will of course change).
This operator induces a deep copy of the given polynomial.
A note to developers: although this is identical to the templated assignment operator, it must be declared and implemented separately. See the copy constructor for further details.
value | the polynomial to copy. |
Polynomial& regina::Polynomial< T >::operator= | ( | const Polynomial< U > & | value | ) |
Sets this to be a copy of the given polynomial.
This and the given polynomial need not have the same degree (but if they do not, then the degree of this polynomial will of course change).
This operator induces a deep copy of the given polynomial.
value | the polynomial to copy. |
|
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.
scalar | the new rational value of this field element. |
Sets this rational to the given rational value.
value | the new value of this rational. |
|
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.
value | the new value of this integer, represented as a string of digits in base 10. |
|
inline |
Sets this vector equal to the given vector.
cloneMe | the vector whose value shall be assigned to this vector. |
|
inlinenoexcept |
Moves the contents of the given field element to this field element.
This is a fast (constant time) operation.
This assignment operator is safe even if this and value belong to different cyclotomic fields, or if this and/or value has not yet been initialised. The underlying field for this element will simply be changed to match the underlying field for value, and all old information stored for this element (if any) will be safely discarded. If value is uninitialised then this field element will become uninitialised also.
The element that was passed (value) will no longer be usable.
value | the field element to move. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
defaultnoexcept |
Moves the contents of the given polynomial to this polynomial.
This is a fast (constant time) operation.
This and the given polynomial need not have the same range of non-zero coefficients.
The polynomial that was passed (value) will no longer be usable.
value | the polynomial to move. |
|
inlinenoexcept |
Moves the contents of the given polynomial to this polynomial.
This is a fast (constant time) operation.
This and the given polynomial need not have the same minimum and/or maximum exponents.
The polynomial that was passed (value) will no longer be usable.
value | the polynomial to move. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
inline |
Sets this rational to the given integer value.
value | the new value of this rational. |
|
inlinenoexcept |
Moves the given matrix into this matrix.
This is a fast (constant time) operation.
It does not matter if this and the given matrix have different sizes; if they do then this matrix will be resized as a result.
The matrix that is passed (src) will no longer be usable.
src | the matrix to move. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
inlinenoexcept |
Moves the contents of the given polynomial to this polynomial.
This is a fast (constant time) operation.
This and the given polynomial need not have the same degree (but if they do not, then the degree of this polynomial will of course change).
The polynomial that was passed (value) will no longer be usable.
value | the polynomial to move. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
inline |
Sets this integer to the given value.
value | the new value of this integer. |
|
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
.
rhs | the value to compare with this. |
true
if and only if this and rhs are the same element of the same cyclotomic field.
|
inline |
Determines if this is equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are equal.
|
inline |
Determines if this is equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are equal.
|
inline |
Tests whether this and the given polynomial are equal.
rhs | the polynomial to compare with this. |
true
if and only if this and the given polynomial are equal.
|
inline |
Tests whether this and the given polynomial are equal.
rhs | the polynomial to compare with this. |
true
if and only if this and the given polynomial are equal.
|
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
.
other | the matrix to compare with this. |
true
if the matrices are equal as described above, or false
otherwise.
|
inline |
Determines if this is equal to the given matrix.
compare | the matrix with which this will be compared. |
true
if and only if this matrix is equal to compare.
|
inline |
Determines if this is equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are equal.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation are equal.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation are equal.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation are equal.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation are equal.
|
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.
other | the permutation with which to compare this. |
true
if and only if this and the given permutation are equal.
|
inline |
Tests whether this and the given polynomial are equal.
rhs | the polynomial to compare with this. |
true
if and only if this and the given polynomial are equal. bool regina::Rational::operator== | ( | const Rational & | compare | ) | const |
Determines if this is equal to the given rational.
compare | the rational with which this will be compared. |
true
if and only if this rational is equal to compare.
|
inline |
Determines if this vector is equal to the given vector.
compare | the vector with which this will be compared. |
true
if and only if the this and the given vector are equal.
|
inline |
Determines if this is equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are equal.
|
inline |
Determines if this is equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this and the given integer are equal.
|
inline |
Determines if this is greater than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than the given integer.
|
inline |
Determines if this is greater than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than the given integer. bool regina::Rational::operator> | ( | const Rational & | compare | ) | const |
Determines if this is greater than the given rational.
compare | the rational with which this will be compared. |
true
if and only if this rational is greater than compare.
|
inline |
Determines if this is greater than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than the given integer.
|
inline |
Determines if this is greater than the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than the given integer.
|
inline |
Determines if this is greater than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than or equal to the given integer.
|
inline |
Determines if this is greater than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than or equal to the given integer.
|
inline |
Determines if this is greater than or equal to the given rational.
compare | the rational with which this will be compared. |
true
if and only if this rational is greater than or equal to compare.
|
inline |
Determines if this is greater than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than or equal to the given integer.
|
inline |
Determines if this is greater than or equal to the given integer.
rhs | the integer with which this will be compared. |
true
if and only if this is greater than or equal to the given integer.
|
inline |
Determines the image of the given integer under this permutation.
source | the integer whose image we wish to find. This should be between 0 and n-1 inclusive. |
|
inline |
Determines the image of the given integer under this permutation.
source | the integer whose image we wish to find. This should be 0 or 1. |
|
inline |
Determines the image of the given integer under this permutation.
source | the integer whose image we wish to find. This should be between 0 and 2 inclusive. |
|
inline |
Determines the image of the given integer under this permutation.
source | the integer whose image we wish to find. This should be between 0 and 3 inclusive. |
|
inline |
Determines the image of the given integer under this permutation.
source | the integer whose image we wish to find. This should be between 0 and 4 inclusive. |
|
inline |
Returns the given coefficient of this polynomial.
There are no restrictions on the exponent exp.
poly[exp] = value
. In contrast, C++ users must use the separate routine set(), due to the fact that in C++ this square bracket operator is const.exp | the exponent of the term whose coefficient should be returned. |
|
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.
exp | indicates which coefficient to access; this must be between 0 and degree()-1 inclusive. |
|
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.
exp | indicates which coefficient to return; this must be between 0 and degree()-1 inclusive. |
|
inline |
|
inline |
|
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.
row | the index of the requested row; this must be 0 or 1. |
|
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).
row | the index of the requested row; this must be 0 or 1. |
|
inline |
Returns the index of this permutation in the Perm<2>::orderedS2 array.
|
inline |
Returns the index of this permutation in the Perm<3>::orderedS3 array.
|
inline |
Returns the index of this permutation in the Perm<4>::orderedS4 array.
int regina::Perm< 5 >::orderedS5Index | ( | ) | const |
Returns the index of this permutation in the Perm<5>::orderedS5 array.
|
inline |
Returns the index of this permutation in the Perm<2>::orderedS2 array.
This is a dimension-agnostic alias for orderedS2Index().
|
inline |
Returns the index of this permutation in the Perm<3>::orderedS3 array.
This is a dimension-agnostic alias for orderedS3Index().
|
inline |
Returns the index of this permutation in the Perm<4>::orderedS4 array.
This is a dimension-agnostic alias for orderedS4Index().
|
inline |
Returns the index of this permutation in the Perm<5>::orderedS5 array.
This is a dimension-agnostic alias for orderedS5Index().
|
inline |
Creates the identity permutation.
|
inline |
Creates the identity permutation.
|
inline |
Creates the identity permutation.
|
inline |
Creates the identity permutation.
|
inline |
Creates the identity permutation.
|
inline |
Creates a permutation mapping (a[0], ..., a[n-1]) to (b[0], ..., b[n-1]) respectively.
a | the array of preimages; this must have length n. |
b | the corresponding array of images; this must also have length n. |
|
inline |
Creates a permutation mapping (a[0], a[1]) to (b[0], b[1]) respectively.
a | the array of preimages; this must have length 2. |
b | the corresponding array of images; this must also have length 2. |
regina::Perm< 3 >::Perm | ( | const int * | a, |
const int * | b | ||
) |
Creates a permutation mapping (a[0], ..., a[2]) to (b[0], ..., b[2]) respectively.
a | the array of preimages; this must have length 3. |
b | the corresponding array of images; this must also have length 3. |
regina::Perm< 4 >::Perm | ( | const int * | a, |
const int * | b | ||
) |
Creates a permutation mapping (a[0], ..., a[3]) to (b[0], ..., b[3]) respectively.
a | the array of preimages; this must have length 4. |
b | the corresponding array of images; this must also have length 4. |
|
inline |
Creates a permutation mapping (a[0], ..., a[4]) to (b[0], ..., b[4]) respectively.
a | the array of preimages; this must have length 5. |
b | the corresponding array of images; this must also have length 5. |
|
inline |
Creates a permutation mapping i to image[i] for each 0 ≤ i < n.
image | the array of images. |
|
inline |
Creates a permutation mapping i to image[i] for each i = 0,1.
image | the array of images. |
|
inline |
Creates a permutation mapping i to image[i] for each i = 0,1,2.
image | the array of images. |
|
inline |
Creates a permutation mapping i to image[i] for each i = 0,1,2,3.
image | the array of images. |
|
inline |
Creates a permutation mapping i to image[i] for each i = 0,1,2,3,4.
image | the array of images. |
|
default |
Creates a permutation that is a clone of the given permutation.
cloneMe | the permutation to clone. |
|
default |
Creates a permutation that is a clone of the given permutation.
cloneMe | the permutation to clone. |
|
default |
Creates a permutation that is a clone of the given permutation.
cloneMe | the permutation to clone. |
|
default |
Creates a permutation that is a clone of the given permutation.
cloneMe | the permutation to clone. |
|
default |
Creates a permutation that is a clone of the given permutation.
cloneMe | the permutation to clone. |
|
inline |
Creates the transposition of a and b.
Note that a and b need not be distinct.
a | the element to switch with b. |
b | the element to switch with a. |
|
inline |
Creates the transposition of a and b.
Note that a and b need not be distinct.
a | the element to switch with b. |
b | the element to switch with a. |
|
inline |
Creates the transposition of a and b.
Note that a and b need not be distinct.
a | the element to switch with b. |
b | the element to switch with a. |
|
inline |
Creates the transposition of a and b.
Note that a and b need not be distinct.
a | the element to switch with b. |
b | the element to switch with a. |
|
inline |
Creates the transposition of a and b.
Note that a and b need not be distinct.
a | the element to switch with b. |
b | the element to switch with a. |
|
inline |
Creates a permutation mapping (0,1,2) to (a,b,c) respectively.
a | the desired image of 0. |
b | the desired image of 1. |
c | the desired image of 2. |
|
inline |
Creates a permutation mapping (0,1,2,3) to (a,b,c,d) respectively.
a | the desired image of 0. |
b | the desired image of 1. |
c | the desired image of 2. |
d | the desired image of 3. |
|
inline |
Creates a permutation mapping (0,1,2,3,4) to (a,b,c,d,e) respectively.
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. |
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.
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. |
|
inline |
Creates a permutation mapping (a0,b0,c0,d0,e0) to (a1,b1,c1,d1,e1) respectively.
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. |
|
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().
|
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().
|
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().
|
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().
|
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().
|
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.
|
inline |
Creates the zero polynomial.
|
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.
|
inline |
Creates a new copy of the given polynomial.
This constructor induces a deep copy of value.
A note for developers: even though this routine is identical to the templated copy constructor, it must be declared and implemented separately. Otherwise the compiler might create its own (incorrect) copy constructor automatically.
value | the polynomial to clone. |
|
inline |
Creates a new copy of the given polynomial.
This constructor induces a deep copy of value.
value | the polynomial to clone. |
|
inline |
Creates a new polynomial from the given sequence of coefficients.
The coefficients should appear in order from the constant coefficient to the leading coefficient.
There is no problem if the leading coefficient (i.e., the last coefficient in the sequence) is zero. An empty sequence will be treated as the zero polynomial.
This constructor induces a deep copy of the given range.
begin | the beginning of the sequence of coefficients. |
end | a past-the-end iterator indicating the end of the sequence of coefficients. |
|
inlinenoexcept |
Moves the contents of the given polynomial to this new polynomial.
This is a fast (constant time) operation.
The polynomial that was passed (value) will no longer be usable.
value | the polynomial to move. |
|
inlineexplicit |
Creates the polynomial x^d
for the given degree d.
degree | the degree of the new polynomial. |
|
inline |
Creates a new polynomial from a hard-coded sequence of coefficients.
This constructor takes a C++11 initialiser list, which should contain the coefficients in order from the constant coefficient to the leading coefficient.
There is no problem if the leading coefficient (i.e., the last coefficient in the sequence) is zero. An empty sequence will be treated as the zero polynomial.
coefficients | the full sequence of coefficients. |
|
inline |
Determines the preimage of the given integer under this permutation.
image | the integer whose preimage we wish to find. This should be between 0 and n-1 inclusive. |
|
inline |
Determines the preimage of the given integer under this permutation.
image | the integer whose preimage we wish to find. This should be 0 or 1. |
|
inline |
Determines the preimage of the given integer under this permutation.
image | the integer whose preimage we wish to find. This should be between 0 and 2 inclusive. |
|
inline |
Determines the preimage of the given integer under this permutation.
image | the integer whose preimage we wish to find. This should be between 0 and 3 inclusive. |
|
inline |
Determines the preimage of the given integer under this permutation.
image | the integer whose preimage we wish to find. This should be between 0 and 4 inclusive. |
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.
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. |
|
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.
which | indicates which prime is requested. |
autoGrow | specifies what to do if the requested prime lies beyond the list currently stored (see above). |
false
. 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.
n | the integer to factorise. |
|
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.
n | the integer to factorise. |
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.
exp | the power to which this integer will be raised. |
|
static |
Returns a random permutation on n elements.
All permutations are returned with equal probability.
This routine is thread-safe, and uses RandomEngine for its random number generation.
rand(randomEngine.engine(), even)
.even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
inlinestatic |
Returns a random permutation on two elements.
All permutations are returned with equal probability.
This routine is thread-safe, and uses RandomEngine for its random number generation.
rand(randomEngine.engine(), even)
.even | if true , then the resulting permutation is guaranteed to be even (which means, for a permutation on two elements, the resulting permutation must be the identity). |
|
inlinestatic |
Returns a random permutation on three elements.
All permutations are returned with equal probability.
This routine is thread-safe, and uses RandomEngine for its random number generation.
rand(randomEngine.engine(), even)
.even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
inlinestatic |
Returns a random permutation on four elements.
All permutations are returned with equal probability.
This routine is thread-safe, and uses RandomEngine for its random number generation.
rand(randomEngine.engine(), even)
.even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
inlinestatic |
Returns a random permutation on five elements.
All permutations are returned with equal probability.
This routine is thread-safe, and uses RandomEngine for its random number generation.
rand(randomEngine.engine(), even)
.even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
static |
Returns a random permutation on n elements, using the given uniform random bit generator.
All permutations are returned with equal probability.
The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.
URBG | A type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept. |
gen | the source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header). |
even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
static |
Returns a random permutation on two elements, using the given uniform random bit generator.
All permutations are returned with equal probability.
The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.
URBG | A type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept. |
gen | the source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header). |
even | if true , then the resulting permutation is guaranteed to be even (which means, for a permutation on two elements, the resulting permutation must be the identity). |
|
static |
Returns a random permutation on three elements, using the given uniform random bit generator.
All permutations are returned with equal probability.
The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.
URBG | A type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept. |
gen | the source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header). |
even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
static |
Returns a random permutation on four elements, using the given uniform random bit generator.
All permutations are returned with equal probability.
The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.
URBG | A type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept. |
gen | the source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header). |
even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
static |
Returns a random permutation on five elements, using the given uniform random bit generator.
All permutations are returned with equal probability.
The thread safety of this routine is of course dependent on the thread safety of your uniform random bit generator gen.
URBG | A type which, once any references are removed, must adhere to the C++ UniformRandomBitGenerator concept. |
gen | the source of randomness to use (e.g., one of the many options provided in the C++ standard <random> header). |
even | if true , then the resulting permutation is guaranteed to be even (and again all even permutations are returned with equal probability). |
|
static |
Generate a pseudo-random integer that is uniformly distributed in the interval [0,2^n).
The random number generation here does not use Regina's own RandomEngine class, but instead uses a separate random number generator provided by GMP.
n | the maximum number of bits in the pseudo-random integer. |
IntegerBase<supportInfinity> regina::IntegerBase< supportInfinity >::randomBoundedByThis | ( | ) | const |
Generate a pseudo-random integer that is uniformly distributed in the interval [0,*this).
The random number generation here does not use Regina's own RandomEngine class, but instead uses a separate random number generator provided by GMP.
|
static |
Generate a pseudo-random integer that is distributed in the interval [0,2^n), with a tendency to have long strings of 0s and 1s in its binary expansion.
The random number generation here does not use Regina's own RandomEngine class, but instead uses a separate random number generator provided by GMP.
n | the maximum number of bits in the pseudo-random integer. |
|
inline |
Initialises to 0/1.
regina::Rational::Rational | ( | const IntegerBase< supportInfinity > & | newNum, |
const IntegerBase< supportInfinity > & | newDen | ||
) |
Initialises to newNum/newDen.
newNum | the new numerator. |
newDen | the new denominator. |
|
inline |
Initialises to the given integer value.
The given integer may be infinite.
value | the new integer value of this rational. |
|
inline |
Initialises to the given rational value.
value | the new rational value of this rational. |
regina::Rational::Rational | ( | long | newNum, |
unsigned long | newDen | ||
) |
Initialises to newNum/newDen.
newNum | the new numerator. |
newDen | the new denominator. |
|
inline |
Initialises to the given integer value.
value | the new integer value of this rational. |
|
inline |
Returns the raw GMP data that describes this integer.
This routine allows IntegerBase to interact directly with libgmp and libgmpxx if necessary.
false
.
|
inline |
Returns the raw GMP data that describes this integer.
This routine allows IntegerBase to interact directly with libgmp and libgmpxx if necessary.
false
.
|
inline |
Creates a new ray that is a clone of the given ray.
cloneMe | the ray to clone. |
|
inline |
Creates a new ray all of whose coordinates are initialised to zero.
length | the number of elements in the new vector. |
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.
k | the number to reduce modulo modBase. |
modBase | the modular base in which to work. |
|
inline |
Computes the greatest common divisor of all elements of the given row.
The value returned is guaranteed to be non-negative.
This routine is only available when T is one of Regina's own integer classes (Integer, LargeInteger, or NativeIntgeger).
row | the index of the row whose gcd should be computed. |
regina::Matrix< T, ring >::REGINA_ENABLE_FOR_REGINA_INTEGER | ( | void | ) |
Divides all elements of the given row by the given integer.
This can only be used when the given integer divides into all row elements exactly (with no remainder). For the Integer class, this may be much faster than ordinary division.
This routine is only available when T is one of Regina's own integer classes (Integer, LargeInteger, or NativeIntgeger).
row | the index of the row whose elements should be divided by divBy. |
divBy | the integer to divide each row element by. |
|
inline |
Returns an identity matrix of the given size.
The matrix returned will have size rows and size columns.
This routine is only available when the template argument ring is true
.
size | the number of rows and columns of the matrix to build. |
|
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.
|
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.
|
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.
|
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.
|
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.
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.
matrix | the matrix to examine and rearrange. |
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:
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.
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. |
|
inline |
Returns the number of rows in this matrix.
|
inline |
Returns the index of this permutation in the Perm<2>::S2 array.
|
inline |
Returns the index of this permutation in the Perm<3>::S3 array.
|
inline |
Returns the index of this permutation in the Perm<4>::S4 array.
int regina::Perm< 5 >::S5Index | ( | ) | const |
Returns the index of this permutation in the Perm<5>::S5 array.
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.
void regina::Laurent< T >::scaleDown | ( | long | k | ) |
Divides all exponents in this polynomial by k for some integer k.
This is equivalent to replacing the variable x of the polynomial with x1/k.
Both positive and negative scaling factors k are allowed.
k | the scaling factor to divide exponents by. |
void regina::Laurent< T >::scaleUp | ( | long | k | ) |
Multiplies all exponents in this polynomial by k for some integer k.
This is equivalent to replacing the variable x of the polynomial with xk.
Both positive and negative scaling factors k are allowed.
k | the scaling factor to multiply exponents by. |
void regina::Laurent< T >::set | ( | long | exp, |
const T & | value | ||
) |
Changes the given coefficient of this polynomial.
There are no restrictions on the exponent exp, and the new coefficient value may be zero.
Note, however, that it is expensive to set a non-zero coefficient whose exponent is larger than maxExp() or smaller than minExp(), since this will typically require deallocating and reallocating the full list of coefficients.
In contrast, setting a zero coefficient for the exponent maxExp() or minExp() is cheap, even though the range of non-zero coefficients changes as a result.
p[exp] = value
.exp | the exponent of the term whose coefficient should be changed. |
value | the new value of this coefficient. |
void regina::Laurent2< T >::set | ( | long | xExp, |
long | yExp, | ||
const T & | value | ||
) |
Changes the given coefficient of this polynomial.
There are no restrictions on the exponents xExp and yExp, and the new coefficient value may be zero.
Moreover, the underlying data structures ensure that this operation is cheap regardless of the exponents involved.
p[xExp, yExp] = value
.xExp | the exponent attached to x. |
yExp | the exponent attached to y. |
value | the new value of the corresponding coefficient. |
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.
p[exp] = value
.exp | the exponent of the term whose coefficient should be changed. |
value | the new value of this coefficient. |
|
inline |
Sets the element at the given index in the vector to the given value.
index
is between 0 and size()-1 inclusive.index | the vector index to examine. |
value | the new value to assign to the element. |
|
inline |
Sets this permutation to that represented by the given internal code.
code | the internal code that will determine the new value of this permutation. |
|
inline |
Sets this permutation to that represented by the given internal code.
code | the internal code that will determine the new value of this permutation. |
|
inline |
Sets this permutation to that represented by the given internal code.
code | the internal code that will determine the new value of this permutation. |
|
inline |
Sets this permutation to that represented by the given first-generation permutation code.
code | the first-generation code that will determine the new value of this permutation. |
|
inline |
Sets this permutation to that represented by the given internal code.
newCode | the internal code that will determine the new value of this permutation. |
|
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.
code | the second-generation code that will determine the new value of this permutation. |
|
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.
fromData | the raw GMP integer to clone. |
|
inline |
Multiplies this polynomial by x^s
for some integer s.
s | the power of x to multiply by. |
|
inline |
Returns the sign of this integer.
In this routine, infinity is considered to have sign +1.
|
inline |
Returns the sign of this integer.
int regina::Perm< n >::sign |
Determines the sign of this permutation.
|
inline |
Determines the sign of this permutation.
|
inline |
Determines the sign of this permutation.
|
inline |
Determines the sign of this permutation.
int regina::Perm< 5 >::sign | ( | ) | const |
Determines the sign of this permutation.
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.
m1 | the first matrix to examine. |
m2 | the second matrix to examine. |
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. 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).
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. |
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.
|
inlinestatic |
Returns the number of primes (or suspected primes) currently stored.
Primes that are already stored can be accessed instantly; primes larger than those currently stored must be generated on the fly (which takes time).
This number may increase as the program runs (according to whether larger primes are requested), but it will never decrease.
|
inline |
Returns the number of elements in the vector.
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.
matrix | the matrix to transform. |
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:
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.
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. |
|
inline |
Returns the index of this permutation in the Perm<2>::S2 array.
This is a dimension-agnostic alias for S2Index().
|
inline |
Returns the index of this permutation in the Perm<3>::S3 array.
This is a dimension-agnostic alias for S3Index().
|
inline |
Returns the index of this permutation in the Perm<4>::S4 array.
This is a dimension-agnostic alias for S4Index().
|
inline |
Returns the index of this permutation in the Perm<5>::S5 array.
This is a dimension-agnostic alias for S5Index().
std::string regina::Perm< n >::str |
Returns a string representation of this permutation.
The representation will consist of n adjacent digits representing the images of 0,...,n-1 respectively. If n > 10, then lower-case hexadecimal digits will be used.
An example of a string representation for n = 5 is 30421
.
|
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
.
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
.
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
.
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
.
|
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()
.
variable | the symbol to use for the polynomial variable. This may be null , in which case the default variable x will be used. |
|
inline |
Returns this polynomial as a human-readable string, using the given variable name instead of x
.
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. |
|
inline |
Returns this polynomial as a human-readable string, using the given variable name instead of x
.
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. |
|
inline |
Returns this polynomial as a human-readable string, using the given variable names instead of x
and y
.
varX | the symbol to use for the variable x. This may be null , in which case the default symbol 'x' will be used. |
varY | the symbol to use for the variable y. This may be null , in which case the default symbol 'y' will be used. |
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
.
|
inline |
Subtracts the given multiple of the given vector to this vector.
This behaves correctly in the case where other is this
.
other | the vector a multiple of which will be subtracted from this vector. |
multiple | the multiple of other to be subtracted from this vector. |
void regina::IntegerBase< supportInfinity >::swap | ( | IntegerBase< supportInfinity > & | other | ) |
Swaps the values of this and the given integer.
other | the integer whose value will be swapped with this. |
|
inline |
Swaps the contents of this and the given polynomial.
This is a fast (constant time) operation.
This and the given polynomial need not have the same range of non-zero coefficients.
other | the polynomial whose contents should be swapped with this. |
|
inline |
Swaps the contents of this and the given polynomial.
This is a fast (constant time) operation.
This and the given polynomial do not need to have the same minimum and/or maximum exponents.
other | the polynomial whose contents should be swapped with this. |
|
inline |
Swaps the values of this and the given integer.
other | the integer whose value will be swapped with this. |
|
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.
other | the polynomial whose contents should be swapped with this. |
|
inline |
Swaps the values of this and the given rational.
other | the rational whose value will be swapped with this. |
|
inline |
Swaps the elements of the two given columns in the matrix.
first | the first column to swap. |
second | the second column to swap. |
|
inline |
Swaps the elements of the two given rows in the matrix.
first | the first row to swap. |
second | the second row to swap. |
std::string regina::Rational::TeX | ( | ) | const |
Returns this rational as written using TeX formatting.
No leading or trailing dollar signs will be included.
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
.
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. |
|
inline |
Returns the transpose of this matrix.
This matrix is not changed.
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.
len | the length of the prefix required; this must be between 0 and n inclusive. |
|
inline |
Returns a prefix of the string representation of this permutation, containing only the images of the first len integers.
len | the length of the prefix required; this must be between 0 and 2 inclusive. |
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.
len | the length of the prefix required; this must be between 0 and 3 inclusive. |
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.
len | the length of the prefix required; this must be between 0 and 4 inclusive. |
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.
len | the length of the prefix required; this must be between 0 and 5 inclusive. |
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.
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.
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.
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.
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.
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.
|
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.
|
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.
variable | the symbol to use for the polynomial variable. This may be null , in which case the default variable x will be used. |
|
inline |
Returns this polynomial as a human-readable string using unicode characters, using the given variable name instead of x
.
This is similar to the output from str(), except that it uses unicode characters to make the output more pleasant to read. In particular, it makes use of superscript digits for exponents and a wider minus sign.
The string is encoded in UTF-8.
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. |
|
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.
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. |
|
inline |
Returns this polynomial as a human-readable string using unicode characters, using the given variable names instead of x
and y
.
This is similar to the output from str(), except that it uses unicode characters to make the output more pleasant to read. In particular, it makes use of superscript digits for exponents and a wider minus sign.
The string is encoded in UTF-8.
varX | the symbol to use for the variable x. This may be null , in which case the default symbol 'x' will be used. |
varY | the symbol to use for the variable y. This may be null , in which case the default symbol 'y' will be used. |
|
inline |
Creates a new vector that is a clone of the given vector.
cloneMe | the vector to clone. |
|
inline |
Creates a new vector.
Its elements will not be initialised.
newVectorSize | the number of elements in the new vector; this must be strictly positive. |
|
inline |
Creates a new vector and initialises every element to the given value.
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. |
|
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.
out | the output stream to which to write. |
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.
None
.out | the output stream to which to write. |
|
inline |
Writes a detailed text representation of this object to the given output stream.
out | the output stream to which to write. |
|
inline |
Writes a short text representation of this object to the given output stream.
out | the output stream to which to write. |
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.
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. |
void regina::Cyclotomic::writeTextShort | ( | std::ostream & | out, |
bool | utf8 = false , |
||
const char * | variable = nullptr |
||
) | const |
Writes this field element to the given output stream, using the given variable name instead of x
.
The field element will be written using its rational polynomial representation. The underlying field will not be indicated in the output, since this is often already understood. If required, it can be accessed by calling c.field()
.
If utf8 is passed as true
then unicode superscript characters will be used for exponents; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.
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. |
void regina::Laurent< T >::writeTextShort | ( | std::ostream & | out, |
bool | utf8 = false , |
||
const char * | variable = nullptr |
||
) | const |
Writes this polynomial to the given output stream, using the given variable name instead of x
.
If utf8 is passed as true
then unicode superscript characters will be used for exponents and the minus sign; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.
out | the output stream to which to write. |
utf8 | true if unicode 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. |
void regina::Laurent2< T >::writeTextShort | ( | std::ostream & | out, |
bool | utf8 = false , |
||
const char * | varX = nullptr , |
||
const char * | varY = nullptr |
||
) | const |
Writes this polynomial to the given output stream, using the given variable names instead of x
and y
.
If utf8 is passed as true
then unicode superscript characters will be used for exponents and the minus sign; these will be encoded using UTF-8. This will make the output nicer, but will require more complex fonts to be available on the user's machine.
out | the output stream to which to write. |
utf8 | true if unicode characters may be used. |
varX | the symbol to use for the variable x. This may be null , in which case the default symbol 'x' will be used. |
varY | the symbol to use for the variable y. This may be null , in which case the default symbol 'y' will be used. |
|
inline |
Destroys this field element.
This is safe even if the field element was never initialised.
|
inline |
Destroys this integer.
|
inline |
Destroys this polynomial.
|
inline |
Destroys this matrix.
|
inline |
Destroys this polynomial.
|
inline |
Destroys this rational.
|
inline |
Destroys this vector.
|
extern |
A lookup table that stores (n choose k) for all n ≤ 16.
For all values 0 ≤ k ≤ n ≤ 16, the value binomSmall_[n][k] is the binomial coefficient (n choose k).
This array is used in the implementation of the function binomSmall(). End users should call binomSmall() instead of referring to this array directly.
const T & regina::Matrix< T, ring >::divBy |
|
protected |
The internal array containing all vector elements.
|
protected |
A pointer just beyond the end of the internal array.
The size of the vector can be computed as (end - elements).
|
extern |
Deprecated constant for managing floating-point roundoff errors.
A very small positive real designed to accommodate for rounding error. Any two numbers within epsilon of each other are considered to be equal by the generic zero-testing and sign-testing routines defined in this file (isZero(), isPositive(), isNonNegative() and so on).
|
staticconstexpr |
Indicates the number of bits used by the permutation code to store the image of a single integer.
This constant refers to the "image packing" codes that are used for n ≥ 5, as described in the Perm class notes. For n ≤ 4 the permutation codes are constructed in a different way, and so this constant is not present.
The full permutation code packs n such images together, and so uses n * imageBits bits in total.
|
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.
|
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.
|
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.
|
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.
|
static |
Contains the inverses of the permutations in the array S3.
Specifically, the inverse of permutation S3[i]
is the permutation S3[ invS3[i] ]
.
|
static |
Contains the inverses of the permutations in the array S4.
Specifically, the inverse of permutation S4[i]
is the permutation S4[ invS4[i] ]
.
|
static |
Contains the inverses of the permutations in the array S5.
Specifically, the inverse of permutation S5[i]
is the permutation S5[ invS5[i] ]
.
|
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.
|
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.
|
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.
|
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.
|
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!
|
staticconstexpr |
The total number of permutations on n elements.
This is the size of the symmetric group Sn.
|
static |
The total number of permutations on two elements.
This is the size of the array Sn.
|
static |
The total number of permutations on three elements.
This is the size of the array Sn.
|
static |
The total number of permutations on four elements.
This is the size of the array Sn.
|
static |
The total number of permutations on five elements.
This is the size of the array Sn.
|
staticconstexpr |
The total number of permutations on n-1 elements.
This is the size of the symmetric group Sn-1.
|
static |
The total number of permutations on one element.
This is the size of the array Sn_1.
|
static |
The total number of permutations on two elements.
This is the size of the array Sn_1.
|
static |
The total number of permutations on three elements.
This is the size of the array Sn_1.
|
static |
The total number of permutations on four elements.
This is the size of the array Sn_1.
|
static |
Globally available one.
|
static |
The multiplicative identity in the underlying ring.
|
static |
Globally available 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!
|
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.
|
static |
Contains all possible permutations of three elements in lexicographical order.
|
static |
Contains all possible permutations of three elements in lexicographical order.
In each permutation, 3 maps to 3.
|
static |
Contains all possible permutations of three elements in lexicographical order.
In each permutation, 3 maps to 3 and 4 maps to 4.
|
static |
Contains all possible permutations of four elements in lexicographical order.
|
static |
Contains all possible permutations of four elements in lexicographical order.
In each permutation, 4 maps to 4.
|
static |
Contains all possible permutations of five elements in lexicographical order.
|
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.
|
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.
|
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.
|
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.
|
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).
|
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).
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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).
|
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).
|
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).
|
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).
|
static |
Globally available undefined.
This is represented as 0/0.
|
static |
Globally available zero.
|
static |
The additive identity in the underlying ring.
|
static |
Globally available 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!
|
friend |
Multiplies the two given cyclotomic field elements.
lhs | the first field element to multiply. |
rhs | the second field element to multiply. |
|
friend |
Adds the two given cyclotomic field elements.
lhs | the first field element to add. |
rhs | the second field element to add. |
|
friend |
Subtracts the two given cyclotomic field elements.
lhs | the field element to subtract from. |
rhs | the field element to subtract. |
|
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.
out | the output stream to which to write. |
mat | the matrix to write. |
|
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
.
out | the output stream to which to write. |
rat | the rational to write. |