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