Documentation ¶
Index ¶
- func AreEqual(x *Element, y *Element) bool
- func Ring(R *Parent) integer.Parent
- type Element
- func Add(x *Element, y *Element) (*Element, error)
- func FromSlice(R *Parent, S []*integer.Element) (*Element, error)
- func Multiply(x *Element, y *Element) (*Element, error)
- func Negate(x *Element) *Element
- func One(R *Parent) *Element
- func Power(x *Element, k *integer.Element) (*Element, error)
- func PowerInt64(x *Element, k int64) (*Element, error)
- func Subtract(x *Element, y *Element) (*Element, error)
- func Sum(R *Parent, S ...*Element) (*Element, error)
- func ToElement(R *Parent, x object.Element) (*Element, error)
- func Zero(R *Parent) *Element
- func (x *Element) Column(i int) ([]*integer.Element, error)
- func (x *Element) Columns() [][]*integer.Element
- func (x *Element) Determinant() *integer.Element
- func (x *Element) Entries() []*integer.Element
- func (x *Element) Entry(i int, j int) (*integer.Element, error)
- func (x *Element) EntryOrPanic(i int, j int) *integer.Element
- func (x *Element) FlatEntry(i int) (*integer.Element, error)
- func (x *Element) FlatEntryOrPanic(i int) *integer.Element
- func (x *Element) Hash() hash.Value
- func (x *Element) Inverse() (*Element, error)
- func (x *Element) IsEqualTo(y *Element) bool
- func (x *Element) IsOne() bool
- func (x *Element) IsSquare() bool
- func (x *Element) IsZero() bool
- func (x *Element) Len() int
- func (x *Element) Negate() *Element
- func (x *Element) NumberOfColumns() int
- func (x *Element) NumberOfRows() int
- func (x *Element) Parent() object.Parent
- func (x *Element) Power(k *integer.Element) (*Element, error)
- func (x *Element) PowerInt64(k int64) (*Element, error)
- func (x *Element) Row(i int) ([]*integer.Element, error)
- func (x *Element) Rows() [][]*integer.Element
- func (x *Element) ScalarMultiplyByCoefficient(c *integer.Element) (*Element, error)
- func (x *Element) ScalarMultiplyByInt64(n int64) *Element
- func (x *Element) ScalarMultiplyByInteger(n *integer.Element) *Element
- func (x *Element) String() string
- func (x *Element) Transpose() *Element
- type Parent
- func (R *Parent) Add(x object.Element, y object.Element) (object.Element, error)
- func (R *Parent) AreEqual(x object.Element, y object.Element) (bool, error)
- func (R *Parent) Column(x object.Element, i int) ([]object.Element, error)
- func (R *Parent) Columns(x object.Element) ([][]object.Element, error)
- func (R *Parent) Contains(x object.Element) bool
- func (R *Parent) Determinant(x object.Element) (object.Element, error)
- func (R *Parent) Entries(x object.Element) ([]object.Element, error)
- func (R *Parent) Entry(x object.Element, i int, j int) (object.Element, error)
- func (R *Parent) FromSlice(S []object.Element) (object.Element, error)
- func (R *Parent) Inverse(x object.Element) (object.Element, error)
- func (R *Parent) IsOne(x object.Element) (bool, error)
- func (R *Parent) IsZero(x object.Element) (bool, error)
- func (R *Parent) Multiply(x object.Element, y object.Element) (object.Element, error)
- func (R *Parent) Negate(x object.Element) (object.Element, error)
- func (R *Parent) NumberOfColumns() int
- func (R *Parent) NumberOfRows() int
- func (R *Parent) One() object.Element
- func (R *Parent) Power(x object.Element, k *integer.Element) (object.Element, error)
- func (R *Parent) Ring() ring.Interface
- func (R *Parent) Row(x object.Element, i int) ([]object.Element, error)
- func (R *Parent) Rows(x object.Element) ([][]object.Element, error)
- func (R *Parent) ScalarMultiplyByCoefficient(c object.Element, x object.Element) (object.Element, error)
- func (R *Parent) ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error)
- func (R *Parent) String() string
- func (R *Parent) Subtract(x object.Element, y object.Element) (object.Element, error)
- func (R *Parent) Sum(S ...object.Element) (object.Element, error)
- func (R *Parent) ToElement(x object.Element) (object.Element, error)
- func (R *Parent) Transpose(x object.Element) (object.Element, error)
- func (R *Parent) Zero() object.Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element is a matrix with integer entries.
func Add ¶
Add returns the sum x + y of two matrices x and y. This will return an error if x and y do not have the same parent.
func FromSlice ¶
FromSlice returns a matrix in the matrix algebra R, with entries S. The entries are read row-by-row.
func Multiply ¶
Multiply returns the product x * y of two matrices x and y. This will return an error if x and y do not have the same parent.
func Subtract ¶
Subtract returns the difference x - y of two matrices x and y. This will return an error if x and y do not have the same parent.
func Sum ¶
Sum returns the sum of the matrices in the slice S. All matrices must have the same parent R. If S is empty, the zero element in R is returned.
func ToElement ¶
ToElement returns x as a matrix with integer entries in R, if x can naturally be regarded as belonging there.
func (*Element) Column ¶
Column returns the i-th column of the matrix x. Columns are indexed from 0. It returns an error if the index i is out of range.
func (*Element) Determinant ¶
Determinant returns the determinant of the matrix x.
func (*Element) Entry ¶
Entry returns the (i,j)-th entry of the matrix x. Rows and columns are indexed from zero. It returns an error if either i or j is negative or too large (i.e. if i and j refer to a non-existent entry of x).
func (*Element) EntryOrPanic ¶
EntryOrPanic returns the (i,j)-th entry of the matrix x. Rows and columns are indexed from zero. It panics error if either i or j is negative or too large (i.e. if i and j refer to a non-existent entry of x).
func (*Element) FlatEntry ¶
FlatEntry returns the i-th entry of the matrix x, read row by row. Flat entries are indexed from zero up to (but not including) x.Len(). It returns an error if the index i is out of range.
func (*Element) FlatEntryOrPanic ¶
FlatEntryOrPanic returns the i-th entry of the matrix x, read row by row. Flat entries are indexed from zero up to (but not including) x.Len(). It panics if the index is out of range.
func (*Element) IsEqualTo ¶
IsEqualTo returns true iff the matrices x and y have the same parent, and x = y.
func (*Element) Len ¶
Len returns the total number of entries in the matrix x (i.e. the product of the number of rows and the number of columns).
func (*Element) NumberOfColumns ¶
NumberOfColumns returns the number of columns of the matrix x.
func (*Element) NumberOfRows ¶
NumberOfRows returns the number of rows of the matrix x.
func (*Element) PowerInt64 ¶
PowerInt64 returns x^k.
func (*Element) Row ¶
Row returns the i-th row of the matrix x. Rows are indexed from 0. It returns an error if the index i is out of range.
func (*Element) ScalarMultiplyByCoefficient ¶
ScalarMultiplyByCoefficient returns c * x, where c is an element in the ring containing the entries of the matrices in R.
func (*Element) ScalarMultiplyByInt64 ¶
ScalarMultiplyByInt64 returns the scalar multiple n * x of the matrix x with the integer n, where this is defined to be x + ... + x (n times) if n is positive, -x - ... - x (|n| times) if n is negative, and 0 if n is zero.
func (*Element) ScalarMultiplyByInteger ¶
ScalarMultiplyByInteger returns the scalar multiple n * x of the matrix x with the integer n, where this is defined to be x + ... + x (n times) if n is positive, -x - ... - x (|n| times) if n is negative, and 0 if n is zero.
type Parent ¶
type Parent struct {
// contains filtered or unexported fields
}
Parent is the parent matrix algebra for matrices with integer entries.
func NewAlgebra ¶
NewAlgebra returns the algebra of n x n matrices with entries in ZZ.
func (*Parent) AreEqual ¶
AreEqual returns true iff x and y are both contained in the parent, and x = y.
func (*Parent) Column ¶
Column returns the i-th column of the matrix x. Columns are indexed from 0. It returns an error if the index i is out of range. The entries are elements of the ring containing the entries of the matrices in R.
func (*Parent) Columns ¶
Columns returns the columns of the matrix x. The entries are elements of the ring containing the entries of the matrices in R.
func (*Parent) Contains ¶
Contains returns true iff x is an element of this parent, or can naturally be regarded as an element of this parent.
func (*Parent) Determinant ¶
Determinant returns the determinant of the matrix x. This is given as an element in the ring of entries.
func (*Parent) Entries ¶
Entries returns the entries of the matrix x, row by row. The entries are elements of the ring containing the entries of the matrices in R.
func (*Parent) Entry ¶
Entry returns the (i,j)-th entry of the matrix x. Rows and columns are indexed from zero. It returns an error if either i or j is negative or too large (i.e. if i and j refer to a non-existent entry of x). The returned entry is an element of the ring containing the entries of the matrices in R.
func (*Parent) NumberOfColumns ¶
NumberOfColumns returns the number of columns of a matrix in R.
func (*Parent) NumberOfRows ¶
NumberOfRows returns the number of rows of a matrix in R.
func (*Parent) Row ¶
Row returns the i-th row of the matrix x. Rows are indexed from 0. It returns an error if the index i is out of range. The entries are elements of the ring containing the entries of the matrices in R.
func (*Parent) Rows ¶
Rows returns the rows of the matrix x. The entries are elements of the ring containing the entries of the matrices in R.
func (*Parent) ScalarMultiplyByCoefficient ¶
func (R *Parent) ScalarMultiplyByCoefficient(c object.Element, x object.Element) (object.Element, error)
ScalarMultiplyByCoefficient returns c * x, where c is an element in the ring containing the entries of the matrices in R.
func (*Parent) ScalarMultiplyByInteger ¶
func (R *Parent) ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error)
ScalarMultiplyByInteger returns n * x, where this is defined to be:
x + ... + x (n times) if n > 0; the zero element if n = 0; -x - ... - x (|n| times) if n < 0.
func (*Parent) Sum ¶
Sum returns the sum of the elements in the slice S. The sum of the empty slice is the zero element.
func (*Parent) ToElement ¶
ToElement returns x as an element of this parent, or an error if x cannot naturally be regarded as an element of this parent.