mat: clean up lint

This commit is contained in:
Dan Kortschak
2019-11-02 14:17:29 +10:30
parent ad7fbd52c6
commit 455f782e4c
10 changed files with 93 additions and 40 deletions

View File

@@ -214,7 +214,10 @@ func TestSolve(t *testing.T) {
}
}
var x Dense
x.Solve(a, b)
err := x.Solve(a, b)
if err != nil {
t.Errorf("unexpected error from dense solve: %v", err)
}
// Test that the normal equations hold.
// Aᵀ * A * x = Aᵀ * b
@@ -233,10 +236,10 @@ func TestSolve(t *testing.T) {
Solve(a, b Matrix) error
}
rd := receiver.(Solver)
rd.Solve(a, b)
_ = rd.Solve(a, b)
}
denseComparison := func(receiver, a, b *Dense) {
receiver.Solve(a, b)
_ = receiver.Solve(a, b)
}
testTwoInput(t, "Solve", &Dense{}, method, denseComparison, legalTypesAll, legalSizeSolve, 1e-7)
}
@@ -269,7 +272,10 @@ func TestSolveVec(t *testing.T) {
b.SetVec(i, rand.Float64())
}
var x VecDense
x.SolveVec(a, b)
err := x.SolveVec(a, b)
if err != nil {
t.Errorf("unexpected error from dense vector solve: %v", err)
}
// Test that the normal equations hold.
// Aᵀ * A * x = Aᵀ * b
@@ -288,10 +294,10 @@ func TestSolveVec(t *testing.T) {
SolveVec(a Matrix, b Vector) error
}
rd := receiver.(SolveVecer)
rd.SolveVec(a, b.(Vector))
_ = rd.SolveVec(a, b.(Vector))
}
denseComparison := func(receiver, a, b *Dense) {
receiver.Solve(a, b)
_ = receiver.Solve(a, b)
}
testTwoInput(t, "SolveVec", &VecDense{}, method, denseComparison, legalTypesMatrixVector, legalSizeSolve, 1e-12)
}