regina::NMatrixInt Class Reference
[Mathematical Support]

Represents a matrix of arbitrary precision integers. More...

#include <nmatrixint.h>

Inheritance diagram for regina::NMatrixInt:
regina::NMatrixRing< NLargeInteger > regina::ShareableObject regina::NMatrix< NLargeInteger > regina::boost::noncopyable

List of all members.

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.

Detailed Description

Represents a matrix of arbitrary precision integers.

Calculations will be exact no matter how large the integers become.

Python:
Most inherited member functions are implemented. Exceptions are noted in the documentation for each individual member function.

Member Function Documentation

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.

Precondition:
The argument divBy is neither zero nor infinity, and none of the elements of the given column are infinity.
The argument divBy divides exactly into every element of the given column (i.e., it leaves no remainder).
The given column number is between 0 and columns()-1 inclusive.
Parameters:
col the index of the column whose elements should be divided by divBy.
divBy the integer to divide each column element by.
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.

Precondition:
The argument divBy is neither zero nor infinity, and none of the elements of the given row are infinity.
The argument divBy divides exactly into every element of the given row (i.e., it leaves no remainder).
The given row number is between 0 and rows()-1 inclusive.
Parameters:
row the index of the row whose elements should be divided by divBy.
divBy the integer to divide each row element by.
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.

Precondition:
The given column number is between 0 and columns()-1 inclusive.
Parameters:
col the index of the column whose gcd should be computed.
Returns:
the greatest common divisor of all elements of this column.
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.

Precondition:
The given row number is between 0 and rows()-1 inclusive.
Parameters:
row the index of the row whose gcd should be computed.
Returns:
the greatest common divisor of all elements of this row.
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.

Precondition:
The given column number is between 0 and columns()-1 inclusive.
Parameters:
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.

Precondition:
The given row number is between 0 and rows()-1 inclusive.
Parameters:
row the index of the row to reduce.

The documentation for this class was generated from the following file:

Copyright © 1999-2009, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).