1 // Copyright ©2016 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
9 // Iparmq returns problem and machine dependent parameters useful for Dhseqr and
10 // related subroutines for eigenvalue problems.
12 // ispec specifies the parameter to return:
13 // 12: Crossover point between Dlahqr and Dlaqr0. Will be at least 11.
14 // 13: Deflation window size.
15 // 14: Nibble crossover point. Determines when to skip a multi-shift QR sweep.
16 // 15: Number of simultaneous shifts in a multishift QR iteration.
17 // 16: Select structured matrix multiply.
18 // For other values of ispec Iparmq will panic.
20 // name is the name of the calling function. name must be in uppercase but this
23 // opts is not used and exists for future use.
25 // n is the order of the Hessenberg matrix H.
27 // ilo and ihi specify the block [ilo:ihi+1,ilo:ihi+1] that is being processed.
29 // lwork is the amount of workspace available.
31 // Except for ispec input parameters are not checked.
33 // Iparmq is an internal routine. It is exported for testing purposes.
34 func (Implementation) Iparmq(ispec int, name, opts string, n, ilo, ihi, lwork int) int {
43 ns = max(10, nh/int(math.Log(float64(nh))/math.Ln2))
51 ns = max(2, ns-(ns%2))
55 panic("lapack: bad ispec")
58 // Matrices of order smaller than nmin get sent to Dlahqr, the
59 // classic double shift algorithm. This must be at least 11.
71 // Skip a computationally expensive multi-shift QR sweep with
72 // Dlaqr5 whenever aggressive early deflation finds at least
73 // nibble*(window size)/100 deflations. The default, small,
74 // value reflects the expectation that the cost of looking
75 // through the deflation window with Dlaqr3 will be
76 // substantially smaller.
85 panic("lapack: bad name")
93 case name[1:] == "GGHRD" || name[1:] == "GGHD3":
98 case name[3:] == "EXC":
105 case name[1:] == "HSEQR" || name[1:5] == "LAQR":