int64numberexponents

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, + 2 more Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Derivative

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

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

func ToSlice(S slice.Interface) (Slice, error)

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

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

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

Copy returns a copy of this slice (which will be of the same underlying type).

func (Slice) Entry

func (s Slice) Entry(i int) object.Element

Entry returns the i-th entry of the slice. This will panic if out of range.

func (Slice) Hash

func (s Slice) Hash() hash.Value

Hash returns a hash value for this slice.

func (Slice) Index

func (s Slice) Index(x object.Element) (int, error)

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

func (s Slice) IsEqualTo(S slice.Interface) (bool, error)

IsEqualTo returns true iff the entries in the slice are equal to the given slice S.

func (Slice) IsSorted

func (s Slice) IsSorted() bool

IsSorted returns true iff the entries in the slice are in strictly increasing order.

func (Slice) Len

func (s Slice) Len() int

Len returns the length of this slice of exponents.

func (Slice) Less

func (s Slice) Less(i int, j int) bool

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

func (s Slice) PrettyPrint(i int, names []string) string

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

func (s Slice) 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.

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

func (s Slice) 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.

func (Slice) Slice

func (s Slice) Slice(k int, m int) slice.Interface

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

func (s Slice) Swap(i int, j int)

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.

Jump to

Keyboard shortcuts

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