vtx

package
v1.17.10 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vtx is the table that welds equal vertices for the loaders of package model: a hash table from a key of three integers (the bits of a position, or its cell on a grid) to the number of the vertex that was first seen with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(k Key) uint64

Hash is the hash of a key; its high bits are as good as its low ones, so a caller can share the keys among tables by them.

Types

type Key

type Key [3]int64

Key is the three integers of a position.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table maps keys to consecutive numbers 0, 1, 2 ... in the order in which the keys first came.

func New

func New(hint int) *Table

New makes a table with room for about hint keys.

func (*Table) Find

func (t *Table) Find(k Key) (n uint32, added bool)

Find returns the number of the key, adding the key with the next number when it is new (added is true).

func (*Table) FindHash

func (t *Table) FindHash(k Key, h uint64) (n uint32, added bool)

FindHash is Find for a key whose hash the caller has.

func (*Table) Len

func (t *Table) Len() int

Len is the number of different keys.

Jump to

Keyboard shortcuts

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