mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 15:16:59 +08:00
testlapack: quieten vet for unkeyed composite literals in importable code
This commit is contained in:

committed by
Dan Kortschak

parent
26c60db8b2
commit
3f94af49e6
@@ -73,14 +73,14 @@ func testDgebak(t *testing.T, impl Dgebaker, job lapack.BalanceJob, side lapack.
|
||||
for i := n - 1; i > ihi; i-- {
|
||||
scale[i] = float64(rnd.Intn(i + 1))
|
||||
blas64.Swap(n,
|
||||
blas64.Vector{p.Data[i:], p.Stride},
|
||||
blas64.Vector{p.Data[int(scale[i]):], p.Stride})
|
||||
blas64.Vector{Data: p.Data[i:], Inc: p.Stride},
|
||||
blas64.Vector{Data: p.Data[int(scale[i]):], Inc: p.Stride})
|
||||
}
|
||||
for i := 0; i < ilo; i++ {
|
||||
scale[i] = float64(i + rnd.Intn(ihi-i+1))
|
||||
blas64.Swap(n,
|
||||
blas64.Vector{p.Data[i:], p.Stride},
|
||||
blas64.Vector{p.Data[int(scale[i]):], p.Stride})
|
||||
blas64.Vector{Data: p.Data[i:], Inc: p.Stride},
|
||||
blas64.Vector{Data: p.Data[int(scale[i]):], Inc: p.Stride})
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -92,12 +92,12 @@ func testDgebal(t *testing.T, impl Dgebaler, job lapack.BalanceJob, a blas64.Gen
|
||||
t.Errorf("%v: invalid ordering of ilo=%v and ihi=%v", prefix, ilo, ihi)
|
||||
}
|
||||
|
||||
if ilo >= 2 && !isUpperTriangular(blas64.General{ilo - 1, ilo - 1, a.Data, a.Stride}) {
|
||||
if ilo >= 2 && !isUpperTriangular(blas64.General{Rows: ilo - 1, Cols: ilo - 1, Data: a.Data, Stride: a.Stride}) {
|
||||
t.Errorf("%v: T1 is not upper triangular", prefix)
|
||||
}
|
||||
m := n - ihi - 1 // Order of T2.
|
||||
k := ihi + 1
|
||||
if m >= 2 && !isUpperTriangular(blas64.General{m, m, a.Data[k*a.Stride+k:], a.Stride}) {
|
||||
if m >= 2 && !isUpperTriangular(blas64.General{Rows: m, Cols: m, Data: a.Data[k*a.Stride+k:], Stride: a.Stride}) {
|
||||
t.Errorf("%v: T2 is not upper triangular", prefix)
|
||||
}
|
||||
|
||||
@@ -145,13 +145,13 @@ func testDgebal(t *testing.T, impl Dgebaler, job lapack.BalanceJob, a blas64.Gen
|
||||
p := eye(n, n)
|
||||
for j := n - 1; j > ihi; j-- {
|
||||
blas64.Swap(n,
|
||||
blas64.Vector{p.Data[j:], p.Stride},
|
||||
blas64.Vector{p.Data[int(scale[j]):], p.Stride})
|
||||
blas64.Vector{Data: p.Data[j:], Inc: p.Stride},
|
||||
blas64.Vector{Data: p.Data[int(scale[j]):], Inc: p.Stride})
|
||||
}
|
||||
for j := 0; j < ilo; j++ {
|
||||
blas64.Swap(n,
|
||||
blas64.Vector{p.Data[j:], p.Stride},
|
||||
blas64.Vector{p.Data[int(scale[j]):], p.Stride})
|
||||
blas64.Vector{Data: p.Data[j:], Inc: p.Stride},
|
||||
blas64.Vector{Data: p.Data[int(scale[j]):], Inc: p.Stride})
|
||||
}
|
||||
// Compute P^T*A*P and store into want.
|
||||
ap := zeros(n, n, n)
|
||||
|
@@ -55,10 +55,10 @@ func Dlacn2Test(t *testing.T, impl Dlacn2er) {
|
||||
case 0:
|
||||
break loop
|
||||
case 1:
|
||||
blas64.Gemv(blas.NoTrans, 1, a, blas64.Vector{x, 1}, 0, blas64.Vector{work, 1})
|
||||
blas64.Gemv(blas.NoTrans, 1, a, blas64.Vector{Data: x, Inc: 1}, 0, blas64.Vector{Data: work, Inc: 1})
|
||||
copy(x, work)
|
||||
case 2:
|
||||
blas64.Gemv(blas.Trans, 1, a, blas64.Vector{x, 1}, 0, blas64.Vector{work, 1})
|
||||
blas64.Gemv(blas.Trans, 1, a, blas64.Vector{Data: x, Inc: 1}, 0, blas64.Vector{Data: work, Inc: 1})
|
||||
copy(x, work)
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ func Dorg2lTest(t *testing.T, impl Dorg2ler) {
|
||||
impl.Dgeql2(m, n, a, lda, tau, work)
|
||||
|
||||
impl.Dorg2l(m, n, k, a, lda, tau[n-k:], work)
|
||||
if !hasOrthonormalColumns(blas64.General{m, n, a, lda}) {
|
||||
if !hasOrthonormalColumns(blas64.General{Rows: m, Cols: n, Data: a, Stride: lda}) {
|
||||
t.Errorf("Case m=%v, n=%v, k=%v: columns of Q not orthonormal", m, n, k)
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ func DorgqlTest(t *testing.T, impl Dorgqler) {
|
||||
h := eye(m, m)
|
||||
jj := m - k + l
|
||||
j := n - k + l
|
||||
v := blas64.Vector{make([]float64, m), 1}
|
||||
v := blas64.Vector{Data: make([]float64, m), Inc: 1}
|
||||
for i := 0; i < jj; i++ {
|
||||
v.Data[i] = a.Data[i*a.Stride+j]
|
||||
}
|
||||
|
@@ -1290,7 +1290,7 @@ func isRightEigenvectorOf(a blas64.General, xRe, xIm []float64, lambda complex12
|
||||
|
||||
// Compute A real(x) and store the result into xReAns.
|
||||
xReAns := make([]float64, n)
|
||||
blas64.Gemv(blas.NoTrans, 1, a, blas64.Vector{xRe, 1}, 0, blas64.Vector{xReAns, 1})
|
||||
blas64.Gemv(blas.NoTrans, 1, a, blas64.Vector{Data: xRe, Inc: 1}, 0, blas64.Vector{Data: xReAns, Inc: 1})
|
||||
|
||||
if imag(lambda) == 0 && xIm == nil {
|
||||
// Real eigenvalue and eigenvector.
|
||||
@@ -1308,7 +1308,7 @@ func isRightEigenvectorOf(a blas64.General, xRe, xIm []float64, lambda complex12
|
||||
|
||||
// Compute A imag(x) and store the result into xImAns.
|
||||
xImAns := make([]float64, n)
|
||||
blas64.Gemv(blas.NoTrans, 1, a, blas64.Vector{xIm, 1}, 0, blas64.Vector{xImAns, 1})
|
||||
blas64.Gemv(blas.NoTrans, 1, a, blas64.Vector{Data: xIm, Inc: 1}, 0, blas64.Vector{Data: xImAns, Inc: 1})
|
||||
|
||||
// Compute λx and store the result into lambdax.
|
||||
lambdax := make([]complex128, n)
|
||||
@@ -1349,7 +1349,7 @@ func isLeftEigenvectorOf(a blas64.General, yRe, yIm []float64, lambda complex128
|
||||
|
||||
// Compute A^T real(y) and store the result into yReAns.
|
||||
yReAns := make([]float64, n)
|
||||
blas64.Gemv(blas.Trans, 1, a, blas64.Vector{yRe, 1}, 0, blas64.Vector{yReAns, 1})
|
||||
blas64.Gemv(blas.Trans, 1, a, blas64.Vector{Data: yRe, Inc: 1}, 0, blas64.Vector{Data: yReAns, Inc: 1})
|
||||
|
||||
if imag(lambda) == 0 && yIm == nil {
|
||||
// Real eigenvalue and eigenvector.
|
||||
@@ -1367,7 +1367,7 @@ func isLeftEigenvectorOf(a blas64.General, yRe, yIm []float64, lambda complex128
|
||||
|
||||
// Compute A^T imag(y) and store the result into yImAns.
|
||||
yImAns := make([]float64, n)
|
||||
blas64.Gemv(blas.Trans, 1, a, blas64.Vector{yIm, 1}, 0, blas64.Vector{yImAns, 1})
|
||||
blas64.Gemv(blas.Trans, 1, a, blas64.Vector{Data: yIm, Inc: 1}, 0, blas64.Vector{Data: yImAns, Inc: 1})
|
||||
|
||||
// Compute conj(λ)y and store the result into lambday.
|
||||
lambda = cmplx.Conj(lambda)
|
||||
|
@@ -716,7 +716,7 @@ func applyReflector(qh blas64.General, q blas64.General, v []float64) {
|
||||
panic("bad size of q")
|
||||
}
|
||||
qv := make([]float64, n)
|
||||
blas64.Gemv(blas.NoTrans, 1, q, blas64.Vector{v, 1}, 0, blas64.Vector{qv, 1})
|
||||
blas64.Gemv(blas.NoTrans, 1, q, blas64.Vector{Data: v, Inc: 1}, 0, blas64.Vector{Data: qv, Inc: 1})
|
||||
for i := 0; i < n; i++ {
|
||||
for j := 0; j < n; j++ {
|
||||
qh.Data[i*qh.Stride+j] = q.Data[i*q.Stride+j]
|
||||
|
Reference in New Issue
Block a user