Documentation ¶
Index ¶
- Constants
- func Derivative(k int, es *Slice, cs slice.Interface, eh exponents.Helper, ...) (unwrappedexponents.Interface, unwrappedcoefficients.Interface, error)
- func NthDerivative(n int, k int, es *Slice, cs slice.Interface, eh exponents.Helper, ...) (unwrappedexponents.Interface, unwrappedcoefficients.Interface, error)
- func ToInt64Vector(k *int64vector.Parent, x object.Element) (*int64vector.Element, error)
- func ToInt64VectorSlice(k *int64vector.Parent, S slice.Interface) (int64vector.Slice, error)
- type Slice
- func (s *Slice) Append(x object.Element) unwrappedexponents.Interface
- func (s *Slice) AppendSlice(S slice.Interface) unwrappedexponents.Interface
- func (s *Slice) Copy() unwrappedexponents.Interface
- func (s *Slice) Entry(i int) object.Element
- func (s *Slice) GobDecode(buf []byte) error
- func (s *Slice) GobEncode() ([]byte, error)
- func (s *Slice) Hash() hash.Value
- func (s *Slice) Index(x object.Element) (int, error)
- func (s *Slice) Insert(x object.Element, idx int) unwrappedexponents.Interface
- func (s *Slice) IsEqualTo(S slice.Interface) (bool, error)
- func (s *Slice) IsSorted() bool
- func (s *Slice) Len() int
- func (s *Slice) Less(i int, j int) bool
- func (s *Slice) MonomialOrder() monomialorder.Type
- func (s *Slice) PrettyPrint(i int, names []string) string
- func (s *Slice) RangeOfDuplicateExponent() (int, int, error)
- func (s *Slice) Rank() int
- func (s *Slice) Remove(idx int) unwrappedexponents.Interface
- func (s *Slice) Search(x object.Element) (int, error)
- func (s *Slice) Slice(k int, m int) slice.Interface
- func (s *Slice) Swap(i int, j int)
- func (s *Slice) Universe() unwrappedexponents.Universe
Constants ¶
const DefaultOrder = monomialorder.Grevlex
DefaultOrder is the default monomial order.
Variables ¶
This section is empty.
Functions ¶
func Derivative ¶
func Derivative(k int, es *Slice, cs slice.Interface, eh exponents.Helper, ch coefficients.Helper) (unwrappedexponents.Interface, unwrappedcoefficients.Interface, error)
Derivative returns the formal partial derivative df/dx_k of the polynomial f, where the variables x_i are indexed from 0. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The partial derivative is returned as two parallel slices of exponents and coefficients.
func NthDerivative ¶
func NthDerivative(n int, k int, es *Slice, cs slice.Interface, eh exponents.Helper, ch coefficients.Helper) (unwrappedexponents.Interface, unwrappedcoefficients.Interface, error)
NthDerivative returns the n-th formal partial derivative d^nf/dx_k^n of the polynomial f, where the variables x_i are indexed from 0. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The partial derivative is returned as two parallel slices of exponents and coefficients.
func ToInt64Vector ¶
func ToInt64Vector(k *int64vector.Parent, x object.Element) (*int64vector.Element, error)
ToInt64Vector attempts to convert the element x to an int64vector element in k.
func ToInt64VectorSlice ¶
func ToInt64VectorSlice(k *int64vector.Parent, S slice.Interface) (int64vector.Slice, error)
ToInt64VectorSlice attempts to convert the slice S to a slice of int64-valued vector elements in k. Note that this will attempt to avoid copying the underlying slice S, so future modifications to S MAY also modify the returned slice.
Types ¶
type Slice ¶
type Slice struct {
// contains filtered or unexported fields
}
Slice defines a slice of multinomial exponents.
func New ¶
func New(k *int64vector.Parent, capacity int) *Slice
New returns a new exponent slice using the given universe and capacity.
func ToInt64VectorExponentsSlice ¶
ToInt64VectorExponentsSlice attempts to convert the slice S to a slice of int64-valued exponents in k. Note that this will attempt to avoid copying the underlying slice S, so future modifications to S MAY also modify the returned slice.
func (*Slice) Append ¶
func (s *Slice) Append(x object.Element) unwrappedexponents.Interface
Append appends the element x to the end of the exponents. Returns the updated exponents on success (which will be of the same underlying type). If x is not of the required type, this will panic.
func (*Slice) AppendSlice ¶
func (s *Slice) AppendSlice(S slice.Interface) unwrappedexponents.Interface
AppendSlice appends the elements in S to the end of the exponents. Returns the updated exponents on success (which will be of the same underlying type). If the elements in S are not of the required type, this will panic.
func (*Slice) Copy ¶
func (s *Slice) Copy() unwrappedexponents.Interface
Copy returns a copy of this slice (which will be of the same underlying type).
func (*Slice) Index ¶
Index searches for x in the slice s, returning the index of x if present, or -1 if not present. Assumes that s is sorted in increasing order.
func (*Slice) Insert ¶
Insert inserts the element x at index idx. Returns the updated exponents on success (which will be of the same underlying type). If the element x is not of the required type, this will panic. The index must be in the range 0..s.Len() (inclusive), or this will panic.
func (*Slice) IsEqualTo ¶
IsEqualTo returns true iff the entries in the slice are equal to the given slice S.
func (*Slice) IsSorted ¶
IsSorted returns true iff the entries in the slice are in strictly increasing order.
func (*Slice) Less ¶
Less reports whether the element with index i should sort before the element with index j. This panics if i or j are aout of range.
func (*Slice) MonomialOrder ¶
func (s *Slice) MonomialOrder() monomialorder.Type
MonomialOrder returns the monomial order of the parent common to the elements in the slice.
func (*Slice) PrettyPrint ¶
PrettyPrint returns a string representation of the i-th exponent using the given slice of names. This will panic if the index is out of range, or if there are not enough names for the dimension.
func (*Slice) RangeOfDuplicateExponent ¶
RangeOfDuplicateExponent returns the range of the first (consecutive) duplicate in the slice s. That is, returns indices 'start' and 'finish' such that s[i] == s[start] for all start <= i < finish. Assumes that the slice is sorted in increasing order. Returns -1, 0 if no duplicates are found.
func (*Slice) Remove ¶
func (s *Slice) Remove(idx int) unwrappedexponents.Interface
Remove removes the element at index idx. Returns the updated exponents on success (which will be of the same underlying type). This will panic if the index is invalid.
func (*Slice) Search ¶
Search searches for x in a slice s, and return the index as specified by sort.Search. The return value is the index to insert x if x is not present (it could be s.Len()). Assumes that the slice is sorted in increasing order.
func (*Slice) Slice ¶
Slice returns a subslice of the slice of exponents starting at index k and of length m - k. The returned subslice will be of the same underlying type. This will panic if the arguments are out of range.
func (*Slice) Swap ¶
Swap swaps the elements with indexes i and j. This panics if i or j are out of range.
func (*Slice) Universe ¶
func (s *Slice) Universe() unwrappedexponents.Universe
Universe returns the parent common to the elements in the slice.