@@ -794,6 +794,54 @@ func (impl Implementation) Dlaswp(n int, a []float64, lda, k1, k2 int, ipiv []in
794
794
lapacke .Dlaswp (n , a , lda , k1 + 1 , k2 + 1 , ipiv32 , incX )
795
795
}
796
796
797
+ // Dpbcon returns an estimate of the reciprocal of the condition number (in the
798
+ // 1-norm) of an n×n symmetric positive definite band matrix using the Cholesky
799
+ // factorization
800
+ // A = Uᵀ*U if uplo == blas.Upper
801
+ // A = L*Lᵀ if uplo == blas.Lower
802
+ // computed by Dpbtrf. The estimate is obtained for norm(inv(A)), and the
803
+ // reciprocal of the condition number is computed as
804
+ // rcond = 1 / (anorm * norm(inv(A))).
805
+ //
806
+ // The length of work must be at least 3*n and the length of iwork must be at
807
+ // least n.
808
+ func (impl Implementation ) Dpbcon (uplo blas.Uplo , n , kd int , ab []float64 , ldab int , anorm float64 , work []float64 , iwork []int ) (rcond float64 ) {
809
+ switch {
810
+ case uplo != blas .Upper && uplo != blas .Lower :
811
+ panic (badUplo )
812
+ case n < 0 :
813
+ panic (nLT0 )
814
+ case kd < 0 :
815
+ panic (kdLT0 )
816
+ case ldab < kd + 1 :
817
+ panic (badLdA )
818
+ case anorm < 0 :
819
+ panic (badNorm )
820
+ }
821
+
822
+ // Quick return if possible.
823
+ if n == 0 {
824
+ return 1
825
+ }
826
+
827
+ switch {
828
+ case len (ab ) < (n - 1 )* ldab + kd + 1 :
829
+ panic (shortAB )
830
+ case len (work ) < 3 * n :
831
+ panic (shortWork )
832
+ case len (iwork ) < n :
833
+ panic (shortIWork )
834
+ }
835
+
836
+ _ldab := n
837
+ _ab := make ([]float64 , (kd + 1 )* _ldab )
838
+ convDpbToLapacke (uplo , n , kd , ab , ldab , _ab , _ldab )
839
+ _rcond := []float64 {0 }
840
+ _iwork := make ([]int32 , n )
841
+ lapacke .Dpbcon (byte (uplo ), n , kd , _ab , _ldab , anorm , _rcond , work , _iwork )
842
+ return _rcond [0 ]
843
+ }
844
+
797
845
// Dpbtrf computes the Cholesky factorization of an n×n symmetric positive
798
846
// definite band matrix
799
847
// A = U^T * U if uplo == blas.Upper
0 commit comments