fu

package
v0.0.0-...-6d9c029 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Byte = reflect.TypeOf(byte(0))
View Source
var EmptyString = reflect.ValueOf("")
View Source
var Fixed8Type = reflect.TypeOf(Fixed8{0})
View Source
var Fixed8Zero = reflect.ValueOf(Fixed8{0})
View Source
var Float32 = reflect.TypeOf(float32(0))
View Source
var Float32Zero = reflect.ValueOf(float32(0))
View Source
var Float64 = reflect.TypeOf(float64(0))
View Source
var Float64Zero = reflect.ValueOf(float64(0))
View Source
var Int = reflect.TypeOf(int(0))
View Source
var Int16 = reflect.TypeOf(int16(0))
View Source
var Int32 = reflect.TypeOf(int32(0))
View Source
var Int64 = reflect.TypeOf(int64(0))
View Source
var Int8 = reflect.TypeOf(int8(0))
View Source
var IntZero = reflect.ValueOf(int(0))
View Source
var InterfaceType = reflect.TypeOf(interface{}(nil))
View Source
var String = reflect.TypeOf("")
View Source
var StructType = reflect.TypeOf(Struct{})
View Source
var TensorType = reflect.TypeOf(Tensor{})
View Source
var TsZero = reflect.ValueOf(time.Time{})
View Source
var Uint = reflect.TypeOf(uint(0))
View Source
var Uint16 = reflect.TypeOf(uint16(0))
View Source
var Uint32 = reflect.TypeOf(uint32(0))
View Source
var Uint64 = reflect.TypeOf(uint64(0))
View Source
var Uint8 = reflect.TypeOf(uint8(0))

Functions

func Absr

func Absr(a float32) float32

func AllStrOptions

func AllStrOptions(o []interface{}, t ...interface{}) []string

func AsMap

func AsMap(s interface{}) map[string]reflect.Value

func Avgr

func Avgr(a []float32) float32

func BoolOption

func BoolOption(t interface{}, o []interface{}) bool

func Contains

func Contains(cont interface{}, val interface{}) bool

func Convert

func Convert(v reflect.Value, na bool, tp reflect.Type) reflect.Value

func ConvertSlice

func ConvertSlice(v reflect.Value, na Bits, tp reflect.Type, nocopy ...bool) reflect.Value

func Copy

func Copy(writer io.Writer, reader io.Reader, opts ...interface{}) (count int, err error)

func CopySlice

func CopySlice(a interface{}) interface{}

CopySlice returns copy of given slice

func Cord

func Cord(x, y []float64) float64

func Corr

func Corr(x, y []float32) float64

func Fast32f

func Fast32f(s string) (float32, error)

func FieldsOf

func FieldsOf(s interface{}) []string

func Flatnr

func Flatnr(a [][]float32) []float32

func FloatOption

func FloatOption(t interface{}, o []interface{}) float64

func Fnz

func Fnz(a ...interface{}) interface{}

Fnz returns the first non zero value

func Fnzb

func Fnzb(e ...bool) bool

Fnzb returns the first non false bool

func Fnzd

func Fnzd(a ...float64) float64

Fnzd returns the first non zero double value

func Fnze

func Fnze(e ...error) error

Fnze returns the first non nil error

func Fnzi

func Fnzi(a ...int) int

Fnzi returns the first non integer zero value

func Fnzl

func Fnzl(a ...int64) int64

Fnzl returns the first non zero long integer value

func Fnzr

func Fnzr(a ...float32) float32

Fnzr returns the first non zero float value

func Fnzs

func Fnzs(e ...string) string

Fnzs returns the first non empty string

func Ife

func Ife(expr bool, x interface{}, y interface{}) interface{}

Ife returns x if expr == true else returns y

func Ifed

func Ifed(expr bool, x float64, y float64) float64

Ifed returns x if expr == true else returns y

func Ifei

func Ifei(expr bool, x int, y int) int

Ifei returns x if expr == true else returns y

func Ifel

func Ifel(expr bool, x int64, y int64) int64

Ifel returns x if expr == true else returns y

func Ifer

func Ifer(expr bool, x float32, y float32) float32

Ifer returns x if expr == true else returns y

func Ifes

func Ifes(expr bool, x string, y string) string

Ifes returns x if expr == true else returns y

func Ifev

func Ifev(expr bool, x reflect.Value, y reflect.Value) reflect.Value

Ifev returns x if expr == true else returns y

func IfsOption

func IfsOption(t interface{}, o []interface{}) interface{}

func Index

