@@ -838,6 +838,46 @@ func (impl Implementation) Dpbtrf(uplo blas.Uplo, n, kd int, ab []float64, ldab
838
838
return lapacke .Dpbtrf (byte (uplo ), n , kd , ab , ldab )
839
839
}
840
840
841
+ // Dpbtrs solves a system of linear equations A*X = B with an n×n symmetric
842
+ // positive definite band matrix A using the Cholesky factorization
843
+ // A = U^T * U if uplo == blas.Upper
844
+ // A = L * L^T if uplo == blas.Lower
845
+ // computed by Dpbtrf. kd is the number of super- or sub-diagonals of A. See the
846
+ // documentation for Dpbtrf for a description of the band storage format of A.
847
+ //
848
+ // On entry, b contains the n×nrhs right hand side matrix B. On return, it is
849
+ // overwritten with the solution matrix X.
850
+ func (Implementation ) Dpbtrs (uplo blas.Uplo , n , kd , nrhs int , ab []float64 , ldab int , b []float64 , ldb int ) {
851
+ switch {
852
+ case uplo != blas .Upper && uplo != blas .Lower :
853
+ panic (badUplo )
854
+ case n < 0 :
855
+ panic (nLT0 )
856
+ case kd < 0 :
857
+ panic (kdLT0 )
858
+ case nrhs < 0 :
859
+ panic (nrhsLT0 )
860
+ case ldab < kd + 1 :
861
+ panic (badLdA )
862
+ case ldb < max (1 , nrhs ):
863
+ panic (badLdB )
864
+ }
865
+
866
+ // Quick return if possible.
867
+ if n == 0 || nrhs == 0 {
868
+ return
869
+ }
870
+
871
+ if len (ab ) < (n - 1 )* ldab + kd {
872
+ panic (shortAB )
873
+ }
874
+ if len (b ) < (n - 1 )* ldb + nrhs {
875
+ panic (shortB )
876
+ }
877
+
878
+ lapacke .Dpbtrs (byte (uplo ), n , kd , nrhs , ab , ldab , b , ldb )
879
+ }
880
+
841
881
// Dpotrf computes the Cholesky decomposition of the symmetric positive definite
842
882
// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix,
843
883
// and a = U U^T is stored in place into a. If ul == blas.Lower, then a = L L^T
0 commit comments