unwrappedcoefficients

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 coefficients 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.

Types

type Interface

type Interface interface {
	sort.Swapper
	slice.Interface
	Universe() ring.Interface           // Universe returns the parent ring common to the elements in the slice.
	Append(x object.Element) Interface  // Append appends the element x to the end of the unwrapped coefficients. Returns the updated coefficients 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 coefficients, 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 that a slice of coefficients needs to satisfy.

func AppendSlice

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

AppendSlice appends the element of the slice S to the end of the unwrapped coefficient slice T. Returns the updated coefficients 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
	   element of the slice S to the end of the coefficients. Returns
	   the updated coefficients 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 coefficients slice S at index idx. Returns the updated coefficients 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 coefficients 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 coefficients slice S. Returns the updated coefficients 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 coefficients 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.

func Set

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

Set sets the entry at index idx of the unwrapped coefficients slice S to x. Returns the updated coefficients on success (which will be of the same underlying type). If the element x is not of the required type, or if the index is invalid, this will panic. If S satisfies the interface:

type Setter interface {
	Set(x object.Element, idx int) Interface // Set sets the entry at
      index idx to x. Returns the updated coefficients on success
	  (which will be of the same underlying type). If the element x is
	  not of the required type, or if the index is invalid, this will
	  panic.
}

then S's Set method will be called.

type NewFunc

type NewFunc func(capacity int) Interface

NewFunc returns a new coefficient slice of given capacity.

Jump to

Keyboard shortcuts

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