numMethods

package
v0.0.0-...-51e5f1b Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: BSD-3-Clause Imports: 1 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllNumericMethodsHaveBeenFailed = error(allNumericMethodsHaveBeenFailed)
View Source
var FunctionHasNoSolutionInIntervalErr = error(functionHasNoSolutionInInterval)
View Source
var FunctionValueIsNanOrInfinityErr = error(functionValueIsNanOrInfinity)
View Source
var FunctionsDeltaIsZeroErr = error(functionsDeltaIsZero)

Functions

This section is empty.

Types

type INumericFunc

type INumericFunc interface {
	ApplyTo(arg float64) float64
}

type to represent a function

type IResult

type IResult interface {
	Value() float64
	IsSolution() bool
	Error() *NumericMethodError
}

func ErrorFound

func ErrorFound(err *NumericMethodError) IResult

func NoSolutionFound

func NoSolutionFound() IResult

func SolutionFound

func SolutionFound(res float64) IResult

type NumFunc

type NumFunc func(arg float64) float64

Default implementation

func (NumFunc) ApplyTo

func (f NumFunc) ApplyTo(arg float64) float64

type NumericMethod

type NumericMethod interface {
	Calculate(F INumericFunc, methodParams *Params) IResult
}

type to represent a numeric method

type NumericMethodError

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

func (*NumericMethodError) Error

func (e *NumericMethodError) Error() string

type NumericMethodUsingDerivative

type NumericMethodUsingDerivative interface {
	Calculate(F INumericFunc, derivativeF INumericFunc, methodParams *Params) IResult
}

type to represent a numeric method using derivative of function

type NumericMethodUsingSecondDerivative

type NumericMethodUsingSecondDerivative interface {
	Calculate(F INumericFunc, derivativeF INumericFunc, secondDerivativeF INumericFunc, methodParams *Params) IResult
}

type to a numeric method using second derivative of function

type NumericResultType

type NumericResultType int

type to represent status of calculations

const (
	NumericResultType_HasSolution NumericResultType = 1 + iota
	NumericResultType_NoSolution
)

type Params

type Params struct {
	// max count of method iterations
	MaxIterationsCount uint64
	// acceptable calculation error
	Epsilon float64
}

parameters of numeric methods

Jump to

Keyboard shortcuts

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