gen

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float32BiComp

func Float32BiComp(a, b float32) uint8

func Float64BiComp

func Float64BiComp(a, b float64) uint8

func Int16BiComp

func Int16BiComp(a, b int16) uint8

func Int32BiComp

func Int32BiComp(a, b int32) uint8

func Int64BiComp

func Int64BiComp(a, b int64) uint8

func Int8BiComp

func Int8BiComp(a, b int8) uint8

func IntBiComp

func IntBiComp(a, b int) uint8

func Uint16BiComp

func Uint16BiComp(a, b uint16) uint8

func Uint32BiComp

func Uint32BiComp(a, b uint32) uint8

func Uint64BiComp

func Uint64BiComp(a, b uint64) uint8

func Uint8BiComp

func Uint8BiComp(a, b uint8) uint8

func UintBiComp

func UintBiComp(a, b uint) uint8

Types

type Float32Set added in v0.4.2

type Float32Set []float32

Float32Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Float32Set) Has added in v0.4.2

func (s *Float32Set) Has(val float32) bool

Has returns whether set has the value

func (*Float32Set) Insert added in v0.4.2

func (s *Float32Set) Insert(val float32) bool

Insert inserts the element or returns false if element already is present

func (*Float32Set) Remove added in v0.4.2

func (s *Float32Set) Remove(val float32) bool

Remove removes the value or returns false if value is not present

type Float64Set added in v0.4.2

type Float64Set []float64

Float64Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Float64Set) Has added in v0.4.2

func (s *Float64Set) Has(val float64) bool

Has returns whether set has the value

func (*Float64Set) Insert added in v0.4.2

func (s *Float64Set) Insert(val float64) bool

Insert inserts the element or returns false if element already is present

func (*Float64Set) Remove added in v0.4.2

func (s *Float64Set) Remove(val float64) bool

Remove removes the value or returns false if value is not present

type Int16Set added in v0.4.2

type Int16Set []int16

Int16Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Int16Set) Has added in v0.4.2

func (s *Int16Set) Has(val int16) bool

Has returns whether set has the value

func (*Int16Set) Insert added in v0.4.2

func (s *Int16Set) Insert(val int16) bool

Insert inserts the element or returns false if element already is present

func (*Int16Set) Remove added in v0.4.2

func (s *Int16Set) Remove(val int16) bool

Remove removes the value or returns false if value is not present

type Int32Set added in v0.4.2

type Int32Set []int32

Int32Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Int32Set) Has added in v0.4.2

func (s *Int32Set) Has(val int32) bool

Has returns whether set has the value

func (*Int32Set) Insert added in v0.4.2

func (s *Int32Set) Insert(val int32) bool

Insert inserts the element or returns false if element already is present

func (*Int32Set) Remove added in v0.4.2

func (s *Int32Set) Remove(val int32) bool

Remove removes the value or returns false if value is not present

type Int32Vec

type Int32Vec []int32

Int32Vec is a standard Vector type with utility methods

func (*Int32Vec) BiInsert

func (v *Int32Vec) BiInsert(value int32, cmp func(a, b int32) uint8)

BiInsert inserts inserts value in a way that keebuff vec sorted, binary search is used to determinate where to insert

func (Int32Vec) BiSearch

func (v Int32Vec) BiSearch(value int32, cmp func(a, b int32) uint8) (int, bool)

BiSearch performs a binary search on Ves assuming it is sorted. cmp consumer should return 0 if a == b equal, 1 if a > b and 2 if b > a, even if value wos not found it returns it returns closest index and false. If Int32Vec is empty -1 and false is returned

func (*Int32Vec) Clear

func (v *Int32Vec) Clear()

Clear is equivalent to Truncate(0)

func (Int32Vec) Clone

func (v Int32Vec) Clone() Int32Vec

Clone creates new Int32Vec copies content of v to it and returns it

func (*Int32Vec) Extend

func (v *Int32Vec) Extend(amount int)

Extend extends vec size by amount so then len(Int32Vec) = len(Int32Vec) + amount

func (*Int32Vec) Filter

func (v *Int32Vec) Filter(filter func(e int32) bool)

Filter leaves only elements for with filter returns true

func (Int32Vec) Find

func (v Int32Vec) Find(find func(e int32) bool) (idx int, res int32)

Find returns first element for which find returns true along with index, if there is none, index equals -1

func (Int32Vec) ForEach

func (v Int32Vec) ForEach(con func(i int, e int32) int32)

ForEach is a standard foreach method. Its shortcut for modifying all elements

func (*Int32Vec) Insert

func (v *Int32Vec) Insert(idx int, val ...int32)

