search

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: BSL-1.0 Imports: 2 Imported by: 0

README

GoDoc

About

This package provides the function "binary search" for slices of basic types. It is published on https://github.com/vbsw/slices/search and https://gitlab.com/vbsw/slices/search.

Copyright 2022, Vitali Baumtrok (vbsw@mailbox.org).

search is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

search is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

References

Documentation

Overview

Package search provides the "binary search" function for slices of basic types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(list []bool, element bool) (int, bool)

Bool searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and sorted from false to true.

func BoolDesc

func BoolDesc(list []bool, element bool) (int, bool)

BoolDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and sorted from true to false.

func BoolIdx

func BoolIdx(list []bool, indices []int, element bool) (int, bool)

BoolIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and sorted from false to true by indices.

func BoolIdxDesc

func BoolIdxDesc(list []bool, indices []int, element bool) (int, bool)

BoolIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and sorted from true to false by indices.

func BoolIdxRng

func BoolIdxRng(list []bool, indices []int, element bool) (int, int, bool)

BoolIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be sorted from false to true by indices.

func BoolIdxRngDesc

func BoolIdxRngDesc(list []bool, indices []int, element bool) (int, int, bool)

BoolIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be sorted from true to false by indices.

func BoolRng

func BoolRng(list []bool, element bool) (int, int, bool)

BoolRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be sorted from false to true.

func BoolRngDesc

func BoolRngDesc(list []bool, element bool) (int, int, bool)

BoolRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be sorted from true to false.

func Byte

func Byte(list []byte, element byte) (int, bool)

Byte searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func ByteDesc

func ByteDesc(list []byte, element byte) (int, bool)

ByteDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func ByteIdx

func ByteIdx(list []byte, indices []int, element byte) (int, bool)

ByteIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func ByteIdxDesc

func ByteIdxDesc(list []byte, indices []int, element byte) (int, bool)

ByteIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func ByteIdxRng

func ByteIdxRng(list []byte, indices []int, element byte) (int, int, bool)

ByteIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func ByteIdxRngDesc

func ByteIdxRngDesc(list []byte, indices []int, element byte) (int, int, bool)

ByteIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func ByteRng

func ByteRng(list []byte, element byte) (int, int, bool)

ByteRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func ByteRngDesc

func ByteRngDesc(list []byte, element byte) (int, int, bool)

ByteRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Complex128

func Complex128(list []complex128, element complex128) (int, bool)

Complex128 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Complex128Desc

func Complex128Desc(list []complex128, element complex128) (int, bool)

Complex128Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Complex128Idx

func Complex128Idx(list []complex128, indices []int, element complex128) (int, bool)

Complex128Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Complex128IdxDesc

func Complex128IdxDesc(list []complex128, indices []int, element complex128) (int, bool)

Complex128IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Complex128IdxRng

func Complex128IdxRng(list []complex128, indices []int, element complex128) (int, int, bool)

Complex128IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Complex128IdxRngDesc

func Complex128IdxRngDesc(list []complex128, indices []int, element complex128) (int, int, bool)

Complex128IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Complex128Rng

func Complex128Rng(list []complex128, element complex128) (int, int, bool)

Complex128Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Complex128RngDesc

func Complex128RngDesc(list []complex128, element complex128) (int, int, bool)

Complex128RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Complex64

func Complex64(list []complex64, element complex64) (int, bool)

Complex64 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Complex64Desc

func Complex64Desc(list []complex64, element complex64) (int, bool)

Complex64Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Complex64Idx

func Complex64Idx(list []complex64, indices []int, element complex64) (int, bool)

Complex64Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Complex64IdxDesc

func Complex64IdxDesc(list []complex64, indices []int, element complex64) (int, bool)

Complex64IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Complex64IdxRng

func Complex64IdxRng(list []complex64, indices []int, element complex64) (int, int, bool)

Complex64IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Complex64IdxRngDesc

func Complex64IdxRngDesc(list []complex64, indices []int, element complex64) (int, int, bool)

Complex64IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Complex64Rng

func Complex64Rng(list []complex64, element complex64) (int, int, bool)

Complex64Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Complex64RngDesc

func Complex64RngDesc(list []complex64, element complex64) (int, int, bool)

Complex64RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Float32

func Float32(list []float32, element float32) (int, bool)

Float32 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Float32Desc

func Float32Desc(list []float32, element float32) (int, bool)

Float32Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Float32Idx

func Float32Idx(list []float32, indices []int, element float32) (int, bool)

Float32Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Float32IdxDesc

func Float32IdxDesc(list []float32, indices []int, element float32) (int, bool)

Float32IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Float32IdxRng

func Float32IdxRng(list []float32, indices []int, element float32) (int, int, bool)

Float32IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Float32IdxRngDesc

func Float32IdxRngDesc(list []float32, indices []int, element float32) (int, int, bool)

Float32IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Float32Rng

func Float32Rng(list []float32, element float32) (int, int, bool)

Float32Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Float32RngDesc

func Float32RngDesc(list []float32, element float32) (int, int, bool)

Float32RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Float64

func Float64(list []float64, element float64) (int, bool)

Float64 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Float64Desc

func Float64Desc(list []float64, element float64) (int, bool)

Float64Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Float64Idx

func Float64Idx(list []float64, indices []int, element float64) (int, bool)

Float64Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Float64IdxDesc

func Float64IdxDesc(list []float64, indices []int, element float64) (int, bool)

Float64IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Float64IdxRng

func Float64IdxRng(list []float64, indices []int, element float64) (int, int, bool)

Float64IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Float64IdxRngDesc

func Float64IdxRngDesc(list []float64, indices []int, element float64) (int, int, bool)

Float64IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Float64Rng

func Float64Rng(list []float64, element float64) (int, int, bool)

Float64Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Float64RngDesc

func Float64RngDesc(list []float64, element float64) (int, int, bool)

Float64RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Int

func Int(list []int, element int) (int, bool)

Int searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Int16

func Int16(list []int16, element int16) (int, bool)

Int16 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Int16Desc

func Int16Desc(list []int16, element int16) (int, bool)

Int16Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Int16Idx

func Int16Idx(list []int16, indices []int, element int16) (int, bool)

Int16Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Int16IdxDesc

func Int16IdxDesc(list []int16, indices []int, element int16) (int, bool)

Int16IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Int16IdxRng

func Int16IdxRng(list []int16, indices []int, element int16) (int, int, bool)

Int16IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Int16IdxRngDesc

func Int16IdxRngDesc(list []int16, indices []int, element int16) (int, int, bool)

Int16IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Int16Rng

func Int16Rng(list []int16, element int16) (int, int, bool)

Int16Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Int16RngDesc

func Int16RngDesc(list []int16, element int16) (int, int, bool)

Int16RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Int32

func Int32(list []int32, element int32) (int, bool)

Int32 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Int32Desc

func Int32Desc(list []int32, element int32) (int, bool)

Int32Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Int32Idx

func Int32Idx(list []int32, indices []int, element int32) (int, bool)

Int32Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Int32IdxDesc

func Int32IdxDesc(list []int32, indices []int, element int32) (int, bool)

Int32IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Int32IdxRng

func Int32IdxRng(list []int32, indices []int, element int32) (int, int, bool)

Int32IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Int32IdxRngDesc

func Int32IdxRngDesc(list []int32, indices []int, element int32) (int, int, bool)

Int32IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Int32Rng

func Int32Rng(list []int32, element int32) (int, int, bool)

Int32Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Int32RngDesc

func Int32RngDesc(list []int32, element int32) (int, int, bool)

Int32RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Int64

func Int64(list []int64, element int64) (int, bool)

Int64 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Int64Desc

func Int64Desc(list []int64, element int64) (int, bool)

Int64Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Int64Idx

func Int64Idx(list []int64, indices []int, element int64) (int, bool)

Int64Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Int64IdxDesc

func Int64IdxDesc(list []int64, indices []int, element int64) (int, bool)

Int64IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Int64IdxRng

func Int64IdxRng(list []int64, indices []int, element int64) (int, int, bool)

Int64IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Int64IdxRngDesc

func Int64IdxRngDesc(list []int64, indices []int, element int64) (int, int, bool)

Int64IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Int64Rng

func Int64Rng(list []int64, element int64) (int, int, bool)

Int64Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Int64RngDesc

func Int64RngDesc(list []int64, element int64) (int, int, bool)

Int64RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Int8

func Int8(list []int8, element int8) (int, bool)

Int8 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func Int8Desc

func Int8Desc(list []int8, element int8) (int, bool)

Int8Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func Int8Idx

func Int8Idx(list []int8, indices []int, element int8) (int, bool)

Int8Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func Int8IdxDesc

func Int8IdxDesc(list []int8, indices []int, element int8) (int, bool)

Int8IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func Int8IdxRng

func Int8IdxRng(list []int8, indices []int, element int8) (int, int, bool)

Int8IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func Int8IdxRngDesc

func Int8IdxRngDesc(list []int8, indices []int, element int8) (int, int, bool)

Int8IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func Int8Rng

func Int8Rng(list []int8, element int8) (int, int, bool)

Int8Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func Int8RngDesc

func Int8RngDesc(list []int8, element int8) (int, int, bool)

Int8RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func IntDesc

func IntDesc(list []int, element int) (int, bool)

IntDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func IntIdx

func IntIdx(list []int, indices []int, element int) (int, bool)

IntIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func IntIdxDesc

func IntIdxDesc(list []int, indices []int, element int) (int, bool)

IntIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func IntIdxRng

func IntIdxRng(list []int, indices []int, element int) (int, int, bool)

IntIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func IntIdxRngDesc

func IntIdxRngDesc(list []int, indices []int, element int) (int, int, bool)

IntIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func IntRng

func IntRng(list []int, element int) (int, int, bool)

IntRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func IntRngDesc

func IntRngDesc(list []int, element int) (int, int, bool)

IntRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Pointer

func Pointer(list []unsafe.Pointer, element unsafe.Pointer) (int, bool)

Pointer searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func PointerDesc

func PointerDesc(list []unsafe.Pointer, element unsafe.Pointer) (int, bool)

PointerDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func PointerIdx

func PointerIdx(list []unsafe.Pointer, indices []int, element unsafe.Pointer) (int, bool)

PointerIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func PointerIdxDesc

func PointerIdxDesc(list []unsafe.Pointer, indices []int, element unsafe.Pointer) (int, bool)

PointerIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func PointerIdxRng

func PointerIdxRng(list []unsafe.Pointer, indices []int, element unsafe.Pointer) (int, int, bool)

PointerIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func PointerIdxRngDesc

func PointerIdxRngDesc(list []unsafe.Pointer, indices []int, element unsafe.Pointer) (int, int, bool)

PointerIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func PointerRng

func PointerRng(list []unsafe.Pointer, element unsafe.Pointer) (int, int, bool)

PointerRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func PointerRngDesc

func PointerRngDesc(list []unsafe.Pointer, element unsafe.Pointer) (int, int, bool)

PointerRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func Rune

func Rune(list []rune, element rune) (int, bool)

Rune searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func RuneDesc

func RuneDesc(list []rune, element rune) (int, bool)

RuneDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func RuneIdx

func RuneIdx(list []rune, indices []int, element rune) (int, bool)

RuneIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func RuneIdxDesc

func RuneIdxDesc(list []rune, indices []int, element rune) (int, bool)

RuneIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func RuneIdxRng

func RuneIdxRng(list []rune, indices []int, element rune) (int, int, bool)

RuneIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func RuneIdxRngDesc

func RuneIdxRngDesc(list []rune, indices []int, element rune) (int, int, bool)

RuneIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func RuneRng

func RuneRng(list []rune, element rune) (int, int, bool)

RuneRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func RuneRngDesc

func RuneRngDesc(list []rune, element rune) (int, int, bool)

RuneRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func String

func String(list []string, element string) (int, bool)

String searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func StringDesc

func StringDesc(list []string, element string) (int, bool)

StringDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func StringIdx

func StringIdx(list []string, indices []int, element string) (int, bool)

StringIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func StringIdxDesc

func StringIdxDesc(list []string, indices []int, element string) (int, bool)

StringIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func StringIdxOff

func StringIdxOff(list []string, indices []int, element string, offset int) (int, int, bool)

StringIdxOff searches elements in list starting at offset matching element, i.e. list[indices[i]][offset:offset+len(element)] == element. Returns start and end index in indices, i.e. start <= i < end. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices regarding offset.

func StringIdxOffDesc

func StringIdxOffDesc(list []string, indices []int, element string, offset int) (int, int, bool)

StringIdxOffDesc searches elements in list starting at offset matching element, i.e. list[indices[i]][offset:offset+len(element)] == element. Returns start and end index in indices, i.e. start <= i < end. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices regarding offset.

func StringIdxRng

func StringIdxRng(list []string, indices []int, element string) (int, int, bool)

StringIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func StringIdxRngDesc

func StringIdxRngDesc(list []string, indices []int, element string) (int, int, bool)

StringIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func StringOff

func StringOff(list []string, element string, offset int) (int, int, bool)

StringOff searches elements in list starting at offset matching element, i.e. list[i][offset:offset+len(element)] == element. Returns start and end index, i.e. start <= i < end. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order regarding offset.

func StringOffDesc

func StringOffDesc(list []string, element string, offset int) (int, int, bool)

StringOff searches elements in list starting at offset matching element, i.e. list[i][offset:offset+len(element)] == element. Returns start and end index, i.e. start <= i < end. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order regarding offset.

func StringRng

func StringRng(list []string, element string) (int, int, bool)

StringRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func StringRngDesc

func StringRngDesc(list []string, element string) (int, int, bool)

StringRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func UInt

func UInt(list []uint, element uint) (int, bool)

UInt searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func UInt16

func UInt16(list []uint16, element uint16) (int, bool)

UInt16 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func UInt16Desc

func UInt16Desc(list []uint16, element uint16) (int, bool)

UInt16Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func UInt16Idx

func UInt16Idx(list []uint16, indices []int, element uint16) (int, bool)

UInt16Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func UInt16IdxDesc

func UInt16IdxDesc(list []uint16, indices []int, element uint16) (int, bool)

UInt16IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func UInt16IdxRng

func UInt16IdxRng(list []uint16, indices []int, element uint16) (int, int, bool)

UInt16IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func UInt16IdxRngDesc

func UInt16IdxRngDesc(list []uint16, indices []int, element uint16) (int, int, bool)

UInt16IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func UInt16Rng

func UInt16Rng(list []uint16, element uint16) (int, int, bool)

UInt16Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func UInt16RngDesc

func UInt16RngDesc(list []uint16, element uint16) (int, int, bool)

UInt16RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func UInt32

func UInt32(list []uint32, element uint32) (int, bool)

UInt32 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func UInt32Desc

func UInt32Desc(list []uint32, element uint32) (int, bool)

UInt32Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func UInt32Idx

func UInt32Idx(list []uint32, indices []int, element uint32) (int, bool)

UInt32Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func UInt32IdxDesc

func UInt32IdxDesc(list []uint32, indices []int, element uint32) (int, bool)

UInt32IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func UInt32IdxRng

func UInt32IdxRng(list []uint32, indices []int, element uint32) (int, int, bool)

UInt32IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func UInt32IdxRngDesc

func UInt32IdxRngDesc(list []uint32, indices []int, element uint32) (int, int, bool)

UInt32IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func UInt32Rng

func UInt32Rng(list []uint32, element uint32) (int, int, bool)

UInt32Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func UInt32RngDesc

func UInt32RngDesc(list []uint32, element uint32) (int, int, bool)

UInt32RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func UInt64

func UInt64(list []uint64, element uint64) (int, bool)

UInt64 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func UInt64Desc

func UInt64Desc(list []uint64, element uint64) (int, bool)

UInt64Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func UInt64Idx

func UInt64Idx(list []uint64, indices []int, element uint64) (int, bool)

UInt64Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func UInt64IdxDesc

func UInt64IdxDesc(list []uint64, indices []int, element uint64) (int, bool)

UInt64IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func UInt64IdxRng

func UInt64IdxRng(list []uint64, indices []int, element uint64) (int, int, bool)

UInt64IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func UInt64IdxRngDesc

func UInt64IdxRngDesc(list []uint64, indices []int, element uint64) (int, int, bool)

UInt64IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func UInt64Rng

func UInt64Rng(list []uint64, element uint64) (int, int, bool)

UInt64Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func UInt64RngDesc

func UInt64RngDesc(list []uint64, element uint64) (int, int, bool)

UInt64RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func UInt8

func UInt8(list []uint8, element uint8) (int, bool)

UInt8 searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func UInt8Desc

func UInt8Desc(list []uint8, element uint8) (int, bool)

UInt8Desc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func UInt8Idx

func UInt8Idx(list []uint8, indices []int, element uint8) (int, bool)

UInt8Idx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func UInt8IdxDesc

func UInt8IdxDesc(list []uint8, indices []int, element uint8) (int, bool)

UInt8IdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func UInt8IdxRng

func UInt8IdxRng(list []uint8, indices []int, element uint8) (int, int, bool)

UInt8IdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func UInt8IdxRngDesc

func UInt8IdxRngDesc(list []uint8, indices []int, element uint8) (int, int, bool)

UInt8IdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func UInt8Rng

func UInt8Rng(list []uint8, element uint8) (int, int, bool)

UInt8Rng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func UInt8RngDesc

func UInt8RngDesc(list []uint8, element uint8) (int, int, bool)

UInt8RngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func UIntDesc

func UIntDesc(list []uint, element uint) (int, bool)

UIntDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func UIntIdx

func UIntIdx(list []uint, indices []int, element uint) (int, bool)

UIntIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func UIntIdxDesc

func UIntIdxDesc(list []uint, indices []int, element uint) (int, bool)

UIntIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func UIntIdxRng

func UIntIdxRng(list []uint, indices []int, element uint) (int, int, bool)

UIntIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func UIntIdxRngDesc

func UIntIdxRngDesc(list []uint, indices []int, element uint) (int, int, bool)

UIntIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func UIntPtr

func UIntPtr(list []uintptr, element uintptr) (int, bool)

UIntPtr searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in ascending order.

func UIntPtrDesc

func UIntPtrDesc(list []uintptr, element uintptr) (int, bool)

UIntPtrDesc searches an element in list and returns its index. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be unique and in descending order.

func UIntPtrIdx

func UIntPtrIdx(list []uintptr, indices []int, element uintptr) (int, bool)

UIntPtrIdx searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in ascending order by indices.

func UIntPtrIdxDesc

func UIntPtrIdxDesc(list []uintptr, indices []int, element uintptr) (int, bool)

UIntPtrIdxDesc searches an element in list and returns its index in indices. Second return value is true, if element is in list, otherwise false and the index returned is the insert index. Indices must reference elements in list, elements must be unique and in descending order by indices.

func UIntPtrIdxRng

func UIntPtrIdxRng(list []uintptr, indices []int, element uintptr) (int, int, bool)

UIntPtrIdxRng searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order by indices.

func UIntPtrIdxRngDesc

func UIntPtrIdxRngDesc(list []uintptr, indices []int, element uintptr) (int, int, bool)

UIntPtrIdxRngDesc searches an element in list and returns its start and end index in indices. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order by indices.

func UIntPtrRng

func UIntPtrRng(list []uintptr, element uintptr) (int, int, bool)

UIntPtrRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func UIntPtrRngDesc

func UIntPtrRngDesc(list []uintptr, element uintptr) (int, int, bool)

UIntPtrRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

func UIntRng

func UIntRng(list []uint, element uint) (int, int, bool)

UIntRng searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in ascending order.

func UIntRngDesc

func UIntRngDesc(list []uint, element uint) (int, int, bool)

UIntRngDesc searches an element in list and returns its start and end index. Start index is inclusive, end index is exclusive. Third return value is true, if element is in list, otherwise false and the index returned is the insert index. Elements in list must be in descending order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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