Documentation ¶
Index ¶
- func NewHelper() coefficients.Helper
- type Slice
- func (s Slice) Append(x object.Element) unwrappedcoefficients.Interface
- func (s Slice) AppendSlice(S slice.Interface) unwrappedcoefficients.Interface
- func (s Slice) Copy() unwrappedcoefficients.Interface
- func (s Slice) Entry(i int) object.Element
- func (s Slice) Hash() hash.Value
- func (s Slice) Insert(x object.Element, idx int) unwrappedcoefficients.Interface
- func (s Slice) Len() int
- func (s Slice) PrettyPrint(i int) (string, int)
- func (s Slice) Remove(idx int) unwrappedcoefficients.Interface
- func (s Slice) Set(x object.Element, idx int) unwrappedcoefficients.Interface
- func (s Slice) Slice(k int, m int) slice.Interface
- func (s Slice) Swap(i, j int)
- func (s Slice) ToElementSlice() []object.Element
- func (s Slice) Universe() ring.Interface
- func (s Slice) Unwrap() unwrappedcoefficients.Interface
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 ¶
Slice wraps a slice of *rational.Elements.
func (Slice) Append ¶
func (s Slice) Append(x object.Element) unwrappedcoefficients.Interface
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 ¶
func (s Slice) AppendSlice(S slice.Interface) unwrappedcoefficients.Interface
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 ¶
func (s Slice) Copy() unwrappedcoefficients.Interface
Copy returns a copy of this slice (which will be of the same underlying type).
func (Slice) Entry ¶
Entry returns the i-th element in the slice. This will panic if i is out of range.
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) PrettyPrint ¶
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 ¶
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 ¶
Swap exchanges the i-th and j-th elements. This will panic if i or j is out of range.
func (Slice) ToElementSlice ¶
ToElementSlice returns a copy of the slice as an []object.Element.
func (Slice) Unwrap ¶
func (s Slice) Unwrap() unwrappedcoefficients.Interface
Unwrap returns s as an unwrappedcoefficients.Interface object.