bitutil

package
v0.0.0-...-66aa405 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Copyright 2021 Erigon contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Select64

func Select64(x uint64, k int) int

* Returns the index of the k-th 1-bit in the 64-bit word x.

  • @param x 64-bit word.
  • @param k 0-based rank (`k = 0` returns the position of the first 1-bit). *
  • Uses the broadword selection algorithm by Vigna [1], improved by Gog and Petri [2] and Vigna [3].
  • Facebook's Folly implementation [4]. *
  • [1] Sebastiano Vigna. Broadword Implementation of Rank/Select Queries. WEA, 2008 *
  • [2] Simon Gog, Matthias Petri. Optimized succinct data structures for massive data. Softw. Pract.
  • Exper., 2014 *
  • [3] Sebastiano Vigna. MG4J 5.2.1. http://mg4j.di.unimi.it/ *
  • [4] Facebook Folly library: https://github.com/facebook/folly *

Types

This section is empty.

Jump to

Keyboard shortcuts

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