f64utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgMax

func ArgMax(v []float64) int

ArgMax finds the index of the max argument.

func ArgMin

func ArgMin(v []float64) int

ArgMin finds the index of the min argument.

func ArgMinMax

func ArgMinMax(v []float64) (imin, imax int)

ArgMinMax finds the indices of min and max arguments.

func Copy

func Copy(in []float64) []float64

Copy creates and return a copy of the given slice.

func CumSum

func CumSum(dst, src []float64) []float64

CumSum computes the cumulative sum of src into dst, and returns dst.

func EqualApprox

func EqualApprox(a, b float64) bool

EqualApprox returns true if a and b are equal to within reasonable absolute or relative tolerances (both hardcoded as 1.0e-06).

func FillFloatSlice

func FillFloatSlice(slice []float64, value float64)

FillFloatSlice fills the given slice's elements with value.

func MakeFloat64Matrix

func MakeFloat64Matrix(rows, cols int) [][]float64

MakeFloat64Matrix returns a new 2-dimensional slice.

func Max

func Max(v []float64) (m float64)

Max returns the maximum value from the given slice, which MUST NOT be empty.

func Sign

func Sign(a float64) int

Sign returns +1 if a is positive, -1 if a is negative, or 0 if a is 0.

func SoftMax

func SoftMax(v []float64) (sm []float64)

SoftMax returns the results of the softmax function.

func StrToFloat64Slice

func StrToFloat64Slice(str string) ([]float64, error)

StrToFloat64Slice parses a string representation of a slice of float64 values.

func Sum

func Sum(v []float64) (s float64)

Sum returns the sum of all values from the given slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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