Insert inserts value to given index

func (Int32Vec) Last

func (v Int32Vec) Last() int32

Last returns last element of slice

func (Int32Vec) Len

func (v Int32Vec) Len() int

Len implements VertexData interface

func (Int32Vec) Move

func (v Int32Vec) Move(old, new int)

Move moves value from old to new shifting elements in between

func (*Int32Vec) Pop

func (v *Int32Vec) Pop() int32

Pop removes last element

func (*Int32Vec) PopFront

func (v *Int32Vec) PopFront() int32

PopFront removes first element and returns it

func (*Int32Vec) Remove

func (v *Int32Vec) Remove(idx int) (val int32)

Remove removes element and returns it

func (*Int32Vec) RemoveSlice

func (v *Int32Vec) RemoveSlice(start, end int)

RemoveSlice removes sequence of slice

func (*Int32Vec) Resize

func (v *Int32Vec) Resize(size int)

Resize resizes the Int32Vec

func (Int32Vec) Reverse

func (v Int32Vec) Reverse()

Reverse reverses content of slice

func (Int32Vec) Rewrite

func (v Int32Vec) Rewrite(o Int32Vec, idx int)

Rewrite revrites elements from index to o values

func (Int32Vec) Sort

func (v Int32Vec) Sort(buff []int, comp func(a, pivot int32) bool) []int

Sort is quicksort for Int32Vec, if returns true, item will be swapped to left side from pivot so a > pivot will sort in descending order

func (Int32Vec) Swap

func (v Int32Vec) Swap(a, b int)

Swap swabuff two elements

func (*Int32Vec) Truncate

func (v *Int32Vec) Truncate(l int)

Truncate in comparison to truncating by bracket operator also sets all forgoten elements to default value, witch is useful if this is slice of pointers Int32Vec will have length you specify

type Int64Set added in v0.4.2

type Int64Set []int64

Int64Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Int64Set) Has added in v0.4.2

func (s *Int64Set) Has(val int64) bool

Has returns whether set has the value

func (*Int64Set) Insert added in v0.4.2

func (s *Int64Set) Insert(val int64) bool

Insert inserts the element or returns false if element already is present

func (*Int64Set) Remove added in v0.4.2

func (s *Int64Set) Remove(val int64) bool

Remove removes the value or returns false if value is not present

type Int8Set added in v0.4.2

type Int8Set []int8

Int8Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Int8Set) Has added in v0.4.2

func (s *Int8Set) Has(val int8) bool

Has returns whether set has the value

func (*Int8Set) Insert added in v0.4.2

func (s *Int8Set) Insert(val int8) bool

Insert inserts the element or returns false if element already is present

func (*Int8Set) Remove added in v0.4.2

func (s *Int8Set) Remove(val int8) bool

Remove removes the value or returns false if value is not present

type IntSet added in v0.4.2

type IntSet []int

IntSet uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*IntSet) Has added in v0.4.2

func (s *IntSet) Has(val int) bool

Has returns whether set has the value

func (*IntSet) Insert added in v0.4.2

func (s *IntSet) Insert(val int) bool

Insert inserts the element or returns false if element already is present

func (*IntSet) Remove added in v0.4.2

func (s *IntSet) Remove(val int) bool

Remove removes the value or returns false if value is not present

type IntVec

type IntVec []int

IntVec is a standard Vector type with utility methods

func (*IntVec) BiInsert

func (v *IntVec) BiInsert(value int, cmp func(a, b int) uint8)

BiInsert inserts inserts value in a way that keebuff vec sorted, binary search is used to determinate where to insert

func (IntVec) BiSearch

func (v IntVec) BiSearch(value int, cmp func(a, b int) uint8) (int, bool)

BiSearch performs a binary search on Ves assuming it is sorted. cmp consumer should return 0 if a == b equal, 1 if a > b and 2 if b > a, even if value wos not found it returns it returns closest index and false. If IntVec is empty -1 and false is returned

func (*IntVec) Clear

func (v *IntVec) Clear()

Clear is equivalent to Truncate(0)

func (IntVec) Clone

func (v IntVec) Clone() IntVec

Clone creates new IntVec copies content of v to it and returns it

func (*IntVec) Extend

func (v *IntVec) Extend(amount int)

Extend extends vec size by amount so then len(IntVec) = len(IntVec) + amount

func (*IntVec) Filter

func (v *IntVec) Filter(filter func(e int) bool)

Filter leaves only elements for with filter returns true

func (IntVec) Find

func (v IntVec) Find(find func(e int) bool) (idx int, res int)

Find returns first element for which find returns true along with index, if there is none, index equals -1

