util

package
v0.0.0-...-10abb40 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsChannelClosed

func IsChannelClosed(ch chan string) bool

Types

type Barrier

type Barrier struct {
	// contains filtered or unexported fields
}

Barrier for handling "complex" process synchronization

func NewBarrier

func NewBarrier() *Barrier

Create a new barrier.

func (*Barrier) Resolve

func (b *Barrier) Resolve()

Resolve the current execution of this process.

func (*Barrier) Tick

func (b *Barrier) Tick(size int)

Let the barrier tick. This means, that all waiting processes can pass the barrier. Note: They have to call Barrier.Resolve() after finishing their work, otherwise this barrier gets stuck.

func (*Barrier) Wait

func (b *Barrier) Wait()

Wait for this barrier to "drop". After this you can perform computing action.

type Vec2D

type Vec2D struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

Utility for storing and manipulating 2D information

func (*Vec2D) Add

func (v *Vec2D) Add(other *Vec2D) *Vec2D

func (*Vec2D) AddI

func (v *Vec2D) AddI(other *Vec2D) *Vec2D

func (*Vec2D) Copy

func (v *Vec2D) Copy() *Vec2D

func (*Vec2D) Length

func (v *Vec2D) Length() float64

func (*Vec2D) Noise

func (v *Vec2D) Noise(stddev float64) *Vec2D

func (*Vec2D) NoiseI

func (v *Vec2D) NoiseI(stddev float64) *Vec2D

func (*Vec2D) Normalize

func (v *Vec2D) Normalize() *Vec2D

func (*Vec2D) NormalizeI

func (v *Vec2D) NormalizeI() *Vec2D

func (*Vec2D) Scale

func (v *Vec2D) Scale(scale float64) *Vec2D

func (*Vec2D) ScaleI

func (v *Vec2D) ScaleI(scale float64) *Vec2D

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