1 // Copyright ©2015 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
10 "golang.org/x/exp/rand"
13 type Dgebd2er interface {
14 Dgebd2(m, n int, a []float64, lda int, d, e, tauq, taup, work []float64)
17 func Dgebd2Test(t *testing.T, impl Dgebd2er) {
18 rnd := rand.New(rand.NewSource(1))
19 for _, test := range []struct {
33 nb := min(m, n) // 'nb' name parallel with Dlabrd code.
34 a := make([]float64, m*lda)
36 a[i] = rnd.NormFloat64()
42 work := nanSlice(max(m, n))
43 aCopy := make([]float64, len(a))
45 impl.Dgebd2(m, n, a, lda, d, e, tauQ, tauP, work)
46 if m >= n && nb == n {
53 checkBidiagonal(t, m, n, nb, a, lda, d, e, tauP, tauQ, aCopy)