Documentation ¶
Index ¶
- func BiSearch[ValueType NumberType, T Element[ValueType]](sElement []T, value ValueType, matchUp int) int
- func ClearBitwiseTag[Number BitNumber, UNumber UnsignedNumber](bitBuff []Number, bitPositionIndex UNumber) bool
- func GetBitwiseNum[Number BitNumber](bitBuff []Number) int
- func GetBitwiseTag[Number BitNumber, UNumber UnsignedNumber](bitBuff []Number, bitPositionIndex UNumber) (bool, error)
- func SetBitwiseTag[Number BitNumber, UNumber UnsignedNumber](bitBuff []Number, bitPositionIndex UNumber) bool
- type BitNumber
- type Element
- type NumberType
- type UnsignedNumber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BiSearch ¶
func BiSearch[ValueType NumberType, T Element[ValueType]](sElement []T, value ValueType, matchUp int) int
BiSearch 二分查找,切片必需有序 matchUp规则如下: 参数为0时,则一定要找到相等的值 参数-1时,找value左边的值,例如:[10,20,30,40],当value为9时返回-1; 当value为11时,返回0 当value为41时,返回 3 参数 1时,找value右边的值,例如:[10,20,30,40],当value为9时返回 0; 当value为11时,返回1 当value为41时,返回-1
返回-1时代表没有找到下标
func ClearBitwiseTag ¶ added in v1.18.6
func ClearBitwiseTag[Number BitNumber, UNumber UnsignedNumber](bitBuff []Number, bitPositionIndex UNumber) bool
func GetBitwiseNum ¶ added in v1.18.6
func GetBitwiseTag ¶ added in v1.18.6
func GetBitwiseTag[Number BitNumber, UNumber UnsignedNumber](bitBuff []Number, bitPositionIndex UNumber) (bool, error)
func SetBitwiseTag ¶ added in v1.18.6
func SetBitwiseTag[Number BitNumber, UNumber UnsignedNumber](bitBuff []Number, bitPositionIndex UNumber) bool
Types ¶
type Element ¶
type Element[ValueType NumberType] interface { GetValue() ValueType }
type NumberType ¶
Click to show internal directories.
Click to hide internal directories.