func Index(i int, p interface{}) unsafe.Pointer

func IndexOf

func IndexOf(a string, b []string) int

func IndexOfMax

func IndexOfMax(a interface{}) int

IndexOfMax returns index of maximal value

func IndexOfMin

func IndexOfMin(a interface{}) int

IndexOfMin returns index of minimal value

func Indmaxd

func Indmaxd(a []float64) int

func Indmind

func Indmind(a []float64) int

func IntOption

func IntOption(t interface{}, o []interface{}) int

func Isna

func Isna(v reflect.Value) bool

func KeysOf

func KeysOf(m interface{}) interface{}

KeysOf returns list of keys of a map

func Less

func Less(a, b reflect.Value) bool

Less compares two values and returns true if the left value is less than right one otherwise it returns false

func MapInterface

func MapInterface(m map[string]reflect.Value) map[string]interface{}

func Max

func Max(a ...interface{}) interface{}

Max returns maximal value

func MaxIndex

func MaxIndex(a reflect.Value) int

MaxIndex returns index of maximal value

func MaxValue

func MaxValue(a reflect.Value) reflect.Value

MaxValue returns maximal value

func Maxd

func Maxd(a float64, b ...float64) float64

Maxd returns maximal float64 value

func Maxi

func Maxi(a int, b ...int) int

Maxi returns maximal int value

func Maxr

func Maxr(a float32, b ...float32) float32

Maxr returns maximal float32 value

func Meanr

func Meanr(a []float32) float32

func Min

func Min(a ...interface{}) interface{}

Min returns minimal value

func MinIndex

func MinIndex(a reflect.Value) int

MinIndex returns index of minimal value

func MinMaxr

func MinMaxr(a []float32) (float32, float32)

func MinValue

func MinValue(a reflect.Value) reflect.Value

MaxValue returns maximal value

func Mind

func Mind(a float64, b ...float64) float64

Mind returns minimal float32 value

func Mini

func Mini(a int, b ...int) int

Mini returns minimal int value

func Minr

func Minr(a float32, b ...float32) float32

Minr returns minimal float32 value

func ModelPath

func ModelPath(s string) string

func Mse

func Mse(a, b []float32) float32

func MultiOption

func MultiOption(o []interface{}, t ...interface{}) (reflect.Value, int)

func Nan

func Nan(tp reflect.Type) reflect.Value

func OnlyFilter

func OnlyFilter(names []string, c ...string) func(Struct) Struct

func Option

func Option(t interface{}, o interface{}) reflect.Value

func Pattern

func Pattern(pattern string) func(string) bool

func RandomIndex

func RandomIndex(ln, seed int) []int

func RandomInts

func RandomInts(seed int, count int) []int

func Rank

func Rank(a []float32, first ...bool) []float32

func RankPct

func RankPct(a []float32, first ...bool) []float32

func Reverse

func Reverse(slice interface{})

func Reversed

func Reversed(slice interface{}) interface{}

func Rindmaxd

func Rindmaxd(a []float64) int

func Rindmind

func Rindmind(a []float64) int

func Round32

func Round32(v float32, n int) float32

func Round32s

func Round32s(v []float32, n int) []float32

func Round64

func Round64(v float64, n int) float64

func Round64s

func Round64s(v []float64, n int) []float64

func RuneOption

func RuneOption(t interface{}, o []interface{}) rune

func Seed

func Seed(seed int) int

func Seed32

func Seed32(seed int) uint32

func Seed64

func Seed64(seed int) int64

func Sigmar

func Sigmar(a []float32) float64

func Slow32f

func Slow32f(s string) (float32, error)

func Sort

func Sort(a interface{})

func Sorted

func Sorted(a interface{}) interface{}

func SortedKeysOf

func SortedKeysOf(m interface{}) interface{}

SortedKeysOf returns sorted list of keys of a map

func Starsub

func Starsub(pattern, subst string) func(string) (string, bool)

func StrMultiOption

func StrMultiOption(o []interface{}, t ...interface{}) (string, int)

func StrOption

func StrOption(t interface{}, o []interface{}) string

func Strings

func Strings(m interface{}) (r []string)

func TensorUnpacker

func TensorUnpacker(lr Struct, c string) func(lr Struct) Struct

func Transformer

func Transformer(rt reflect.Type) func(reflect.Value, reflect.Value) reflect.Value

func Unwrapper

func Unwrapper(v reflect.Type) func(lr Struct) reflect.Value

func ValsOf

func ValsOf(m interface{}) interface{}

func Varr

