Regina Calculation Engine
|
Represents a matrix of arbitrary precision integers. More...
#include <nmatrixint.h>
Public Member Functions | |
NMatrixInt (unsigned long rows, unsigned long cols) | |
Creates a new matrix of the given size. | |
NMatrixInt (const NMatrixInt &cloneMe) | |
Creates a new matrix that is a clone of the given matrix. | |
void | divRowExact (unsigned long row, const NLargeInteger &divBy) |
Divides all elements of the given row by the given integer. | |
void | divColExact (unsigned long col, const NLargeInteger &divBy) |
Divides all elements of the given column by the given integer. | |
NLargeInteger | gcdRow (unsigned long row) |
Computes the greatest common divisor of all elements of the given row. | |
NLargeInteger | gcdCol (unsigned long col) |
Computes the greatest common divisor of all elements of the given column. | |
void | reduceRow (unsigned long row) |
Reduces the given row by dividing all its elements by their greatest common divisor. | |
void | reduceCol (unsigned long col) |
Reduces the given column by dividing all its elements by their greatest common divisor. | |
virtual void | writeTextShort (std::ostream &out) const |
Writes this object in short text format to the given output stream. | |
virtual void | writeTextLong (std::ostream &out) const |
Writes this object in long text format to the given output stream. |
Represents a matrix of arbitrary precision integers.
Calculations will be exact no matter how large the integers become.
void regina::NMatrixInt::divColExact | ( | unsigned long | col, |
const NLargeInteger & | divBy | ||
) | [inline] |
Divides all elements of the given column by the given integer.
This can only be used when the given integer divides into all column elements exactly (with no remainder), and is much faster than ordinary division.
col | the index of the column whose elements should be divided by divBy. |
divBy | the integer to divide each column element by. |
void regina::NMatrixInt::divRowExact | ( | unsigned long | row, |
const NLargeInteger & | divBy | ||
) | [inline] |
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), and is much faster than ordinary division.
row | the index of the row whose elements should be divided by divBy. |
divBy | the integer to divide each row element by. |
NLargeInteger regina::NMatrixInt::gcdCol | ( | unsigned long | col | ) | [inline] |
Computes the greatest common divisor of all elements of the given column.
The value returned is guaranteed to be non-negative.
col | the index of the column whose gcd should be computed. |
NLargeInteger regina::NMatrixInt::gcdRow | ( | unsigned long | row | ) | [inline] |
Computes the greatest common divisor of all elements of the given row.
The value returned is guaranteed to be non-negative.
row | the index of the row whose gcd should be computed. |
void regina::NMatrixInt::reduceCol | ( | unsigned long | col | ) | [inline] |
Reduces the given column by dividing all its elements by their greatest common divisor.
It is guaranteed that, if the column is changed at all, it will be divided by a positive integer.
col | the index of the column to reduce. |
void regina::NMatrixInt::reduceRow | ( | unsigned long | row | ) | [inline] |
Reduces the given row by dividing all its elements by their greatest common divisor.
It is guaranteed that, if the row is changed at all, it will be divided by a positive integer.
row | the index of the row to reduce. |