mirror of
https://github.com/gonum/gonum.git
synced 2025-10-03 06:22:12 +08:00
optimize: remove lint found by megacheck
This commit is contained in:
@@ -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
|
||||
|
@@ -156,7 +156,6 @@ type globalStatus struct {
|
||||
startTime time.Time
|
||||
optLoc *Location
|
||||
settings *Settings
|
||||
method GlobalMethod
|
||||
statuser Statuser
|
||||
err error
|
||||
}
|
||||
|
@@ -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")
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user