Skip to content

Commit

Permalink
lapack/netlib: add Dpotrs
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-ch committed Aug 16, 2018
1 parent 01b9644 commit ebcc3d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lapack/netlib/lapack.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,23 @@ func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok
return lapacke.Dpotrf(ul, n, a, lda)
}

// Dpotrs solves a system of n linear equations A*X = B where A is an n×n
// symmetric positive definite matrix and B is an n×nrhs matrix. The matrix A is
// represented by its Cholesky factorization
// A = U^T*U if uplo == blas.Upper
// A = L*L^T if uplo == blas.Lower
// as computed by Dpotrf. On entry, B contains the right-hand side matrix B, on
// return it contains the solution matrix X.
func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) {
if uplo != blas.Upper && uplo != blas.Lower {
panic(badUplo)
}
checkMatrix(n, n, a, lda)
checkMatrix(n, nrhs, b, ldb)

lapacke.Dpotrs(uplo, n, nrhs, a, lda, b, ldb)
}

// Dgebal balances an n×n matrix A. Balancing consists of two stages, permuting
// and scaling. Both steps are optional and depend on the value of job.
//
Expand Down
4 changes: 4 additions & 0 deletions lapack/netlib/lapack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func TestDpotrf(t *testing.T) {
testlapack.DpotrfTest(t, impl)
}

func TestDpotrs(t *testing.T) {
testlapack.DpotrsTest(t, impl)
}

func TestDgebak(t *testing.T) {
testlapack.DgebakTest(t, impl)
}
Expand Down

0 comments on commit ebcc3d2

Please sign in to comment.