vectopsdeferf64

package module
v0.0.0-...-22269f7 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: 2 Imported by: 0

README

vectopsf64

Vector operation ([]float64) library - specifications of deferred operations on vectors

Quick Example
package main

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

func main() {
	// defining the following operation:
	// identity vector, divide each entry by 2*pi, apply math.Sin, and reverse the vector
	op := v.Op().Ident().Divl(2 * math.Pi).ApplyOp(math.Sin).Rev()
	a := op.OnSize(100) // apply it on a new [100]float64
	fmt.Println(a)

	b := make([]float64, 100)
	op.On(b) // apply it on b
	fmt.Println(b)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VectOp

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

func Op

func Op() 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(v1 []float64) VectOp

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

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) Ident

func (s VectOp) Ident() VectOp

func (VectOp) Idivl

func (s VectOp) Idivl(value float64) VectOp

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

func (VectOp) Inv

func (s VectOp) Inv() VectOp

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

func (VectOp) Log

func (s VectOp) Log() VectOp

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

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(v1 []float64) VectOp

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

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(v1 []float64) VectOp

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

func (VectOp) Minv

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

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

func (VectOp) Neg

func (s VectOp) Neg() VectOp

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

func (VectOp) On

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

applies the complete operation chain to v

func (VectOp) OnConst

func (s VectOp) OnConst(value float64, size int) []float64

applies the complete operation chain to a new [size] <value>-filled array

func (VectOp) OnIdent

func (s VectOp) OnIdent(size int) []float64

applies the complete operation chain to a new [size] identity array

func (VectOp) OnSize

func (s VectOp) OnSize(size int) []float64

applies the complete operation chain to a new [size] array

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(v1 []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(v1 []float64) VectOp

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

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(v1 []float64, p is.Predicate) VectOp

func (VectOp) Setl

func (s VectOp) Setl(value float64) VectOp

func (VectOp) Setv

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

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(v1 []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