computers

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

type Add[T basic.Number] struct {
	L *T
	R *T
}

func (Add[T]) ComputeVals

func (a Add[T]) ComputeVals() (T, error)

func (Add[T]) Reset

func (a Add[T]) Reset()

type Computer

type Computer[T any] interface {
	ComputeVals() (T, error)
	// Resets the state of the Computers's underlying value.
	Reset()
}

An interface that defines how computed arguments will be evaluated. The upderlying value is expected to have some way to access the data it needs to compute the value T. Normally, the underlying value will be a struct with a pointer to value(s) that it needs.

type Div

type Div[T basic.Number] struct {
	L *T
	R *T
}

func (Div[T]) ComputeVals

func (a Div[T]) ComputeVals() (T, error)

func (Div[T]) Reset

func (a Div[T]) Reset()

type Mul

type Mul[T basic.Number] struct {
	L *T
	R *T
}

func (Mul[T]) ComputeVals

func (a Mul[T]) ComputeVals() (T, error)

func (Mul[T]) Reset

func (a Mul[T]) Reset()

type Stopper

type Stopper[T any] struct{ Err error }

func (Stopper[T]) ComputeVals

func (s Stopper[T]) ComputeVals() (T, error)

func (Stopper[T]) Reset

func (s Stopper[T]) Reset()

type Sub

type Sub[T basic.Number] struct {
	L *T
	R *T
}

func (Sub[T]) ComputeVals

func (a Sub[T]) ComputeVals() (T, error)

func (Sub[T]) Reset

func (a Sub[T]) Reset()

Jump to

Keyboard shortcuts

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