int64vectorexponents

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOrder = monomialorder.Grevlex

DefaultOrder is the default monomial order.

Variables

This section is empty.

Functions

func Derivative

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

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

func ToInt64VectorExponentsSlice(k *int64vector.Parent, S slice.Interface) (*Slice, error)

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

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

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) GobDecode

func (s *Slice) GobDecode(buf []byte) error

GobDecode implements the gob.GobDecoder interface.

func (*Slice) GobEncode

func (s *Slice) GobEncode() ([]byte, error)

GobEncode implements the gob.GobEncoder interface.

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

func (s *Slice) Insert(x object.Element, idx int) unwrappedexponents.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.

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) 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

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) Rank

func (s *Slice) Rank() int

Rank returns the rank of the parent common to the elements in the slice.

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