util

package
v0.0.0-...-5c0e551 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiTiler

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

func NewMultiTiler

func NewMultiTiler(numDims, tiles int, scalers []Scaler) (MultiTiler, error)

NewMultiTiler creates a new Indexing Tiler, which returns a slice of indexes based on the tiles' hashes. Input data is scaled based on the provided scaling structs. Then each dimension is tiled individually and in pairs. The length of the []Scaler should either be equal to 'numDims', or it should be length 1 (in which case it will apply to all tiles).

func (MultiTiler) NumberOfIndices

func (st MultiTiler) NumberOfIndices() int

func (MultiTiler) Tile

func (st MultiTiler) Tile(data []float64) ([]int, error)

Tile returns a vector of length equal to tiles (the argument to NewMultiTiler). That vector contains indices describing the input data.

type Scaler

type Scaler struct {
	MaxRange int
	// contains filtered or unexported fields
}

Scaler is used to provide a scaling range for tiles.

func NewScaler

func NewScaler(min, max float64, maxRange int) Scaler

NewScaler creates a new Scaler struct. It's used to indicate that data should be scaled from [min, max] to the range [0+x, maxRange+x], where x is an unspecified integer.

func (Scaler) Scale

func (scale Scaler) Scale(val float64) float64

Scaler scales a value based on the Scaler settings. If the input data is below min or above max, the behavior is not defined (but it will probably mess up your indices).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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