optimize: remove lint found by megacheck

This commit is contained in:
Vladimir Chalupecky
2017-06-01 22:07:40 +02:00
parent 219e585fd1
commit 49d4aa112a
4 changed files with 3 additions and 4 deletions

View File

@@ -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

View File

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

View File

@@ -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")

View File

@@ -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) {