generator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 4 Imported by: 0

README

Generator Package

The generator package contains a few simple generators for data. It's usage is mostly intended for generating increasing sequences, but also test and experimentation data.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExponential

func NewExponential(num int, a, step float64) model.Collection

NewLine creates a new collection of vectors forming a line

func NewLine

func NewLine(num int, a, b, step float64) model.Collection

NewLine creates a new collection of a number of vectors forming a line

func NewPolynomial

func NewPolynomial(num int, b, step float64, a ...float64) model.Collection

NewLine creates a new collection of vectors forming a line

Types

type Euclidean

type Euclidean struct {
	model.Iterator
	F
}

func NewExponentialGenerator

func NewExponentialGenerator(a, step float64) *Euclidean

NewLineGenerator creates a new generator for a 2d line

func NewLineGenerator

func NewLineGenerator(a, b, step float64) *Euclidean

NewLineGenerator creates a new generator for a 2d line

func NewPolynomialGenerator

func NewPolynomialGenerator(b, step float64, a ...float64) *Euclidean

NewLineGenerator creates a new generator for a 2d line

func (Euclidean) Lim

func (g Euclidean) Lim(limit float64) model.Collection

Generate generates a new number of points for the graph series

func (Euclidean) Num

func (g Euclidean) Num(num int) model.Collection

Generate generates a new number of points for the graph series

type Exponential

type Exponential model.Series

Exponential is a collection of vectors following an exponential function

type F

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

F is a collection of functions that transform the respective coordinates for the sake of the abstraction , we do incude all coordinates e.g. [ y1,y2,y3...] = [ f1(x1,x2,x3...) , f2(x1,x2,x3...) , f3(x1,x2,x3...) ]

func (*F) Call

func (g *F) Call(p ...float64) []float64

Call executes the F function on a vector

type GL

type GL interface {
	Lim(limit float64) model.Collection
}

GL represents a generator to produce a model series with the Limit

type GN

type GN interface {
	Num(num int) model.Collection
}

GN represents a generator to produce a model series with the specified number of objects

type Line

type Line model.Series

Line is a collection of points adhering to a graph evolution model in 2D space

type LinearSequence

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

type Polynomial

type Polynomial model.Series

Polynomial is a collection of vectors following a polynomial function

type Sequence

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

func NewLinearSequence

func NewLinearSequence(s float64, step float64) *Sequence

func (*Sequence) Next

func (i *Sequence) Next() (vector model.Vector, ok, hasNext bool)

func (*Sequence) Reset

func (i *Sequence) Reset()

type Y

type Y func(x ...float64) float64

Y is a general abstraction of a mathematical function Y = f(X)

Jump to

Keyboard shortcuts

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