mirror of
https://github.com/gonum/gonum.git
synced 2025-10-04 23:02:42 +08:00
lapack/{gonum,testlapack}: apply semgrep-go suggestions (#1743)
This commit is contained in:

committed by
GitHub

parent
27ed1a9eeb
commit
030e69b6a7
@@ -174,12 +174,12 @@ func (impl Implementation) Dtrexc(compq lapack.UpdateSchurComp, n int, t []float
|
||||
here := ifst
|
||||
for here > ilst {
|
||||
// Swap block with next one above.
|
||||
nbnext := 1
|
||||
if here >= 2 && t[(here-1)*ldt+here-2] != 0 {
|
||||
nbnext = 2
|
||||
}
|
||||
if nbf == 1 || nbf == 2 {
|
||||
// Current block either 1×1 or 2×2.
|
||||
nbnext := 1
|
||||
if here-2 >= 0 && t[(here-1)*ldt+here-2] != 0 {
|
||||
nbnext = 2
|
||||
}
|
||||
ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-nbnext, nbnext, nbf, work)
|
||||
if !ok {
|
||||
return ifst, here, false
|
||||
@@ -194,10 +194,6 @@ func (impl Implementation) Dtrexc(compq lapack.UpdateSchurComp, n int, t []float
|
||||
|
||||
// Current block consists of two 1×1 blocks each of
|
||||
// which must be swapped individually.
|
||||
nbnext := 1
|
||||
if here-2 >= 0 && t[(here-1)*ldt+here-2] != 0 {
|
||||
nbnext = 2
|
||||
}
|
||||
ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-nbnext, nbnext, 1, work)
|
||||
if !ok {
|
||||
return ifst, here, false
|
||||
|
@@ -175,7 +175,7 @@ func dtrexcTest(t *testing.T, impl Dtrexcer, rnd *rand.Rand, n, ifst, ilst, extr
|
||||
if modMin <= j && j < modMax {
|
||||
continue
|
||||
}
|
||||
if q.Data[i*q.Stride+j]-qCopy.Data[i*qCopy.Stride+j] != 0 {
|
||||
if q.Data[i*q.Stride+j] != qCopy.Data[i*qCopy.Stride+j] {
|
||||
t.Errorf("%v: unexpected modification of Q[%v,%v]", name, i, j)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user