util

package
v0.0.0-...-9098a98 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package util provides some utility methods to be used by other packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxInt

func MaxInt(x int, y int) int

Find the max between two int values

func MaxInt64

func MaxInt64(x int64, y int64) int64

Find the max between two int64 values

func MaxUint64

func MaxUint64(x uint64, y uint64) uint64

Find the max between two uint64 values

func MinInt

func MinInt(x int, y int) int

Find the min between two int values

func MinInt64

func MinInt64(x int64, y int64) int64

Find the min between two int64 values

func MinUint64

func MinUint64(x uint64, y uint64) uint64

Find the min between two uint64 values

Types

type Slice

type Slice struct {
	sort.Interface
	Idx  []int
	Desc bool
}

Argsort utilities

func NewFloat64Slice

func NewFloat64Slice(desc bool, n ...float64) *Slice

func NewIntSlice

func NewIntSlice(desc bool, n ...int) *Slice

func NewSlice

func NewSlice(n sort.Interface, desc bool) *Slice

func NewStringSlice

func NewStringSlice(desc bool, n ...string) *Slice

func (Slice) Less

func (s Slice) Less(i, j int) bool

func (Slice) Swap

func (s Slice) Swap(i, j int)

Jump to

Keyboard shortcuts

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