Documentation ¶
Index ¶
- func AreEqual(S Interface, T slice.Interface) (bool, error)
- func Index(S Interface, x object.Element) (int, error)
- func IsSorted(S Interface) bool
- func RangeOfDuplicateExponent(S Interface) (int, int, error)
- func Search(S Interface, x object.Element) (int, error)
- type Interface
- type NewFunc
- type Universe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreEqual ¶
AreEqual returns true iff the slice of unwrapped exponents S is equal to the slice T. If S satisfies the interface:
type IsEqualToer interface { IsEqualTo(S slice.Interface) (bool, error) // IsEqualTo returns true iff the entries in the slice are equal to the given slice S. }
then S's IsEqualTo method will be called.
func Index ¶
Index searches for x in a sorted slice S and returns the index, or -1 if not present. Assumes that the slice is sorted in increasing order. If S satisfies the interface:
type Indexer interface { Index(x object.Element) (int, error) // Index searches for x in the slice, returning the index of x if present, or -1 if not present. Assumes that the slice is sorted in increasing order. }
then S's Index method will be called.
func IsSorted ¶
IsSorted returns true iff the entries in the slice S are in strictly increasing order. If S satisfies the interface:
type IsSorteder interface { IsSorted() bool // IsSorted returns true iff the entries in the slice are in strictly increasing order. }
then S's IsSorted method will be called.
func 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. If S satisfies the interface:
type RangeOfDuplicateExponenter interface { RangeOfDuplicateExponent() (int, int, error) // 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. }
then S's RangeOfDuplicateExponent method will be called.
func 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. If S satisfies the interface:
type Searcher interface { Search(x object.Element) (int, error) // 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. }
then S's Search method will be called.
Types ¶
type Interface ¶
type Interface interface { slice.Interface sort.Lesser sort.Swapper Universe() Universe // Universe returns the parent common to the elements in the unwrapped slice. Append(x object.Element) Interface // Append appends the element x to the end of the unwrapped slice of 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. Slice(k int, m int) slice.Interface // Slice returns a subslice of the unwrapped 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. Copy() Interface // Copy returns a copy of this slice (which will be of the same underlying type). }
Interface is the interface satisfied by an unwrapped slice of exponents.
func AppendSlice ¶
AppendSlice appends the elements of the slice S to the end of the unwrapped exponents slice T. Returns the updated exponents on success (which will be of the same underlying type). If the elements of S are not of the required type, this will panic. If T satisfies the interface:
type AppendSlicer interface { AppendSlice(S slice.Interface) Interface // AppendSlice appends the elements of the slice S to the end of the unwrapped slice of exponents. Returns the updated exponents on success (which will be of the same underlying type). If the elements of S are not of the required type, this will panic. }
then T's AppendSlice method will be called.
func Insert ¶
Insert inserts the element x into the unwrapped exponents slice S 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. If S satisfies the interface:
type Inserter interface { Insert(x object.Element, idx int) Interface // 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. }
then S's Insert method will be called.
func Remove ¶
Remove removes the element at index idx from the unwrapped exponents slice S. Returns the updated exponents on success (which will be of the same underlying type). This will panic if the index is invalid. If S satisfies the interface:
type Remover interface { Remove(idx int) 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. }
then S's Remove method will be called.
type Universe ¶
type Universe interface { monomialorder.Interface }
Universe is the interface satisfied by the common parent of elements in an unwrapped slice of exponents.