Documentation ¶
Index ¶
- func Derivative(es Slice, cs slice.Interface, ch coefficients.Helper) (unwrappedexponents.Interface, unwrappedcoefficients.Interface, error)
- func ToInt64Number(x object.Element) (*int64number.Element, 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) 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) PrettyPrint(i int, names []string) string
- func (s Slice) RangeOfDuplicateExponent() (int, int, error)
- 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Derivative ¶
func Derivative(es Slice, cs slice.Interface, ch coefficients.Helper) (unwrappedexponents.Interface, unwrappedcoefficients.Interface, error)
Derivative returns the formal derivative df/dx of the polynomial f. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The derivative is returned as two parallel slices of exponents and coefficients.
func ToInt64Number ¶
func ToInt64Number(x object.Element) (*int64number.Element, error)
ToInt64Number attempts to convert the element x to an int64number element.
Types ¶
type Slice ¶
type Slice []*int64number.Element
Slice defines a slice of univariate exponents.
func NthDerivative ¶
func NthDerivative(n int, es Slice, cs slice.Interface, ch coefficients.Helper) (Slice, unwrappedcoefficients.Interface, error)
NthDerivative returns the n-th formal derivative d^nf/dx^n of the polynomial f. Here f is the polynomial defined by the parallel slices es and cs of exponents and coefficients. The derivative is returned as two parallel slices of exponents and coefficients.
func ToSlice ¶
ToSlice attempts to convert the slice S to a Slice. 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) 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.