mat

package
v0.0.0-...-4873089 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxFloat32

func MaxFloat32(i ...float32) float32

MaxFloat32 返回a和b中最大值

func MaxInt

func MaxInt(i ...int) int

MaxInt returns max of integers

func MinFloat32

func MinFloat32(i ...float32) float32

MinFloat32 返回a和b中最小值

func MinInt

func MinInt(i ...int) int

MinInt 返回a和b中最小值

func Sum

func Sum(arr interface{}, f func(v interface{}) int) int

Sum 计算slice中指定值的和

Types

type Maxer

type Maxer struct {
	ValuerBase
}

Maxer 求最大值

func (*Maxer) Tap

func (m *Maxer) Tap(v float32)

Tap 打点数据

type Miner

type Miner struct {
	ValuerBase
}

Miner 求最小值

func (*Miner) Tap

func (m *Miner) Tap(v float32)

Tap 打点数据

type Valuer

type Valuer interface {
	// Reset 重置状态
	Reset()
	// Tag 打点数据
	Tap(float32)
	// Value 获取数据,以及数据是否有效
	Value() (float32, bool)
	// Value 获取数据
	PureValue() float32
}

Valuer 值计算器

type ValuerBase

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

ValuerBase 表示Valuer的基础实现

func (ValuerBase) PureValue

func (m ValuerBase) PureValue() float32

PureValue 获取数据

func (*ValuerBase) Reset

func (m *ValuerBase) Reset()

Reset 重置状态

func (ValuerBase) Value

func (m ValuerBase) Value() (float32, bool)

Value 获取数据,以及数据是否有效

Jump to

Keyboard shortcuts

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