Popularity
1.7
Growing
Activity
1.9

11
2
1
Programming language: Go
Latest version: v2.0.5
piecewiselinear alternatives and similar packages
Based on the "Science and Data Analysis" category

gonum
Gonum is a set of numeric libraries for the Go programming language. It contains libraries for matrices, statistics, optimization, and more. 
gosl
Go scientific library for linear algebra, FFT, geometry, NURBS, numerical methods, probabilities, optimisation, differential equations, and more. 
gonum/mat64
The general purpose package for matrix computation. Package mat64 provides basic linear algebra operations for float64 matrices. 
TextRank
TextRank implementation in Golang with extendable features (summarization, weighting, phrase extraction) and multithreading (goroutine) support. 
sparse
Go Sparse matrix formats for linear algebra supporting scientific and machine learning applications, compatible with gonum matrix libraries. 
vectormath
Vectormath for Go, an adaptation of the scalar C functions from Sony's Vector Math library, as found in the Bullet2.79 source code. (currently inactive) 
triangolatte
2D triangulation library. Allows translating lines and polygons (both based on points) to the language of GPUs. 
ode
An ordinary differential equation (ODE) solver which supports extended states and channelbased iteration stop conditions. 
GoStats
GoStats is an Open Source GoLang library for math statistics mostly used in Machine Learning domains, it covers most of the Statistical measures functions. 
mudlarkgo
A collection of packages providing (hopefully) useful code for use in software using Google's Go programming language. 
calendarheatmap
Calendar heatmap in plain Go inspired by Github contribution activity.
Do you think we are missing an alternative of piecewiselinear or a related project?
Popular Comparisons
README
piecewiselinear
A tiny library for linear interpolation. O(log(N))
per evaluation for N
control points.
import "github.com/sgreben/piecewiselinear"
Get it
go get u "github.com/sgreben/piecewiselinear"
Use it
import "github.com/sgreben/piecewiselinear"
func main() {
f := piecewiselinear.Function{Y:[]float64{0,1,0}} // range: "hat" function
f.X = piecewiselinear.Span(0, 1, len(f.Y)) // domain: equidistant points along X axis
fmt.Println(
f.At(0), // f.At(x) evaluates f at x
f.At(0.25),
f.At(0.5),
f.At(0.75),
f.At(1.0),
f.At(123.0), // outside its domain X the function is constant 0
f.At(123.0), //
)
// Output:
// 0 0.5 1 0.5 0 0 0
}