vectopsf64

package module
v0.0.0-...-0461e1c Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

vectopsf64

Vector ([]float64) library - immediate operations on float64 arrays

Quick Example
package main

import (
	"fmt"
	v "github.com/CaptainDyce/vectopsf64"
	"math"
)

func main() {
	// defining an identity vector 0..100, dividing each entry by 2*pi, apply math.Sin and reverse the vector
	v1 := v.OnIdent(100).Divl(2 * math.Pi).ApplyOp(math.Sin).Rev()
	fmt.Println(v1)
	// print the sum of the section [50..70[
	fmt.Println(v1.Slice(50, 70).Sum())

	a := make([]float64, 100)
	v2 := v.On(a).Ident().Divl(2 * math.Pi).ApplyOp(math.Sin).Rev()
	fmt.Println(v2)
	// print the sum of the section [50..70[
	fmt.Println(v2.Slice(50, 70).Sum())
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VectOp

type VectOp []float64

func On

func On(v []float64) VectOp

func OnConst

func OnConst(value float64, size int) VectOp

func OnIdent

func OnIdent(size int) VectOp

func OnInts

func OnInts(values []int) VectOp

func OnSize

func OnSize(size int) VectOp

func (VectOp) Abs

func (s VectOp) Abs() VectOp

-> s'[i] = abs(s[i])

func (VectOp) Apply

func (s VectOp) Apply(f fs.IndexedFunc) VectOp

func (VectOp) ApplyOp

func (s VectOp) ApplyOp(f fs.Operator) VectOp

func (VectOp) ApplyOpi

func (s VectOp) ApplyOpi(f fs.IndexedOperator) VectOp

func (VectOp) DivOp

func (s VectOp) DivOp(o fs.IndexedFunc) VectOp

-> s'[i] = s[i] / o(i)

func (VectOp) DivOpi

func (s VectOp) DivOpi(o fs.IndexedOperator) VectOp

-> s'[i] = s[i] / o(i, s[i])

func (VectOp) Divl

func (s VectOp) Divl(value float64) VectOp

-> s'[i] = s[i] / value

func (VectOp) Divv

func (s VectOp) Divv(v []float64) VectOp

/////////////// Div /////////////// -> s'[i] = s[i] / v[i]

func (VectOp) Dot

func (s VectOp) Dot(v []float64) float64

-> s.v

func (VectOp) Exp

func (s VectOp) Exp() VectOp

-> s'[i] = exp(s[i])

func (VectOp) Expl

func (s VectOp) Expl(value float64) VectOp

-> s'[i] = value ^ s[i]

func (VectOp) ForEach

func (s VectOp) ForEach(c fs.Consumer)

-> c(s[i])...

func (VectOp) ForEachIndexed

func (s VectOp) ForEachIndexed(c fs.IndexedConsumer)

-> c(i, s[i])...

func (VectOp) Head

func (s VectOp) Head(n int) VectOp

-> s[0..n[

func (VectOp) Ident

func (s VectOp) Ident() VectOp

func (VectOp) Idivl

func (s VectOp) Idivl(value float64) VectOp

-> s'[i] = value / s[i]

func (VectOp) IndexOf

func (s VectOp) IndexOf(p fs.Predicate) int

func (VectOp) IndexOfVal

func (s VectOp) IndexOfVal(value float64) int

-> index of the first occurrence of the specified value in this vector, or < 0 if absent...

func (VectOp) IndexesOf

func (s VectOp) IndexesOf(p fs.Predicate) []int

-> indexes of all occurrences of the specified value in this vector, or empty...

func (VectOp) IndexesOfVal

func (s VectOp) IndexesOfVal(value float64) []int

--> indexes of all occurrences of the specified value in this vector, or empty...

func (VectOp) Inv

func (s VectOp) Inv() VectOp

-> s'[i] = 1 / s[i]

func (VectOp) Last

func (s VectOp) Last() float64

-> s[last]

func (VectOp) Log

func (s VectOp) Log() VectOp

-> s'[i] = log(s[i])

func (VectOp) Max

func (s VectOp) Max() float64

-> max(s[i]), -inf if empty

func (VectOp) MaxOp

func (s VectOp) MaxOp(o fs.IndexedFunc) VectOp

-> s'[i] = max(s[i], o(i))

func (VectOp) MaxOpi

func (s VectOp) MaxOpi(o fs.IndexedOperator) VectOp

-> s'[i] = max(s[i], o(i, s[i]))

func (VectOp) Maxl

func (s VectOp) Maxl(value float64) VectOp

-> s'[i] = max(s[i], value)

func (VectOp) Maxv

func (s VectOp) Maxv(v []float64) VectOp

/////////////// Max /////////////// -> s'[i] = max(s[i], v[i])

func (VectOp) Min

func (s VectOp) Min() float64

-> min(s[i]), +inf if empty

func (VectOp) MinOp

func (s VectOp) MinOp(o fs.IndexedFunc) VectOp

-> s'[i] = min(s[i], o(i))

func (VectOp) MinOpi

func (s VectOp) MinOpi(o fs.IndexedOperator) VectOp

-> s'[i] = min(s[i], o(i, s[i]))

func (VectOp) Minl

func (s VectOp) Minl(value float64) VectOp

-> s'[i] = min(s[i], value)

func (VectOp) MinusOp

func (s VectOp) MinusOp(o fs.IndexedFunc) VectOp

-> s'[i] = s[i] + o(i)

func (VectOp) MinusOpi

func (s VectOp) MinusOpi(o fs.IndexedOperator) VectOp

-> s'[i] = s[i] + o(i, s[i])

func (VectOp) Minusl

func (s VectOp) Minusl(value float64) VectOp

-> s'[i] = s[i] - value

func (VectOp) Minusv

func (s VectOp) Minusv(v []float64) VectOp

/////////////// Minus /////////////// -> s'[i] = s[i] - v[i]

func (VectOp) Minv

func (s VectOp) Minv(v []float64) VectOp

/////////////// Min /////////////// -> s'[i] = min(s[i], v[i])

func (VectOp) Neg

func (s VectOp) Neg() VectOp

-> s'[i] = -s[i]

func (VectOp) PlusOp

func (s VectOp) PlusOp(o fs.IndexedFunc) VectOp

-> s'[i] = s[i] + o(i)

func (VectOp) PlusOpi

func (s VectOp) PlusOpi(o fs.IndexedOperator) VectOp

-> s'[i] = s[i] + o(i, s[i])

func (VectOp) Plusl

func (s VectOp) Plusl(value float64) VectOp

-> s'[i] = s[i] + value

func (VectOp) Plusv

func (s VectOp) Plusv(v []float64) VectOp

/////////////// Plus /////////////// -> s'[i] = s[i] + v[i]

func (VectOp) PowOp

func (s VectOp) PowOp(o fs.IndexedFunc) VectOp

-> s'[i] = s[i] ^ o(i)

func (VectOp) PowOpi

func (s VectOp) PowOpi(o fs.IndexedOperator) VectOp

-> s'[i] = s[i] ^ o(i, s[i])

func (VectOp) Powl

func (s VectOp) Powl(value float64) VectOp

-> s'[i] = s[i] ^ value

func (VectOp) Powv

func (s VectOp) Powv(v []float64) VectOp

/////////////// Pow /////////////// -> s'[i] = s[i] ^ v[i] (as in e.g. 2^3...)

func (VectOp) Reduce

func (s VectOp) Reduce(f fs.ReduceOperator, identity float64) float64

-> f[v[n - 1], ... f[v[2], f[v[1], f[v[0], identity]]]]

func (VectOp) Rev

func (s VectOp) Rev() VectOp

func (VectOp) SetMaskl

func (s VectOp) SetMaskl(value float64, p is.Predicate) VectOp

func (VectOp) SetMaskv

func (s VectOp) SetMaskv(v []float64, p is.Predicate) VectOp

func (VectOp) Setl

func (s VectOp) Setl(value float64) VectOp

func (VectOp) Setv

func (s VectOp) Setv(v []float64) VectOp

func (VectOp) Slice

func (s VectOp) Slice(start int, end int) VectOp

func (VectOp) Stream

func (s VectOp) Stream() <-chan float64

-> <-chan = <-s[i]...

func (VectOp) Sum

func (s VectOp) Sum() float64

-> sum(s[i])

func (VectOp) Tail

func (s VectOp) Tail(n int) VectOp

-> s[n..end[

func (VectOp) TimesOp

func (s VectOp) TimesOp(o fs.IndexedFunc) VectOp

-> s'[i] = s[i] * o(i)

func (VectOp) TimesOpi

func (s VectOp) TimesOpi(o fs.IndexedOperator) VectOp

-> s'[i] = s[i] * o(i, s[i])

func (VectOp) Timesl

func (s VectOp) Timesl(value float64) VectOp

-> s'[i] = s[i] * value

func (VectOp) Timesv

func (s VectOp) Timesv(v []float64) VectOp

/////////////// Times /////////////// -> s'[i] = s[i] * v[i]

Jump to

Keyboard shortcuts

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