package rdp

import "github.com/influxdata/flux/stdlib/experimental/polyline/rdp"

Index

Functions

func DownSampleRetention

func DownSampleRetention(ipdata []Point, startIndex int64, endIndex int64, weights []float64) []float64

func FindFarthestPoint

func FindFarthestPoint(line ConnectLine, ipdata []Point) (farthestPointIndex int, farthestPointDistanceFromLine float64)

Types

type ConnectLine

type ConnectLine struct {
	Starting Point
	Ending   Point
}

func (ConnectLine) Coefficients

func (l ConnectLine) Coefficients() (a, b, c float64)

type Point

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

func DownSampleIpdata

func DownSampleIpdata(ipdata []Point, epsilon float64) []Point

func DownSampleIpdataAuto

func DownSampleIpdataAuto(ipdata []Point) []Point

type Rdp

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

func New

func New(timeColumn string, valColumn string, threshold float64, retentionPercent float64, alloc memory.Allocator) *Rdp

func (*Rdp) Do

func (r *Rdp) Do(vs *array.Float, ts *array.Float) (*array.Int, *array.Float, error)

func (*Rdp) SplitCoordinates

func (r *Rdp) SplitCoordinates(sampledPoints []Point) (*array.Int, *array.Float)

func (*Rdp) ToPoints

func (r *Rdp) ToPoints() []Point

Source Files

rdp.go

Version
v0.196.1 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
1 day ago

Tools for package owners.