Documentation ¶
Index ¶
- func DotProduct(x *integervector.Element, y *integervector.Element) *integer.Element
- func VectorFromIntSlice(L *integervector.Parent, S []int) *integervector.Element
- func VectorFromIntegerSlice(L *integervector.Parent, S []*integer.Element) *integervector.Element
- func VectorMultiplyMatrix(v *integervector.Element, m Matrix) *integervector.Element
- func VectorSum(S ...*integervector.Element) *integervector.Element
- type Matrix
- func (m Matrix) Column(j int) *integervector.Element
- func (m Matrix) Columns() []*integervector.Element
- func (m Matrix) EntryOrPanic(i int, j int) *integer.Element
- func (m Matrix) FromColumns(columns []*integervector.Element) Matrix
- func (m Matrix) NumberOfColumns() int
- func (m Matrix) NumberOfRows() int
- func (m Matrix) RowSums() []*integer.Element
- func (m Matrix) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DotProduct ¶
func DotProduct(x *integervector.Element, y *integervector.Element) *integer.Element
dotProduct returns the dot-product of the two vectors. This will panic if the dimensions differ.
func VectorFromIntSlice ¶
func VectorFromIntSlice(L *integervector.Parent, S []int) *integervector.Element
VectorFromIntSlice returns an integer vector in the lattice L from the given slice. It will panic if the dimension of L does not match the length of S.
func VectorFromIntegerSlice ¶
func VectorFromIntegerSlice(L *integervector.Parent, S []*integer.Element) *integervector.Element
VectorFromIntegerSlice returns an integer vector in the lattice L from the given slice. It will panic if the dimension of L does not match the length of S.
func VectorMultiplyMatrix ¶
func VectorMultiplyMatrix(v *integervector.Element, m Matrix) *integervector.Element
VectorMultiplyMatrix returns the product v*m (i.e. the matrix multiplies the row vector v on the right)
func VectorSum ¶
func VectorSum(S ...*integervector.Element) *integervector.Element
VectorSum returns the sum of the given vectors.
Types ¶
type Matrix ¶
type Matrix []*integervector.Element
Matrix represents a matrix with integer entries, given by a slice of vectors for the columns.
func IdentityMatrix ¶
IdentityMatrix returns the dim x dim identity matrix
func (Matrix) Column ¶
func (m Matrix) Column(j int) *integervector.Element
Column returns the j-th column of a matrix. j indexes from 0
func (Matrix) Columns ¶
func (m Matrix) Columns() []*integervector.Element
Columns returns the columns of a matrix, as a slice of integer vectors
func (Matrix) EntryOrPanic ¶
EntryOrPanic returns the (i,j) entry of a matrix. i and j both index from 0. This will panic if either i or j is out of range.
func (Matrix) FromColumns ¶
func (m Matrix) FromColumns(columns []*integervector.Element) Matrix
FromColumns returns a new matrix with columns given by columns, which is a slice of integer vectors
func (Matrix) NumberOfColumns ¶
NumberOfColumns returns the number of columns of the matrix.
func (Matrix) NumberOfRows ¶
NumberOfRows returns the number of rows of the matrix.