native,testlapack: fix bounding of cleanup
MODIFY
native/dggsvp3.go
native/dggsvp3.go
@@ -260,8 +260,8 @@ func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int,
}
// Clean up A.
- for i := k + 1; i < k+l; i++ {
- r := a[i*lda+n-l : i*lda+i-k+n-l]
+ for i := k + 1; i < m; i++ {
+ r := a[i*lda+n-l : i*lda+min(n-l+i-k, n)]
for j := range r {
r[j] = 0
}

MODIFY
testlapack/dggsvd3.go
testlapack/dggsvd3.go
@@ -25,6 +25,7 @@ func Dggsvd3Test(t *testing.T, impl Dggsvd3er) {
ok bool
}{
+ {m: 3, p: 3, n: 5, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0, ok: true},
{m: 5, p: 5, n: 5, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0, ok: true},
{m: 5, p: 5, n: 5, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0, ok: true},
{m: 5, p: 5, n: 10, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0, ok: true},

MODIFY
testlapack/dggsvp3.go
testlapack/dggsvp3.go
@@ -23,6 +23,7 @@ func Dggsvp3Test(t *testing.T, impl Dggsvp3er) {
for cas, test := range []struct {
m, p, n, lda, ldb, ldu, ldv, ldq int
}{
+ {m: 3, p: 3, n: 5, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0},
{m: 5, p: 5, n: 5, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0},
{m: 5, p: 5, n: 5, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0},
{m: 5, p: 5, n: 10, lda: 0, ldb: 0, ldu: 0, ldv: 0, ldq: 0},

native,testlapack: fix bounding of cleanup