bit

package
v0.0.0-...-e3597af Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array interface {
	Resize(n int)
	Len() int
	BitNum() int
	HammingDistance(int, *Vector) (int, error)
	CalcEuclidLSHScoreAndSortPartially(x *Vector, norm float32, norms []float32, cosTable []float32, n int) []IDist
	Get(int) (*Vector, error)
	Set(int, *Vector) error
	Save(io.Writer) error
}

Array is an array of bitvectors.

func LoadArray

func LoadArray(r io.Reader) (Array, error)

LoadArray loads an array from io.Reader.

func NewArray

func NewArray(bitNum int) Array

NewArray creates an empty new Array.

type ID

type ID uint32

type IDist

type IDist struct {
	ID   ID
	Dist float32
}

type Vector

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

Vector is a bitvector.

func NewVector

func NewVector(bitNum int) *Vector

Vector creates a new bitvector. All bits are initialized with zero.

func (*Vector) Set

func (v *Vector) Set(n int) error

Set sets the nth bit one.

Jump to

Keyboard shortcuts

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