structures

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountMatches

func CountMatches[T comparable](list []T, val T) int

func Create3DArray

func Create3DArray[T any](dimensions []int) [][][]T

func IndexOf

func IndexOf[T comparable](list []T, val T) int

Types

type AnyMap

type AnyMap[T comparable, R any] map[T]R

func (AnyMap[T, R]) ValueSet

func (mp AnyMap[T, R]) ValueSet() []R

type ExplorationSet

type ExplorationSet = Set[maths.Position]

type List

type List[T comparable] []T

func (*List[T]) Add

func (list *List[T]) Add(val T)

func (List[T]) Contains

func (list List[T]) Contains(val T) bool

type ListTwoD

type ListTwoD[T comparable] [][]T

func (ListTwoD[T]) ContainsRow

func (list ListTwoD[T]) ContainsRow(vals []T) bool

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | float32 | float64
}

type Set

type Set[T comparable] []T

func (*Set[T]) Add

func (set *Set[T]) Add(val T)

func (*Set[T]) AddAll

func (set *Set[T]) AddAll(vals ...T)

func (Set[T]) Contains

func (set Set[T]) Contains(val T) bool

func (Set[T]) ContainsAll

func (set Set[T]) ContainsAll(vals ...T) bool

func (*Set[T]) Intersect

func (set *Set[T]) Intersect(other Set[T]) Set[T]

func (Set[T]) IsEmpty

func (set Set[T]) IsEmpty() bool

func (*Set[T]) Remove

func (set *Set[T]) Remove(search T)

func (*Set[T]) Union

func (set *Set[T]) Union(other Set[T]) Set[T]

type Stack

type Stack[T comparable] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[T comparable]() *Stack[T]

func (*Stack[T]) IsEmpty

func (stack *Stack[T]) IsEmpty() bool

func (*Stack[T]) Items

func (stack *Stack[T]) Items() []T

func (*Stack[T]) Pop

func (stack *Stack[T]) Pop() T

func (*Stack[T]) Push

func (stack *Stack[T]) Push(val T)

func (*Stack[T]) PushAll

func (stack *Stack[T]) PushAll(vals []T)

func (*Stack[T]) PushFront

func (stack *Stack[T]) PushFront(val T)

func (*Stack[T]) PushFrontAll

func (stack *Stack[T]) PushFrontAll(vals []T)

func (*Stack[T]) Size

func (stack *Stack[T]) Size() int

func (*Stack[T]) SortFunction

func (stack *Stack[T]) SortFunction(scorer func(a T) float64)

type Vector

type Vector[T Number] []T

func (Vector[T]) Divide

func (vec Vector[T]) Divide(divisor T) Vector[T]

func (Vector[T]) Minus

func (vec Vector[T]) Minus(other Vector[T]) Vector[T]

func (Vector[T]) Plus

func (vec Vector[T]) Plus(other Vector[T]) Vector[T]

func (Vector[T]) SimpleCross

func (vec Vector[T]) SimpleCross(other Vector[T]) T

func (Vector[T]) Times

func (vec Vector[T]) Times(multiplier T) Vector[T]

Directories

Path Synopsis
Package deque provides an implementation for a Generic Double Ended Queue.
Package deque provides an implementation for a Generic Double Ended Queue.

Jump to

Keyboard shortcuts

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