Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 4f39a51

Browse files
committed
cgo: add Dsterf
1 parent 16f0589 commit 4f39a51

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

cgo/lapack.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,35 @@ func (impl Implementation) Dpocon(uplo blas.Uplo, n int, a []float64, lda int, a
17661766
return rcond[0]
17671767
}
17681768

1769+
// Dsterf computes all eigenvalues of a symmetric tridiagonal matrix using the
1770+
// Pal-Walker-Kahan variant of the QL or QR algorithm.
1771+
//
1772+
// d contains the diagonal elements of the tridiagonal matrix on entry, and
1773+
// contains the eigenvalues in ascending order on exit. d must have length at
1774+
// least n, or Dsterf will panic.
1775+
//
1776+
// e contains the off-diagonal elements of the tridiagonal matrix on entry, and is
1777+
// overwritten during the call to Dsterf. e must have length of at least n-1 or
1778+
// Dsterf will panic.
1779+
//
1780+
// Dsterf is an internal routine. It is exported for testing purposes.
1781+
func (impl Implementation) Dsterf(n int, d, e []float64) (ok bool) {
1782+
if n < 0 {
1783+
panic(nLT0)
1784+
}
1785+
if n == 0 {
1786+
return true
1787+
}
1788+
if len(d) < n {
1789+
panic(badD)
1790+
}
1791+
if len(e) < n-1 {
1792+
panic(badE)
1793+
}
1794+
1795+
return lapacke.Dsterf(n, d, e)
1796+
}
1797+
17691798
// Dsyev computes all eigenvalues and, optionally, the eigenvectors of a real
17701799
// symmetric matrix A.
17711800
//

cgo/lapack_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ func TestDpocon(t *testing.T) {
230230
testlapack.DpoconTest(t, impl)
231231
}
232232

233+
func TestDsterf(t *testing.T) {
234+
testlapack.DsterfTest(t, impl)
235+
}
236+
233237
func TestDsyev(t *testing.T) {
234238
testlapack.DsyevTest(t, impl)
235239
}

0 commit comments

Comments
 (0)