Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sum ¶
Sum returns the sum of the elements in the slice S. The sum of the empty slice is the zero element. If G satisfies the interface:
type Sumer interface { Sum(S ...object.Element) (object.Element, error) // Sum returns the sum of the elements in the slice S. The sum of the empty slice is the zero element. }
then G's Sum method will be called.
Types ¶
type Interface ¶
type Interface interface { object.Parent Zero() object.Element // Zero returns the additive identity of the ring. IsZero(x object.Element) (bool, error) // IsZero returns true iff x is the additive identity element of the ring. Add(x object.Element, y object.Element) (object.Element, error) // Add returns x + y.] ScalarMultiplyByInteger(n *integer.Element, x object.Element) (object.Element, error) // ScalarMultiplyByInteger returns nx, where this is defined to be: }
Interface defines the interface that all abelian monoids must satisfy.
Click to show internal directories.
Click to hide internal directories.