optimize: remove lint found by megacheck
MODIFY
optimize/convex/lp/simplex.go
optimize/convex/lp/simplex.go
@@ -537,7 +537,7 @@ func findInitialBasic(A mat64.Matrix, b []float64) ([]int, *mat64.Dense, []float
// Solve the Phase I linear program.
_, xOpt, newBasic, err := simplex(basicIdxs, c, aNew, b, 1e-10)
if err != nil {
- return nil, nil, nil, errors.New(fmt.Sprintf("lp: error finding feasible basis: %s", err))
+ return nil, nil, nil, fmt.Errorf("lp: error finding feasible basis: %s", err)
}
// The original LP is infeasible if the added variable has non-zero value

MODIFY
optimize/global.go
optimize/global.go
@@ -156,7 +156,6 @@ type globalStatus struct {
startTime time.Time
optLoc *Location
settings *Settings
- method GlobalMethod
statuser Statuser
err error
}

MODIFY
optimize/minimize.go
optimize/minimize.go
@@ -50,7 +50,7 @@ func copyLocation(dst, src *Location) {
func checkOptimization(p Problem, dim int, method Needser, recorder Recorder) error {
if p.Func == nil {
- panic("optimize: objective function is undefined")
+ panic(badProblem)
}
if dim <= 0 {
panic("optimize: impossible problem dimension")

MODIFY
optimize/unconstrained_test.go
optimize/unconstrained_test.go
@@ -998,7 +998,7 @@ func TestLocal(t *testing.T) {
// Mix of functions with and without Grad method.
tests = append(tests, gradFreeTests...)
tests = append(tests, gradientDescentTests...)
- testLocal(t, gradientDescentTests, nil)
+ testLocal(t, tests, nil)
}
func TestNelderMead(t *testing.T) {

optimize: remove lint found by megacheck