func Varr(a []float32) float64

func Words

func Words(l int) int

func Wrapper

func Wrapper(rt reflect.Type) func(reflect.Value) Struct

Types

type AtomicCounter

type AtomicCounter struct {
	Value uint64
}

AtomicCounter - hm, yes it's atomic counter

func (*AtomicCounter) Dec

func (c *AtomicCounter) Dec() uint64

Dec decrements counter and returns NEW value

func (*AtomicCounter) PostInc

func (c *AtomicCounter) PostInc() uint64

PostInc increments counter and returns OLD value

type AtomicFlag

type AtomicFlag struct {
	Value int32
}

AtomicFlag - hm, yes it's atomic flag

func (*AtomicFlag) Clear

func (c *AtomicFlag) Clear() bool

Clear switches Integer to 0 atomically

func (*AtomicFlag) Set

func (c *AtomicFlag) Set() bool

Set switches Integer to 1 atomically

func (*AtomicFlag) State

func (c *AtomicFlag) State() bool

State returns current state

type AtomicMask_

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

func AtomicMask

func AtomicMask(width int) *AtomicMask_

func ExtendableAtomicMask

func ExtendableAtomicMask(canextend func(int) bool) *AtomicMask_

func (*AtomicMask_) FinCallForAll

func (a *AtomicMask_) FinCallForAll(f func(no int))

func (*AtomicMask_) Lock

func (a *AtomicMask_) Lock() int

func (*AtomicMask_) Unlock

func (a *AtomicMask_) Unlock(i int)

type AtomicPool_

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

func AtomicPool

func AtomicPool(acquire func(no int) interface{}) *AtomicPool_

func (*AtomicPool_) Allocate

func (a *AtomicPool_) Allocate() (interface{}, int)

func (*AtomicPool_) Close

func (a *AtomicPool_) Close()

func (*AtomicPool_) Release

func (a *AtomicPool_) Release(n int)

type AtomicSingleIndex

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

AtomicSingleIndex - it's an atomic positive integer single set value

func (*AtomicSingleIndex) Get

func (c *AtomicSingleIndex) Get() (int, bool)

Get returns index value

func (*AtomicSingleIndex) Set

func (c *AtomicSingleIndex) Set(value int) (int, bool)

Set sets value if it was not set before

type Bits

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

func FillBits

func FillBits(count int) Bits

func (Bits) Append

func (q Bits) Append(z Bits, at int) Bits

func (Bits) Bit

func (q Bits) Bit(i int) bool

func (Bits) Copy

func (q Bits) Copy() Bits

func (Bits) Count

func (q Bits) Count() (n int)

func (Bits) Grow

func (q Bits) Grow(cap int) Bits

func (Bits) Len

func (q Bits) Len() int

func (*Bits) Or_

func (q *Bits) Or_(a Bits)

func (Bits) Repr

func (q Bits) Repr() string

func (*Bits) Set

func (q *Bits) Set(i int, v bool)

func (Bits) Slice

func (q Bits) Slice(from, to int) Bits

func (Bits) String

func (q Bits) String() string

func (Bits) Word

func (q Bits) Word(i int) uint

type Cell

type Cell struct {
	reflect.Value
}

func (Cell) Float

func (c Cell) Float() float64

func (Cell) Int

func (c Cell) Int() int

func (Cell) Int16

func (c Cell) Int16() int16

func (Cell) Int32

func (c Cell) Int32() int32

func (Cell) Int64

func (c Cell) Int64() int64

func (Cell) Int8

func (c Cell) Int8() int8

func (Cell) Real

func (c Cell) Real() float32

func (Cell) Reals

func (c Cell) Reals(docopy ...bool) []float32

func (Cell) String

func (c Cell) String() string

func (Cell) Text

func (c Cell) Text() string

func (Cell) Uint

func (c Cell) Uint() uint

func (Cell) Uint16

func (c Cell) Uint16() uint16

func (Cell) Uint32

func (c Cell) Uint32() uint32

func (Cell) Uint64

func (c Cell) Uint64() uint64

func (Cell) Uint8

func (c Cell) Uint8() uint8

func (Cell) Values

func (c Cell) Values() interface{}

func (Cell) Volume

func (c Cell) Volume() int

type CopyBufferSize

type CopyBufferSize int

type CopyProgress

type CopyProgress func(count int)

type Fixed8

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

value in range [-1..1] with 2 digits precession

func AsFixed8

func AsFixed8(v float32) Fixed8

func Fast8f

func Fast8f(s string) (v8 Fixed8, err error)