func (IntVec) ForEach

func (v IntVec) ForEach(con func(i int, e int) int)

ForEach is a standard foreach method. Its shortcut for modifying all elements

func (*IntVec) Insert

func (v *IntVec) Insert(idx int, val ...int)

Insert inserts value to given index

func (IntVec) Last

func (v IntVec) Last() int

Last returns last element of slice

func (IntVec) Len

func (v IntVec) Len() int

Len implements VertexData interface

func (IntVec) Move

func (v IntVec) Move(old, new int)

Move moves value from old to new shifting elements in between

func (*IntVec) Pop

func (v *IntVec) Pop() int

Pop removes last element

func (*IntVec) PopFront

func (v *IntVec) PopFront() int

PopFront removes first element and returns it

func (*IntVec) Remove

func (v *IntVec) Remove(idx int) (val int)

Remove removes element and returns it

func (*IntVec) RemoveSlice

func (v *IntVec) RemoveSlice(start, end int)

RemoveSlice removes sequence of slice

func (*IntVec) Resize

func (v *IntVec) Resize(size int)

Resize resizes the IntVec

func (IntVec) Reverse

func (v IntVec) Reverse()

Reverse reverses content of slice

func (IntVec) Rewrite

func (v IntVec) Rewrite(o IntVec, idx int)

Rewrite revrites elements from index to o values

func (IntVec) Sort

func (v IntVec) Sort(buff []int, comp func(a, pivot int) bool) []int

Sort is quicksort for IntVec, if returns true, item will be swapped to left side from pivot so a > pivot will sort in descending order

func (IntVec) Swap

func (v IntVec) Swap(a, b int)

Swap swabuff two elements

func (*IntVec) Truncate

func (v *IntVec) Truncate(l int)

Truncate in comparison to truncating by bracket operator also sets all forgoten elements to default value, witch is useful if this is slice of pointers IntVec will have length you specify

type Uint16Set added in v0.4.2

type Uint16Set []uint16

Uint16Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Uint16Set) Has added in v0.4.2

func (s *Uint16Set) Has(val uint16) bool

Has returns whether set has the value

func (*Uint16Set) Insert added in v0.4.2

func (s *Uint16Set) Insert(val uint16) bool

Insert inserts the element or returns false if element already is present

func (*Uint16Set) Remove added in v0.4.2

func (s *Uint16Set) Remove(val uint16) bool

Remove removes the value or returns false if value is not present

type Uint32Set added in v0.4.2

type Uint32Set []uint32

Uint32Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Uint32Set) Has added in v0.4.2

func (s *Uint32Set) Has(val uint32) bool

Has returns whether set has the value

func (*Uint32Set) Insert added in v0.4.2

func (s *Uint32Set) Insert(val uint32) bool

Insert inserts the element or returns false if element already is present

func (*Uint32Set) Remove added in v0.4.2

func (s *Uint32Set) Remove(val uint32) bool

Remove removes the value or returns false if value is not present

type Uint64Set added in v0.4.2

type Uint64Set []uint64

Uint64Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Uint64Set) Has added in v0.4.2

func (s *Uint64Set) Has(val uint64) bool

Has returns whether set has the value

func (*Uint64Set) Insert added in v0.4.2

func (s *Uint64Set) Insert(val uint64) bool

Insert inserts the element or returns false if element already is present

func (*Uint64Set) Remove added in v0.4.2

func (s *Uint64Set) Remove(val uint64) bool

Remove removes the value or returns false if value is not present

type Uint8Set added in v0.4.2

type Uint8Set []uint8

Uint8Set uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*Uint8Set) Has added in v0.4.2

func (s *Uint8Set) Has(val uint8) bool

Has returns whether set has the value

func (*Uint8Set) Insert added in v0.4.2

func (s *Uint8Set) Insert(val uint8) bool

Insert inserts the element or returns false if element already is present

func (*Uint8Set) Remove added in v0.4.2

func (s *Uint8Set) Remove(val uint8) bool

Remove removes the value or returns false if value is not present

type UintSet added in v0.4.2

type UintSet []uint

UintSet uses binary search to store comparable elements it acts as normal Set though, with performance advantage over map

func (*UintSet) Has added in v0.4.2

func (s *UintSet) Has(val uint) bool

Has returns whether set has the value

func (*UintSet) Insert added in v0.4.2

func (s *UintSet) Insert(val uint) bool

Insert inserts the element or returns false if element already is present

func (*UintSet) Remove added in v0.4.2

func (s *UintSet) Remove(val uint) bool

Remove removes the value or returns false if value is not present

Jump to

Keyboard shortcuts

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