native: implement dlaqp2 and test
MODIFY
cgo/lapack.go
cgo/lapack.go
@@ -16,6 +16,7 @@ import (
// Copied from lapack/native. Keep in sync.
const (
absIncNotOne = "lapack: increment not one or negative one"
+ badAuxv = "lapack: auxv has insufficient length"
badD = "lapack: d has insufficient length"
badDecompUpdate = "lapack: bad decomp update"
badDiag = "lapack: bad diag"
@@ -34,6 +35,7 @@ const (
badK2 = "lapack: k2 out of range"
badKperm = "lapack: incorrect permutation length"
badLdA = "lapack: index of a out of range"
+ badNb = "lapack: nb out of range"
badNorm = "lapack: bad norm"
badPivot = "lapack: bad pivot"
badS = "lapack: s has insufficient length"
@@ -46,6 +48,8 @@ const (
badTauQ = "lapack: tauQ has insufficient length"
badTauP = "lapack: tauP has insufficient length"
badTrans = "lapack: bad trans"
+ badVn1 = "lapack: vn1 has insufficient length"
+ badVn2 = "lapack: vn2 has insufficient length"
badUplo = "lapack: illegal triangle"
badWork = "lapack: insufficient working memory"
badWorkStride = "lapack: insufficient working array stride"
@@ -60,6 +64,7 @@ const (
negZ = "lapack: negative z value"
nLT0 = "lapack: n < 0"
nLTM = "lapack: n < m"
+ offsetGTM = "lapack: offset > m"
shortWork = "lapack: working array shorter than declared"
zeroDiv = "lapack: zero divisor"
)

MODIFY
native/general.go
native/general.go
@@ -20,6 +20,7 @@ var _ lapack.Float64 = Implementation{}
// This list is duplicated in lapack/cgo. Keep in sync.
const (
absIncNotOne = "lapack: increment not one or negative one"
+ badAuxv = "lapack: auxv has insufficient length"
badD = "lapack: d has insufficient length"
badDecompUpdate = "lapack: bad decomp update"
badDiag = "lapack: bad diag"
@@ -38,6 +39,7 @@ const (
badK2 = "lapack: k2 out of range"
badKperm = "lapack: incorrect permutation length"
badLdA = "lapack: index of a out of range"
+ badNb = "lapack: nb out of range"
badNorm = "lapack: bad norm"
badPivot = "lapack: bad pivot"
badS = "lapack: s has insufficient length"
@@ -50,6 +52,8 @@ const (
badTauQ = "lapack: tauQ has insufficient length"
badTauP = "lapack: tauP has insufficient length"
badTrans = "lapack: bad trans"
+ badVn1 = "lapack: vn1 has insufficient length"
+ badVn2 = "lapack: vn2 has insufficient length"
badUplo = "lapack: illegal triangle"
badWork = "lapack: insufficient working memory"
badWorkStride = "lapack: insufficient working array stride"
@@ -64,6 +68,7 @@ const (
negZ = "lapack: negative z value"
nLT0 = "lapack: n < 0"
nLTM = "lapack: n < m"
+ offsetGTM = "lapack: offset > m"
shortWork = "lapack: working array shorter than declared"
zeroDiv = "lapack: zero divisor"
)

MODIFY
native/lapack_test.go
native/lapack_test.go
@@ -192,6 +192,10 @@ func TestDlaqr04(t *testing.T) {
testlapack.Dlaqr04Test(t, impl)
}
+func TestDlaqp2(t *testing.T) {
+ testlapack.Dlaqp2Test(t, impl)
+}
+
func TestDlaqr1(t *testing.T) {
testlapack.Dlaqr1Test(t, impl)
}

MODIFY
testlapack/general.go
testlapack/general.go
@@ -262,6 +262,16 @@ func transposeGeneral(a blas64.General) blas64.General {
return ans
}
+// columnNorms returns the column norms of a.
+func columnNorms(m, n int, a []float64, lda int) []float64 {
+ bi := blas64.Implementation()
+ norms := make([]float64, n)
+ for j := 0; j < n; j++ {
+ norms[j] = bi.Dnrm2(m, a[j:], lda)
+ }
+ return norms
+}
+
// extractVMat collects the single reflectors from a into a matrix.
func extractVMat(m, n int, a []float64, lda int, direct lapack.Direct, store lapack.StoreV) blas64.General {
k := min(m, n)

native: implement dlaqp2 and test