func RawAsFixed8

func RawAsFixed8(v int8) Fixed8

func (Fixed8) Float32

func (v Fixed8) Float32() float32

func (Fixed8) Raw

func (v Fixed8) Raw() int8

func (Fixed8) String

func (v Fixed8) String() string

type Lexic

type Lexic []func(string) bool

func (Lexic) Accepted

func (lx Lexic) Accepted(s string, dflt ...bool) bool

type NaiveRandom

type NaiveRandom struct {
	Value uint32
}

func (*NaiveRandom) Float

func (nr *NaiveRandom) Float() float64

func (*NaiveRandom) Int

func (nr *NaiveRandom) Int() int

func (*NaiveRandom) Reseed

func (nr *NaiveRandom) Reseed()

func (*NaiveRandom) Uint

func (nr *NaiveRandom) Uint() uint

func (*NaiveRandom) Uint32

func (nr *NaiveRandom) Uint32() (r uint32)

type Struct

type Struct struct {
	Names   []string
	Columns []reflect.Value
	Na      Bits
}

func MakeStruct

func MakeStruct(names []string, vals ...interface{}) Struct

func NaStruct

func NaStruct(names []string, tp reflect.Type) Struct

func (Struct) Copy

func (lr Struct) Copy(extra int) Struct

func (Struct) Float

func (lr Struct) Float(c string) float64

func (Struct) Index

func (lr Struct) Index(c string) Cell

func (Struct) Int

func (lr Struct) Int(c string) int

func (Struct) Pos

func (lr Struct) Pos(c string) int

func (Struct) Real

func (lr Struct) Real(c string) float32

func (Struct) Round

func (lr Struct) Round(p int) Struct

func (Struct) Set

func (lr Struct) Set(c string, val reflect.Value) Struct

func (Struct) String

func (lr Struct) String() string

func (Struct) Text

func (lr Struct) Text(c string) string

func (Struct) UnpackTensor

func (lr Struct) UnpackTensor(c string) Struct

func (Struct) Value

func (lr Struct) Value(c string) reflect.Value

func (Struct) ValueAt

func (lr Struct) ValueAt(i int) reflect.Value

func (Struct) With

func (lrx Struct) With(lr Struct) (r Struct)

type Tensor

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

func DecodeTensor

func DecodeTensor(string) (t Tensor, err error)

gets base64-encoded compressed stream as a string prefixed by \xE2\x9C\x97` (✗`)

func MakeByteTensor

func MakeByteTensor(channels, height, width int, values []byte, docopy ...bool) Tensor

func MakeFixed8Tensor

func MakeFixed8Tensor(channels, height, width int, values []Fixed8, docopy ...bool) Tensor

func MakeFloat32Tensor

func MakeFloat32Tensor(channels, height, width int, values []float32, docopy ...bool) Tensor

func MakeFloat64Tensor

func MakeFloat64Tensor(channels, height, width int, values []float64, docopy ...bool) Tensor

func MakeIntTensor

func MakeIntTensor(channels, height, width int, values []int, docopy ...bool) Tensor

func (Tensor) Depth

func (t Tensor) Depth() int

func (Tensor) Encode

func (t Tensor) Encode(compress bool) (str string)

func (Tensor) Height

func (t Tensor) Height() int

func (Tensor) String

func (t Tensor) String() (str string)

func (Tensor) Width

func (t Tensor) Width() int

type VersionType

type VersionType int

func MakeVersion

func MakeVersion(major, minor, patch int) VersionType

func (VersionType) Major

func (v VersionType) Major() int

func (VersionType) Minor

func (v VersionType) Minor() int

func (VersionType) Patch

func (v VersionType) Patch() int

func (VersionType) String

func (v VersionType) String() string

type WaitCounter

type WaitCounter struct {
	Value uint64
	// contains filtered or unexported fields
}

WaitCounter implements barrier counter for lazy flow execution synchronization

func (*WaitCounter) Inc

func (c *WaitCounter) Inc() (r bool)

PostInc increments index and notifies waiting goroutines

func (*WaitCounter) Stop

func (c *WaitCounter) Stop()

Stop sets Integer to ~uint64(0) and notifies waiting goroutines. It means also counter will not increment more

func (*WaitCounter) Stopped

func (c *WaitCounter) Stopped() bool

Stopped returns true if counter is stopped and will not increment more

func (*WaitCounter) Wait

func (c *WaitCounter) Wait(index uint64) (r bool)

Wait waits until counter Integer is not equal to specified index

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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