unwrappedexponents

package
v0.0.2-0...-db6250e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: CC0-1.0, CC0-1.0, CC0-1.0, + 1 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreEqual

func AreEqual(S Interface, T slice.Interface) (bool, error)

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

func Index(S Interface, x object.Element) (int, error)

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

func IsSorted(S Interface) bool

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

func RangeOfDuplicateExponent(S Interface) (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. 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(S Interface, 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. 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

func AppendSlice(T Interface, S slice.Interface) Interface

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

func Insert(S Interface, x object.Element, idx int) Interface

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

func Remove(S Interface, idx int) Interface

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 NewFunc

type NewFunc func(capacity int) Interface

NewFunc returns a new unwrapped slice of exponents with given capacity.

type Universe

type Universe interface {
	monomialorder.Interface
}

Universe is the interface satisfied by the common parent of elements in an unwrapped slice of exponents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL