bigarray

package
v0.0.0-...-abd3a35 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bigarray contains functions for working with very large (effectively infinite) arrays.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Search(min int, f func(i int) (atI bool)) int

Search uses binary search to find and return the smallest index i in [min, maxInt] at which f(i) is true, assuming that on the range [min, maxInt], f(i) == true implies f(i+1) == true. That is, Search requires that f is false for some (possibly empty) prefix of the input range [min, maxInt] and then true thereafter.

func SearchBatch

func SearchBatch(min int, f func(i int) (atLastChecked bool, lastChecked int)) int

SearchBatch is like Search, but f can return additional information to improve performance. SearchBatch expects f to probe at index i and sequentially zero or more additional indices > i, and return upon finding the first index at which its condition evaluates to true.

atLastChecked should be true if the condition is true at index lastChecked.

lastChecked >= i is the last index SearchBatch checked.

Types

This section is empty.

Jump to

Keyboard shortcuts

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