all: run gofmt and generate all packages

Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.

[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card

git checkout -- dsp/fourier/internal/fftpack
This commit is contained in:
Dan Kortschak
2022-08-05 20:57:59 +09:30
parent fee5019b48
commit 5f0141ca4c
308 changed files with 5004 additions and 3064 deletions

View File

@@ -31,19 +31,22 @@ const (
// falsePosition uses a combination of bisection and false position to find a
// root of a function within a given interval. This is guaranteed to converge,
// and always keeps a bounding interval, unlike Newton's method. Inputs are:
// x1, x2: initial bounding interval
// f1, f2: value of f() at x1 and x2
// absErr, relErr: absolute and relative errors on the bounding interval
// bisectTil: if > 0.0, perform bisection until the width of the bounding
// interval is less than this
// f, fExtra: function to find root of is f(x, fExtra)
//
// x1, x2: initial bounding interval
// f1, f2: value of f() at x1 and x2
// absErr, relErr: absolute and relative errors on the bounding interval
// bisectTil: if > 0.0, perform bisection until the width of the bounding
// interval is less than this
// f, fExtra: function to find root of is f(x, fExtra)
//
// Returns:
// result: whether an exact root was found, the process converged to a
// bounding interval small than the required error, or the max number
// of iterations was hit
// bestX: best root approximation
// bestF: function value at bestX
// errEst: error estimation
//
// result: whether an exact root was found, the process converged to a
// bounding interval small than the required error, or the max number
// of iterations was hit
// bestX: best root approximation
// bestF: function value at bestX
// errEst: error estimation
func falsePosition(x1, x2, f1, f2, absErr, relErr, bisectTil float64, f objectiveFunc, fExtra []float64) (fSolveResult, float64, float64, float64) {
// The false position steps are either unmodified, or modified with the
// Anderson-Bjorck method as appropriate. Theoretically, this has a "speed of