minimax

package
v0.0.0-...-d1350ed Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	RelError: true,
	Pin:      false,
	OrderN:   6,
	OrderD:   0,

	WorkingPercision: 128,
	Brake:            50,
}

Functions

func Run

func Run(fn Fn) (tools.Poly, tools.Poly)

Types

type Config

type Config struct {
	// A        float64
	// B        float64
	Ranges   [][3]float64
	RangeLen float64
	RelError bool
	Pin      bool
	OrderN   int
	OrderD   int
	// TargetPrecision  uint
	WorkingPercision uint
	// Variant          int //函数种类
	Skew  int
	Brake int
}

func AddRange

func AddRange(a, b float64) *Config

func SetPin

func SetPin(pin bool) *Config

func WithOrderN

func WithOrderN(n int) *Config

func (*Config) AddRange

func (c *Config) AddRange(a, b float64) *Config

add range ,a must lower than b

func (*Config) Iter

func (c *Config) Iter(i int) int

func (*Config) MaxOrder

func (c *Config) MaxOrder() int

func (*Config) OrderNWithPin

func (c *Config) OrderNWithPin() int

func (*Config) Point

func (c *Config) Point(angle float64) float64

func (*Config) Run

func (c *Config) Run(fn Fn) (tools.Poly, tools.Poly)

func (*Config) SetOrderN

func (c *Config) SetOrderN(n int) *Config

func (*Config) SetPin

func (c *Config) SetPin(pin bool) *Config

type Fn

type Fn func(float64) float64

type Minimax

type Minimax struct {
	Fn      Fn
	Err     Fn
	Ex      Fn
	Started bool
	// contains filtered or unexported fields
}

func (*Minimax) Denominator

func (r *Minimax) Denominator() tools.Poly

func (*Minimax) Iter

func (r *Minimax) Iter() float64

func (*Minimax) Numerator

func (r *Minimax) Numerator() tools.Poly

func (*Minimax) Set

func (r *Minimax) Set(cfg *Config, fn Fn)

初始化配置和运行函数

Jump to

Keyboard shortcuts

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