xydata

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XY

type XY struct {
	Error string // Error string -- cleared when new function call is made to XYdata object
	// contains filtered or unexported fields
}

xy data

func NewXY added in v0.19.0

func NewXY(x, y []float64) *XY

Creates new XY object

func (*XY) AddXY

func (xy *XY) AddXY(x, y float64)

Adds XY pair to the tail of data array.

func (*XY) FilterX added in v0.20.1

func (xy *XY) FilterX(f func(x float64) bool) []int

Filters all X data with given function and returns the index of filtered values

func (*XY) FilterY added in v0.20.1

func (xy *XY) FilterY(f func(y float64) bool) []int

Filters all Y data with given function and returns the index of filtered values

func (*XY) GetI

func (xy *XY) GetI(x, y float64) int

Finds the index of given X and/or Y value(s). Index is gone through in ascending order and the first match is returned. Use math.NaN() to disable matching.

func (*XY) GetX

func (xy *XY) GetX(i int) (x float64)

Returns X from given index

func (*XY) GetXY

func (xy *XY) GetXY(i int) (x, y float64)

Returns X and Y from given index

func (*XY) GetY

func (xy *XY) GetY(i int) (y float64)

Returns Y from given index

func (*XY) InsertXY

func (xy *XY) InsertXY(x, y float64, i int)

Inserts XY pair into data array.

func (*XY) Len

func (xy *XY) Len() int

Length of data

func (*XY) RemoveXY

func (xy *XY) RemoveXY(i int)

Removes XY pair from given index.

func (*XY) ReplaceXY

func (xy *XY) ReplaceXY(x, y float64, i int)

Replaces XY pair from given index.

func (*XY) SortI

func (xy *XY) SortI(ascending bool) []int

Sorts the index ascending or descending and returns a sorted index.

func (*XY) SortX

func (xy *XY) SortX(ascending bool) []int

Sorts the X values as ascending or descending and returns a sorted index.

func (*XY) SortY

func (xy *XY) SortY(ascending bool) []int

Sorts the Y values as ascending or descending and returns a sorted index.

func (*XY) ViewX

func (xy *XY) ViewX(index []int) *[]float64

Returns a view of X data with given index. If no index is given, all X data is shown in ascending index order.

func (*XY) ViewY

func (xy *XY) ViewY(index []int) *[]float64

Returns a view of Y data with given index. If no index is given, all Y data is shown in ascending index order.

Jump to

Keyboard shortcuts

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