tabulatedfunction

package module
v0.0.0-...-8bfe20a Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 5 Imported by: 0

README

Implements tabulated function. Based on https://github.com/bravesoftdz/Table-func-lib

Documentation

Index

Constants

View Source
const (
	Precision = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dump

type Dump struct {
	Order  int       `json:"order"`
	Points []TFPoint `json:"points"`
}

Dump is a serializable representation of a TabulatedFunction.

type TFPoint

type TFPoint struct {
	X, Y *big.Float
	// contains filtered or unexported fields
}

type TabulatedFunction

type TabulatedFunction struct {

	//
	P []TFPoint
	// contains filtered or unexported fields
}

func New

func New() *TabulatedFunction

Create

func (*TabulatedFunction) AddPoint

func (f *TabulatedFunction) AddPoint(Xn, Yn *big.Float, epoch uint32) *big.Float

func (*TabulatedFunction) Assign

func (f *TabulatedFunction) Assign(s *TabulatedFunction)

func (*TabulatedFunction) Clear

func (f *TabulatedFunction) Clear()

func (*TabulatedFunction) Derivative

func (f *TabulatedFunction) Derivative()

func (*TabulatedFunction) DrawPS

func (f *TabulatedFunction) DrawPS(path string) error

func (*TabulatedFunction) Dump

func (f *TabulatedFunction) Dump() *Dump

Dump generates a serializable dump for a tabulated function.

func (*TabulatedFunction) Epoch

func (f *TabulatedFunction) Epoch(epoch uint32)

func (*TabulatedFunction) F

func (f *TabulatedFunction) F(xi *big.Float) *big.Float

splinevalue

func (*TabulatedFunction) FromDump

func (f *TabulatedFunction) FromDump(d *Dump)

FromDump restores a tabulated function from a dump. It ensures the points are sorted by X before updating the spline.

func (*TabulatedFunction) GetNdots

func (f *TabulatedFunction) GetNdots() int

func (*TabulatedFunction) GetStep

func (f *TabulatedFunction) GetStep() *big.Float

func (*TabulatedFunction) GetXmax

func (f *TabulatedFunction) GetXmax() *big.Float

func (*TabulatedFunction) GetXmin

func (f *TabulatedFunction) GetXmin() *big.Float

func (*TabulatedFunction) GetYmax

func (f *TabulatedFunction) GetYmax() *big.Float

func (*TabulatedFunction) GetYmin

func (f *TabulatedFunction) GetYmin() *big.Float

func (*TabulatedFunction) Integral

func (f *TabulatedFunction) Integral()

func (*TabulatedFunction) Integrate

func (f *TabulatedFunction) Integrate() *big.Float

func (*TabulatedFunction) LoadConstant

func (f *TabulatedFunction) LoadConstant(new_Y, new_xmin, new_xmax *big.Float)

func (*TabulatedFunction) MarshalJSON

func (f *TabulatedFunction) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for TabulatedFunction.

func (*TabulatedFunction) Merge

func (f *TabulatedFunction) Merge(m *TabulatedFunction)

func (*TabulatedFunction) MorePoints

func (f *TabulatedFunction) MorePoints()

func (*TabulatedFunction) Multiply

func (f *TabulatedFunction) Multiply(by *TabulatedFunction)

func (*TabulatedFunction) MultiplyByScalar

func (f *TabulatedFunction) MultiplyByScalar(by *big.Float)

func (*TabulatedFunction) Normalise

func (f *TabulatedFunction) Normalise()

func (*TabulatedFunction) SetOrder

func (f *TabulatedFunction) SetOrder(new_value int)

func (*TabulatedFunction) SetTrapolation

func (f *TabulatedFunction) SetTrapolation(new_value Trapolation)

func (*TabulatedFunction) Smooth

func (f *TabulatedFunction) Smooth()

func (*TabulatedFunction) String

func (f *TabulatedFunction) String() string

func (*TabulatedFunction) Trapolate

func (f *TabulatedFunction) Trapolate(xi *big.Float, trapolation Trapolation) *big.Float

func (*TabulatedFunction) UnmarshalJSON

func (f *TabulatedFunction) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TabulatedFunction.

type Trapolation

type Trapolation int
const (
	TrapolationLinear   Trapolation = 0
	TrapolationSpline   Trapolation = 1
	TrapolationShift    Trapolation = 2
	TrapolationMinMax   Trapolation = 3
	TrapolationOpposite Trapolation = 4
)

Jump to

Keyboard shortcuts

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