mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 15:16:59 +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.
|
// Solve the Phase I linear program.
|
||||||
_, xOpt, newBasic, err := simplex(basicIdxs, c, aNew, b, 1e-10)
|
_, xOpt, newBasic, err := simplex(basicIdxs, c, aNew, b, 1e-10)
|
||||||
if err != nil {
|
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
|
// The original LP is infeasible if the added variable has non-zero value
|
||||||
|
@@ -156,7 +156,6 @@ type globalStatus struct {
|
|||||||
startTime time.Time
|
startTime time.Time
|
||||||
optLoc *Location
|
optLoc *Location
|
||||||
settings *Settings
|
settings *Settings
|
||||||
method GlobalMethod
|
|
||||||
statuser Statuser
|
statuser Statuser
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,7 @@ func copyLocation(dst, src *Location) {
|
|||||||
|
|
||||||
func checkOptimization(p Problem, dim int, method Needser, recorder Recorder) error {
|
func checkOptimization(p Problem, dim int, method Needser, recorder Recorder) error {
|
||||||
if p.Func == nil {
|
if p.Func == nil {
|
||||||
panic("optimize: objective function is undefined")
|
panic(badProblem)
|
||||||
}
|
}
|
||||||
if dim <= 0 {
|
if dim <= 0 {
|
||||||
panic("optimize: impossible problem dimension")
|
panic("optimize: impossible problem dimension")
|
||||||
|
@@ -998,7 +998,7 @@ func TestLocal(t *testing.T) {
|
|||||||
// Mix of functions with and without Grad method.
|
// Mix of functions with and without Grad method.
|
||||||
tests = append(tests, gradFreeTests...)
|
tests = append(tests, gradFreeTests...)
|
||||||
tests = append(tests, gradientDescentTests...)
|
tests = append(tests, gradientDescentTests...)
|
||||||
testLocal(t, gradientDescentTests, nil)
|
testLocal(t, tests, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNelderMead(t *testing.T) {
|
func TestNelderMead(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user