zfloat32s

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterfaceNotFloat32 = errors.New("encountered non-float32 interface")
)

Functions

func As

func As(slice []interface{}) (res []float32, err error)

Convert a []interface{} slice into []float32 slice if possible

func Contains

func Contains(haystack []float32, needle float32) bool

Check if a slice ([]float32) contains a matching member

func ContainsAll

func ContainsAll(haystack []float32, needles ...float32) bool

Check if a []float32 slice contains ALL of the provided members

func ContainsAny

func ContainsAny(haystack []float32, needles ...float32) bool

Check if a []float32 slice contains ANY of the provided members

func Cut

func Cut(slice []float32, separator float32) (left, right []float32, found bool)

Cut the slice into two slices separated by the separator

func CutAny

func CutAny(val []float32, seperators ...float32) (left, right []float32, found bool)

Cut the slice into two slices separated by the first separator

func CutAt added in v0.9.1

func CutAt(val []float32, index int) (left, right []float32)

Cut the slice at the specified index

func Equal

func Equal(a []float32, b []float32) bool

Determine if two slices are equal to each other

func Fill added in v0.7.3

func Fill(slice []float32, val float32) []float32

Fill a slice with the given value

func Index

func Index(haystack []float32, needle float32) int

Find the index where the needle appears. Returns -1 if the needle doesn't appear in the slice.

func Interface

func Interface(slice []float32) (res []interface{}, err error)

Convert a []float32 slice into a slice of interfaces ([]interface{})

func Remove added in v0.5.10

func Remove(slice []float32, offset int, values ...float32) (res []float32)

Remove the first occurrence of each value from the slice starting from the supplied offset

func RemoveAt added in v0.5.10

func RemoveAt(slice []float32, index int) (res []float32)

Remove the item at the index while preserving the order of the items TODO: maybe change this to take multiple indices and to remove them at the same time

func Resize added in v0.5.8

func Resize(s []float32, n int) (res []float32)

Resize a slice to the given length

func Sort added in v0.5.6

func Sort(s []float32)

Sort the slice in ascending order

func SortReverse added in v0.5.7

func SortReverse(s []float32)

Sort the slice in descending order

func Split

func Split(slice []float32, separator float32) (parts [][]float32)

Split the slice into one or more slices separated by the separator

Types

This section is empty.

Jump to

Keyboard shortcuts

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