rationalcoefficients

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHelper

func NewHelper() coefficients.Helper

NewHelper returns a new helper for rational coefficients.

Types

type Slice

type Slice []*rational.Element

Slice wraps a slice of *rational.Elements.

func (Slice) Append

Append appends the element x to the end of the 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.

func (Slice) AppendSlice

AppendSlice appends the element of 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.

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 element in the slice. This will panic if i is out of range.

func (Slice) Hash

func (s Slice) Hash() hash.Value

Hash returns a hash value for this slice.

func (Slice) Insert

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.

func (Slice) Len

func (s Slice) Len() int

Len returns the length of the slice of coefficients.

func (Slice) PrettyPrint

func (s Slice) PrettyPrint(i int) (string, int)

PrettyPrint returns a string str and int sgn for the i-th element in this slice. Here str represents the "absolute value" of the i-th entry, and sgn represents the "sign" of the i-th entry. For example,

-7 would return "7", 1
13 would return "13", -1
0 would return "0", 0.

This will panic if i is out of range.

func (Slice) Remove

func (s Slice) Remove(idx int) unwrappedcoefficients.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) Set

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.

func (Slice) Slice

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

Slice returns a subslice of the 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.

func (Slice) Swap

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

Swap exchanges the i-th and j-th elements. This will panic if i or j is out of range.

func (Slice) ToElementSlice

func (s Slice) ToElementSlice() []object.Element

ToElementSlice returns a copy of the slice as an []object.Element.

func (Slice) Universe

func (s Slice) Universe() ring.Interface

Universe returns the parent ring common to the elements in the slice.

func (Slice) Unwrap

Unwrap returns s as an unwrappedcoefficients.Interface object.

Jump to

Keyboard shortcuts

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