@@ -43,20 +43,21 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl
43
43
if k == 0 {
44
44
return
45
45
}
46
- nbmin := 2 // Minimal number of blocks
46
+ nbmin := 2 // Minimal block size.
47
47
var nx int // Use unblocked (unless changed in the next for loop)
48
48
iws := n
49
49
ldwork := nb
50
- // Only consider blocked if the suggested number of blocks is > 1 and the
51
- // number of columns is sufficiently large.
52
- if nb > 1 && k > nb {
53
- // nx is the crossover point. Above this value the blocked routine should be used.
50
+ // Only consider blocked if the suggested block size is > 1 and the
51
+ // number of rows or columns is sufficiently large.
52
+ if 1 < nb && nb < k {
53
+ // nx is the block size at which the code switches from blocked
54
+ // to unblocked.
54
55
nx = max (0 , impl .Ilaenv (3 , "DGEQRF" , " " , m , n , - 1 , - 1 ))
55
56
if k > nx {
56
57
iws = ldwork * n
57
58
if lwork < iws {
58
- // Not enough workspace to use the optimal number of blocks. Instead,
59
- // get the maximum allowable number of blocks .
59
+ // Not enough workspace to use the optimal block
60
+ // size. Get the minimum block size instead .
60
61
nb = lwork / n
61
62
nbmin = max (2 , impl .Ilaenv (2 , "DGEQRF" , " " , m , n , - 1 , - 1 ))
62
63
}
@@ -67,7 +68,7 @@ func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []fl
67
68
}
68
69
// Compute QR using a blocked algorithm.
69
70
var i int
70
- if nb >= nbmin && nb < k && nx < k {
71
+ if nbmin <= nb && nb < k && nx < k {
71
72
for i = 0 ; i < k - nx ; i += nb {
72
73
ib := min (k - i , nb )
73
74
// Compute the QR factorization of the current block.
0 commit comments