Documentation ¶
Index ¶
- func AreEqual(x *Element, y *Element) bool
- func Cmp(x *Element, y *Element) int
- type Element
- func Add(x *Element, y *Element) (*Element, error)
- func CopySlice(S []*Element) []*Element
- func FromInt(n int) *Element
- func FromInt32(n int32) *Element
- func FromInt64(n int64) *Element
- func FromInteger(n *integer.Element) (*Element, error)
- func FromString(s string) (*Element, error)
- func FromUint64(n uint64) (*Element, error)
- func GobDecode(dec *gob.Decoder) (*Element, error)
- func GobDecodeSlice(dec *gob.Decoder) ([]*Element, error)
- func Multiply(x *Element, y *Element) (*Element, error)
- func MultiplyThenAdd(x *Element, y *Element, z *Element) (*Element, error)
- func MultiplyThenSubtract(x *Element, y *Element, z *Element) (*Element, error)
- func Negate(x *Element) (*Element, error)
- func One() *Element
- func Power(x *Element, k *integer.Element) (*Element, error)
- func PowerInt64(x *Element, k int64) (*Element, error)
- func SliceFromInt64Slice(S []int64) []*Element
- func SliceFromIntSlice(S []int) []*Element
- func SliceFromIntegerSlice(S []*integer.Element) ([]*Element, error)
- func Subtract(x *Element, y *Element) (*Element, error)
- func SubtractInt64(x *Element, y int64) (*Element, error)
- func ToElement(x object.Element) (*Element, error)
- func Zero() *Element
- func (x *Element) Abs() (*Element, error)
- func (x *Element) Decrement() (*Element, error)
- func (x *Element) GobDecode(buf []byte) error
- func (x *Element) GobEncode() ([]byte, error)
- func (x *Element) Hash() hash.Value
- func (x *Element) Increment() (*Element, error)
- func (x *Element) Int64() int64
- func (x *Element) IsEqualTo(y *Element) bool
- func (x *Element) IsEqualToInt64(y int64) bool
- func (x *Element) IsGreaterThan(y *Element) bool
- func (x *Element) IsGreaterThanInt64(y int64) bool
- func (x *Element) IsGreaterThanOrEqualTo(y *Element) bool
- func (x *Element) IsGreaterThanOrEqualToInt64(y int64) bool
- func (x *Element) IsLessThan(y *Element) bool
- func (x *Element) IsLessThanInt64(y int64) bool
- func (x *Element) IsLessThanOrEqualTo(y *Element) bool
- func (x *Element) IsLessThanOrEqualToInt64(y int64) bool
- func (x *Element) IsNegative() bool
- func (x *Element) IsOne() bool
- func (x *Element) IsPositive() bool
- func (x *Element) IsZero() bool
- func (x *Element) Parent() object.Parent
- func (x *Element) ScalarMultiplyByInt64(n int64) (*Element, error)
- func (x *Element) ScalarMultiplyByInteger(n *integer.Element) (*Element, error)
- func (x *Element) Sign() int
- func (x *Element) String() string
- func (x *Element) ToInteger() *integer.Element
- func (x *Element) Uint64() (uint64, error)
- type Parent
- func (R Parent) Add(x object.Element, y object.Element) (object.Element, error)
- func (R Parent) AreEqual(x object.Element, y object.Element) (bool, error)
- func (R Parent) Cmp(x object.Element, y object.Element) (int, error)
- func (R Parent) Contains(x object.Element) bool
- func (R Parent) IsOne(x object.Element) (bool, error)
- func (R Parent) IsZero(x object.Element) (bool, error)
- func (R Parent) Multiply(x object.Element, y object.Element) (object.Element, error)
- func (R Parent) Negate(x object.Element) (object.Element, error)
- func (R Parent) One() object.Element
- func (R Parent) Power(x object.Element, k *integer.Element) (object.Element, error)
- func (R Parent) ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error)
- func (R Parent) String() string
- func (R Parent) Subtract(x object.Element, y object.Element) (object.Element, error)
- func (R Parent) ToElement(x object.Element) (object.Element, error)
- func (R Parent) Zero() object.Element
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element is an int64-valued element.
func FromInteger ¶
FromInteger returns a new int64-valued element, or an error if out of range.
func FromString ¶
FromString returns the integer represented by the string s.
func FromUint64 ¶
FromUint64 returns a new int64-valued element, or an error if out of range.
func GobDecode ¶
GobDecode reads the next value from the given gob.Decoder and decodes it as an int64-valued element.
func GobDecodeSlice ¶
GobDecodeSlice reads the next value from the given gob.Decoder and decodes it as a slice of int64-valued elements.
func MultiplyThenAdd ¶
MultiplyThenAdd returns x * y + z, or an error if out of range
func MultiplyThenSubtract ¶
MultiplyThenSubtract returns x * y - z, or an error if out of range
func PowerInt64 ¶
PowerInt64 returns x^k, or an error if the result is out of range.
func SliceFromInt64Slice ¶
SliceFromInt64Slice returns a slice of Elements corresponding to the integers in S.
func SliceFromIntSlice ¶
SliceFromIntSlice returns a slice of Elements corresponding to the integers in S.
func SliceFromIntegerSlice ¶
SliceFromIntegerSlice returns a slice of Elements corresponding to the integers in S.
func SubtractInt64 ¶
SubtractInt64 returns the difference x - y, or an error if out of range.
func (*Element) GobDecode ¶
GobDecode implements the gob.GobDecoder interface. Important: Take great care that you are decoding into a new *Element; the safe way to do this is to use the GobDecode(dec *gob.Decode) function.
func (*Element) IsEqualToInt64 ¶
IsEqualToInt64 returns true iff x is equal to y.
func (*Element) IsGreaterThan ¶
IsGreaterThan returns true iff x > y.
func (*Element) IsGreaterThanInt64 ¶
IsGreaterThanInt64 returns true iff x > y.
func (*Element) IsGreaterThanOrEqualTo ¶
IsGreaterThanOrEqualTo returns true iff x >= y.
func (*Element) IsGreaterThanOrEqualToInt64 ¶
IsGreaterThanOrEqualToInt64 returns true iff x >= y.
func (*Element) IsLessThan ¶
IsLessThan returns true iff x < y.
func (*Element) IsLessThanInt64 ¶
IsLessThanInt64 returns true iff x < y.
func (*Element) IsLessThanOrEqualTo ¶
IsLessThanOrEqualTo returns true iff x <= y.
func (*Element) IsLessThanOrEqualToInt64 ¶
IsLessThanOrEqualToInt64 returns true iff x <= y.
func (*Element) ScalarMultiplyByInt64 ¶
ScalarMultiplyByInt64 returns n * x, or an error if out of range.
func (*Element) ScalarMultiplyByInteger ¶
ScalarMultiplyByInteger returns n * x, or an error if out of range.
type Parent ¶
type Parent struct{}
Parent is the (unique) set of int64-valued elements.
func Set ¶
func Set() Parent
Set returns the (unique) set of int64-valued elements. Note that this isn't really a ring since, for example, the range of the values is bounded and hence isn't closed under addition.
func (Parent) AreEqual ¶
AreEqual returns true iff x and y are both contained in the parent, and x = y.
func (Parent) Contains ¶
Contains returns true iff x is an element of this parent, or can naturally be regarded as an element of this parent.
func (Parent) Multiply ¶
Multiply returns the product x * y, or an error if the result is out of range.
func (Parent) ScalarMultiplyByInteger ¶
func (R Parent) ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error)
ScalarMultiplyByInteger returns the product n * x, or an error if the result is out of range.