Documentation
¶
Index ¶
- func Float32BiComp(a, b float32) uint8
- func Float64BiComp(a, b float64) uint8
- func Int16BiComp(a, b int16) uint8
- func Int32BiComp(a, b int32) uint8
- func Int64BiComp(a, b int64) uint8
- func Int8BiComp(a, b int8) uint8
- func IntBiComp(a, b int) uint8
- func Uint16BiComp(a, b uint16) uint8
- func Uint32BiComp(a, b uint32) uint8
- func Uint64BiComp(a, b uint64) uint8
- func Uint8BiComp(a, b uint8) uint8
- func UintBiComp(a, b uint) uint8
- type Float32Set
- type Float64Set
- type Int16Set
- type Int32Set
- type Int32Vec
- func (v *Int32Vec) BiInsert(value int32, cmp func(a, b int32) uint8)
- func (v Int32Vec) BiSearch(value int32, cmp func(a, b int32) uint8) (int, bool)
- func (v *Int32Vec) Clear()
- func (v Int32Vec) Clone() Int32Vec
- func (v *Int32Vec) Extend(amount int)
- func (v *Int32Vec) Filter(filter func(e int32) bool)
- func (v Int32Vec) Find(find func(e int32) bool) (idx int, res int32)
- func (v Int32Vec) ForEach(con func(i int, e int32) int32)
- func (v *Int32Vec) Insert(idx int, val ...int32)
- func (v Int32Vec) Last() int32
- func (v Int32Vec) Len() int
- func (v Int32Vec) Move(old, new int)
- func (v *Int32Vec) Pop() int32
- func (v *Int32Vec) PopFront() int32
- func (v *Int32Vec) Remove(idx int) (val int32)
- func (v *Int32Vec) RemoveSlice(start, end int)
- func (v *Int32Vec) Resize(size int)
- func (v Int32Vec) Reverse()
- func (v Int32Vec) Rewrite(o Int32Vec, idx int)
- func (v Int32Vec) Sort(buff []int, comp func(a, pivot int32) bool) []int
- func (v Int32Vec) Swap(a, b int)
- func (v *Int32Vec) Truncate(l int)
- type Int64Set
- type Int8Set
- type IntSet
- type IntVec
- func (v *IntVec) BiInsert(value int, cmp func(a, b int) uint8)
- func (v IntVec) BiSearch(value int, cmp func(a, b int) uint8) (int, bool)
- func (v *IntVec) Clear()
- func (v IntVec) Clone() IntVec
- func (v *IntVec) Extend(amount int)
- func (v *IntVec) Filter(filter func(e int) bool)
- func (v IntVec) Find(find func(e int) bool) (idx int, res int)
- func (v IntVec) ForEach(con func(i int, e int) int)
- func (v *IntVec) Insert(idx int, val ...int)
- func (v IntVec) Last() int
- func (v IntVec) Len() int
- func (v IntVec) Move(old, new int)
- func (v *IntVec) Pop() int
- func (v *IntVec) PopFront() int
- func (v *IntVec) Remove(idx int) (val int)
- func (v *IntVec) RemoveSlice(start, end int)
- func (v *IntVec) Resize(size int)
- func (v IntVec) Reverse()
- func (v IntVec) Rewrite(o IntVec, idx int)
- func (v IntVec) Sort(buff []int, comp func(a, pivot int) bool) []int
- func (v IntVec) Swap(a, b int)
- func (v *IntVec) Truncate(l int)
- type Uint16Set
- type Uint32Set
- type Uint64Set
- type Uint8Set
- type UintSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float32BiComp ¶
func Float64BiComp ¶
func Int16BiComp ¶
func Int32BiComp ¶
func Int64BiComp ¶
func Int8BiComp ¶
func Uint16BiComp ¶
func Uint32BiComp ¶
func Uint64BiComp ¶
func Uint8BiComp ¶
func UintBiComp ¶
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
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
type Int32Vec ¶
type Int32Vec []int32
Int32Vec is a standard Vector type with utility methods
func (*Int32Vec) BiInsert ¶
BiInsert inserts inserts value in a way that keebuff vec sorted, binary search is used to determinate where to insert
func (Int32Vec) BiSearch ¶
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) Extend ¶
Extend extends vec size by amount so then len(Int32Vec) = len(Int32Vec) + amount
func (Int32Vec) Find ¶
Find returns first element for which find returns true along with index, if there is none, index equals -1
func (Int32Vec) ForEach ¶
ForEach is a standard foreach method. Its shortcut for modifying all elements
func (*Int32Vec) RemoveSlice ¶
RemoveSlice removes sequence of slice
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
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
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
type IntVec ¶
type IntVec []int
IntVec is a standard Vector type with utility methods
func (*IntVec) BiInsert ¶
BiInsert inserts inserts value in a way that keebuff vec sorted, binary search is used to determinate where to insert
func (IntVec) BiSearch ¶
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) Extend ¶
Extend extends vec size by amount so then len(IntVec) = len(IntVec) + amount
func (IntVec) Find ¶
Find returns first element for which find returns true along with index, if there is none, index equals -1
func (IntVec) ForEach ¶
ForEach is a standard foreach method. Its shortcut for modifying all elements
func (*IntVec) RemoveSlice ¶
RemoveSlice removes sequence of slice
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
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
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
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
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