Documentation
¶
Index ¶
- func Difference(a, b []int) []int
- func Distinct(ints []int) []int
- func DistinctFloats(floats []float64) []float64
- func GetIndxFloat64(sorted []float64, x float64) int
- func Intersect(a, b []int) (set []int)
- func InvertMap(origMap map[int]int) (newMap map[int][]int, sortedkeys []int)
- func Max(s []int) int
- func OnlyPositive(s []float64) []float64
- func Rev(s []int)
- func RevF(s []float64)
- func Sequential(n int) []int
- func SliceMax(s []float64) float64
- func SliceMean(s []float64) float64
- func SliceMedian(s []float64) float64
- func SliceMin(s []float64) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
Difference returns the elements in `a` that aren't in `b`.
func DistinctFloats ¶
func GetIndxFloat64 ¶
GetIndxFloat64 performs a Go-native binary tree search on a sorted slice of floats to determine the position x would fit. modified from: https://flaviocopes.com/golang-algorithms-binary-search/
func Intersect ¶
Intersect returns the intersection of 2 slices modified from: https://github.com/juliangruber/go-intersect/blob/master/intersect.go
func OnlyPositive ¶
OnlyPositive removes all value <= 0.0 and all NaN's
func Sequential ¶
Sequential builds a n+1 length slice indexed from 0 to n
func SliceMedian ¶
SliceMedian returns the median value of a slice
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.