abeliangroup

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sum

func Sum(G Interface, 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. 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 {
	abelianmonoid.Interface
	Subtract(x object.Element, y object.Element) (object.Element, error) // Subtract returns x - y.
	Negate(x object.Element) (object.Element, error)                     // Negate returns -x.
}

Interface defines the interface that all abelian groups must satisfy.

Jump to

Keyboard shortcuts

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