Documentation ¶
Index ¶
- func AreEqual(x *Element, y *Element) bool
- func Cmp(x *Element, y *Element) (int, error)
- func DotProduct(x *Element, y *Element) (*integer.Element, error)
- type Element
- func Add(x *Element, y *Element) (*Element, error)
- func Basis(M *Parent) []*Element
- func ChangeParent(M *Parent, x object.Element) (*Element, error)
- func ConstantVector(M *Parent, c *integer.Element) (*Element, error)
- func CopySlice(S []*Element) []*Element
- func FromInt32Slice(M *Parent, S []int32) (*Element, error)
- func FromInt64Slice(M *Parent, S []int64) (*Element, error)
- func FromIntSlice(M *Parent, S []int) (*Element, error)
- func FromIntegerSlice(M *Parent, S []*integer.Element) (*Element, error)
- func FromString(M *Parent, s string) (*Element, error)
- func FromUint64Slice(M *Parent, S []uint64) (*Element, error)
- func GobDecode(dec *gob.Decoder) (*Element, error)
- func GobDecodeSlice(dec *gob.Decoder) ([]*Element, error)
- func NthBasisElement(M *Parent, n int) (*Element, error)
- func ScalarMultiplyByIntegerThenAdd(a *integer.Element, x *Element, y *Element) (*Element, error)
- func ScalarMultiplyByIntegerThenSubtract(a *integer.Element, x *Element, y *Element) (*Element, error)
- func Subtract(x *Element, y *Element) (*Element, error)
- func Sum(M *Parent, S ...*Element) (*Element, error)
- func ToElement(M *Parent, x object.Element) (*Element, error)
- func Zero(M *Parent) *Element
- func (x *Element) DecrementEntry(i int) (*Element, error)
- func (x *Element) Dimension() int
- func (x *Element) Entry(i int) (*integer.Element, error)
- func (x *Element) EntryAsUint64(i int) (uint64, error)
- func (x *Element) EntryAsUint64OrPanic(i int) uint64
- func (x *Element) EntryOrPanic(i int) *integer.Element
- func (x *Element) GobDecode(buf []byte) error
- func (x *Element) GobEncode() ([]byte, error)
- func (x *Element) Hash() hash.Value
- func (x *Element) IncrementEntry(i int) (*Element, error)
- func (x *Element) IsEqualTo(y *Element) bool
- func (x *Element) IsGreaterThan(y *Element) bool
- func (x *Element) IsGreaterThanOrEqualTo(y *Element) bool
- func (x *Element) IsLessThan(y *Element) bool
- func (x *Element) IsLessThanOrEqualTo(y *Element) bool
- func (x *Element) IsPositive() bool
- func (x *Element) IsZero() bool
- func (x *Element) Parent() object.Parent
- func (x *Element) ScalarMultiplyByInt64(a int64) (*Element, error)
- func (x *Element) ScalarMultiplyByInteger(a *integer.Element) (*Element, error)
- func (x *Element) ScalarMultiplyByUint64(a uint64) (*Element, error)
- func (x *Element) String() string
- func (x *Element) ToInt64Slice() ([]int64, error)
- func (x *Element) ToIntegerSlice() []*integer.Element
- func (x *Element) ToUint64Slice() []uint64
- func (x *Element) TotalDegree() *integer.Element
- type Parent
- func (M *Parent) Add(x object.Element, y object.Element) (object.Element, error)
- func (M *Parent) AreEqual(x object.Element, y object.Element) (bool, error)
- func (M *Parent) AssignName(name string)
- func (M *Parent) Basis() []object.Element
- func (M *Parent) Cmp(x object.Element, y object.Element) (int, error)
- func (M *Parent) Contains(x object.Element) bool
- func (M *Parent) Dimension() int
- func (M *Parent) InclusionMap(i int) (objectmap.Interface, error)
- func (M *Parent) IsZero(x object.Element) (bool, error)
- func (M *Parent) MonomialOrder() monomialorder.Type
- func (M *Parent) NthBasisElement(n int) (object.Element, error)
- func (M *Parent) ProjectionMap(i int) (objectmap.Interface, error)
- func (M *Parent) Rank() int
- func (M *Parent) ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error)
- func (M *Parent) String() string
- func (M *Parent) Sum(S ...object.Element) (object.Element, error)
- func (M *Parent) ToElement(x object.Element) (object.Element, error)
- func (M *Parent) Zero() object.Element
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element describes an uint64-valued vector.
func Add ¶
Add returns the vector sum x + y. This will return an error if x and y do not have the same parent, or if the result is out of range.
func ChangeParent ¶
ChangeParent returns a copy of x with the parent set to the space M of n-dimensional uint64-valued vectors. If x has a ToIntegerSlice method, this will be called to allow conversion. If x cannot be cast into M -- either because the dimensions or length of the slices disagree, or because there is no known way of automatically performing the conversion -- then an error will be returned.
func ConstantVector ¶
ConstantVector returns an n-dimensional vector in M all of whose entries are c.
func FromInt32Slice ¶
FromInt32Slice returns an n-dimensional vector in M with value S. This will return an error if the length of the slice does not agree with the dimension of M, or if any of the entries are negative.
func FromInt64Slice ¶
FromInt64Slice returns an n-dimensional vector in M with value S. This will return an error if the length of the slice does not agree with the dimension of M, or if any of the entries are negative.
func FromIntSlice ¶
FromIntSlice returns an n-dimensional vector in M with value S. This will return an error if the length of the slice does not agree with the dimension of M, or if any of the entries are negative.
func FromIntegerSlice ¶
FromIntegerSlice returns an n-dimensional vector in M with value S. This will return an error if the length of the slice does not agree with the dimension of M, or if the entries do not fit in an uint64.
func FromString ¶
FromString returns the n-dimensional vector in M represented by the string s. It returns an error if s is malformed, or if any of the entries of the vector represented by s are negative.
func FromUint64Slice ¶
FromUint64Slice returns an n-dimensional vector in M with value S. This will return an error if the length of the slice does not agree with the dimension of M.
func GobDecode ¶
GobDecode reads the next value from the given gob.Decoder and decodes it as an uint64-valued vector. The decoded vector will lie in the default lattice of appropriate dimension.
func GobDecodeSlice ¶
GobDecodeSlice reads the next value from the given gob.Decoder and decodes it as a slice of uint64-valued vectors. The decoded vectors will lie in the default lattice of appropriate dimension.
func NthBasisElement ¶
NthBasisElement returns the n-th standard basis element of M. Here the basis elements are indexed from 0 to d-1 (inclusive), where d is the dimension of M.
func ScalarMultiplyByIntegerThenAdd ¶
ScalarMultiplyByIntegerThenAdd returns a * x + y, where a is an integer, and x and y are vectors. This will return an error if x and y do not have the same parent, or if the result is out of range.
func ScalarMultiplyByIntegerThenSubtract ¶
func ScalarMultiplyByIntegerThenSubtract(a *integer.Element, x *Element, y *Element) (*Element, error)
ScalarMultiplyByIntegerThenSubtract returns a * x - y, where a is an integer, and x and y are vectors. This will return an error if x and y do not have the same parent, or if the result is out of range.
func Subtract ¶
Subtract returns the vector different x - y. This will return an error if x and y do not have the same parent, or if the result is out of range.
func Sum ¶
Sum returns the sum of the elements in the slice S. The sum of the empty slice is the zero element of M. This will return an error if the elements of S do not all have M as their parent.
func ToElement ¶
ToElement returns the argument as an n-dimensional integer-valued vector in the given parent, if that's where it belongs.
func (*Element) DecrementEntry ¶
DecrementEntry returns a new n-dimensional vector equal to x, but with the i-th entry decremented by one. Entries are indexed from 0 up to one less than the dimension of the parent of x (inclusive). This will return an error if i is out of range, or if the result is out of range.
func (*Element) Entry ¶
Entry returns the i-th entry in the vector x, where the entries are indexed from 0 up to one less than the dimension of the parent of x (inclusive). This will return an error if i is out of range.
func (*Element) EntryAsUint64 ¶
EntryAsUint64 returns the i-th entry in the vector x, where the entries are indexed from 0 up to one less than the dimension of the parent of x (inclusive). This will return an error if i is out of range.
func (*Element) EntryAsUint64OrPanic ¶
EntryAsUint64OrPanic returns the i-th entry in the vector x, where the entries are indexed from 0 up to one less than the dimension of the parent of x (inclusive). This will panic if i is out of range.
func (*Element) EntryOrPanic ¶
EntryOrPanic returns the i-th entry in the vector x, where the entries are indexed from 0 up to one less than the dimension of the parent of x (inclusive). This will panic if i is out of range.
func (*Element) GobDecode ¶
GobDecode implements the gob.GobDecoder interface. Important: Take great care that you are decoding into a new *Element; the safe way to do this is to use the GobDecode(dec *gob.Decode) function. The decoded vector will lie in the default lattice of appropriate dimension.
func (*Element) IncrementEntry ¶
IncrementEntry returns a new n-dimensional vector equal to x, but with the i-th entry incremented by one. Entries are indexed from 0 up to one less than the dimension of the parent of x (inclusive). This will return an error if i is out of range, or if the result is out of range.
func (*Element) IsGreaterThan ¶
IsGreaterThan returns true iff x and y have the same parent, and x > y.
func (*Element) IsGreaterThanOrEqualTo ¶
IsGreaterThanOrEqualTo returns true iff x and y have the same parent, and x >= y.
func (*Element) IsLessThan ¶
IsLessThan returns true iff x and y have the same parent, and x < y.
func (*Element) IsLessThanOrEqualTo ¶
IsLessThanOrEqualTo returns true iff x and y have the same parent, and x <= y.
func (*Element) ScalarMultiplyByInt64 ¶
ScalarMultiplyByInt64 returns the scalar product a * x, where a is an integer. This will return an error if the result is out of range.
func (*Element) ScalarMultiplyByInteger ¶
ScalarMultiplyByInteger returns the scalar product a * x, where a is an integer. This will return an error if the result is out of range.
func (*Element) ScalarMultiplyByUint64 ¶
ScalarMultiplyByUint64 returns the scalar product a * x, where a is an integer. This will return an error if the result is out of range.
func (*Element) ToInt64Slice ¶
ToInt64Slice returns the vector as a slice of int64s, or an error if any entry in the vector overflows an int64.
func (*Element) ToIntegerSlice ¶
ToIntegerSlice returns the vector as a slice of integers. Note that you can modify the returned slice without affecting the vector.
func (*Element) ToUint64Slice ¶
ToUint64Slice returns the vector as a slice of uint64s.
func (*Element) TotalDegree ¶
TotalDegree returns the total degree of the vector x. That is, it returns the sum of the entries in x.
type Parent ¶
type Parent struct {
// contains filtered or unexported fields
}
Parent is an n-dimensional uint64-module.
func DefaultLattice ¶
DefaultLattice returns the default space of n-dimensional uint64-valued vectors with lex ordering. This is provided for use when the particular space the vector lives in is either currently undetermined, or doesn't matter. Calls to DefaultLattice (with the same value of n) always return the same n-dimensional space. This will return an error if n is negative.
func DefaultLatticeWithOrder ¶
func DefaultLatticeWithOrder(n int, c monomialorder.Type) (*Parent, error)
DefaultLatticeWithOrder returns the default space of n-dimensional uint64-valued vectors with given ordering. This is provided for use when the particular space the vector lives in is either currently undetermined, or doesn't matter. Calls to DefaultLattice (with the same value of n) always return the same n-dimensional space. This will return an error if n is negative.
func NewLattice ¶
NewLattice returns a new space of n-dimensional uint64-valued vectors with lex ordering. That is, it returns a copy of uint64^n. Note that two different copies of uint64^n will be regarded as being distinct. This will return an error if n is negative.
func NewLatticeWithOrder ¶
func NewLatticeWithOrder(n int, c monomialorder.Type) (M *Parent, err error)
NewLatticeWithOrder returns a new space of n-dimensional integer-valued vectors with given ordering. That is, it returns a copy of ZZ^n. Note that two different copies of ZZ^n will be regarded as being distinct. This will return an error if n is negative.
func (*Parent) AssignName ¶
AssignName assigns a name to M to be used by String.
func (*Parent) Contains ¶
Contains returns true iff x is a vector in M. Note that we do not allow a natural isomorphism between two different parents, hence it is not sufficient that the dimensions agree.
func (*Parent) InclusionMap ¶
InclusionMap returns the inclusion ZZ -> M into the (i+1)-th factor of the of M. This is, the inclusion maps are indexed from 0.
func (*Parent) MonomialOrder ¶
func (M *Parent) MonomialOrder() monomialorder.Type
MonomialOrder returns the monomial order being used to order the elements of M.
func (*Parent) NthBasisElement ¶
NthBasisElement returns the n-th standard basis element of M. Here the basis elements are indexed from 0 to d-1 (inclusive), where d is the dimension of M.
func (*Parent) ProjectionMap ¶
ProjectionMap returns the projection M -> ZZ onto the (i+1)-th factor of M. That is, projection maps are indexed from 0.
func (*Parent) ScalarMultiplyByInteger ¶
func (M *Parent) ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error)
ScalarMultiplyByInteger returns nx, where this is defined to be x + ... + x (n times) if n is positive, and -x - ... - x (|n| times) if n is negative. This returns an error if the result is out of range.
func (*Parent) Sum ¶
Sum returns the sum of the elements in the slice S. The sum of the empty slice is the zero element of M.