You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dlatb9.f 9.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. *> \brief \b DLATB9
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. * Definition:
  9. * ===========
  10. *
  11. * SUBROUTINE DLATB9( PATH, IMAT, M, P, N, TYPE, KLA, KUA, KLB, KUB,
  12. * ANORM, BNORM, MODEA, MODEB, CNDNMA, CNDNMB,
  13. * DISTA, DISTB )
  14. *
  15. * .. Scalar Arguments ..
  16. * CHARACTER DISTA, DISTB, TYPE
  17. * CHARACTER*3 PATH
  18. * INTEGER IMAT, KLA, KLB, KUA, KUB, M, MODEA, MODEB, N, P
  19. * DOUBLE PRECISION ANORM, BNORM, CNDNMA, CNDNMB
  20. * ..
  21. *
  22. *
  23. *> \par Purpose:
  24. * =============
  25. *>
  26. *> \verbatim
  27. *>
  28. *> DLATB9 sets parameters for the matrix generator based on the type of
  29. *> matrix to be generated.
  30. *> \endverbatim
  31. *
  32. * Arguments:
  33. * ==========
  34. *
  35. *> \param[in] PATH
  36. *> \verbatim
  37. *> PATH is CHARACTER*3
  38. *> The LAPACK path name.
  39. *> \endverbatim
  40. *>
  41. *> \param[in] IMAT
  42. *> \verbatim
  43. *> IMAT is INTEGER
  44. *> An integer key describing which matrix to generate for this
  45. *> path.
  46. *> = 1: A: diagonal, B: upper triangular
  47. *> = 2: A: upper triangular, B: upper triangular
  48. *> = 3: A: lower triangular, B: upper triangular
  49. *> Else: A: general dense, B: general dense
  50. *> \endverbatim
  51. *>
  52. *> \param[in] M
  53. *> \verbatim
  54. *> M is INTEGER
  55. *> The number of rows in the matrix to be generated.
  56. *> \endverbatim
  57. *>
  58. *> \param[in] P
  59. *> \verbatim
  60. *> P is INTEGER
  61. *> \endverbatim
  62. *>
  63. *> \param[in] N
  64. *> \verbatim
  65. *> N is INTEGER
  66. *> The number of columns in the matrix to be generated.
  67. *> \endverbatim
  68. *>
  69. *> \param[out] TYPE
  70. *> \verbatim
  71. *> TYPE is CHARACTER*1
  72. *> The type of the matrix to be generated:
  73. *> = 'S': symmetric matrix;
  74. *> = 'P': symmetric positive (semi)definite matrix;
  75. *> = 'N': nonsymmetric matrix.
  76. *> \endverbatim
  77. *>
  78. *> \param[out] KLA
  79. *> \verbatim
  80. *> KLA is INTEGER
  81. *> The lower band width of the matrix to be generated.
  82. *> \endverbatim
  83. *>
  84. *> \param[out] KUA
  85. *> \verbatim
  86. *> KUA is INTEGER
  87. *> The upper band width of the matrix to be generated.
  88. *> \endverbatim
  89. *>
  90. *> \param[out] KLB
  91. *> \verbatim
  92. *> KLB is INTEGER
  93. *> The lower band width of the matrix to be generated.
  94. *> \endverbatim
  95. *>
  96. *> \param[out] KUB
  97. *> \verbatim
  98. *> KUA is INTEGER
  99. *> The upper band width of the matrix to be generated.
  100. *> \endverbatim
  101. *>
  102. *> \param[out] ANORM
  103. *> \verbatim
  104. *> ANORM is DOUBLE PRECISION
  105. *> The desired norm of the matrix to be generated. The diagonal
  106. *> matrix of singular values or eigenvalues is scaled by this
  107. *> value.
  108. *> \endverbatim
  109. *>
  110. *> \param[out] BNORM
  111. *> \verbatim
  112. *> BNORM is DOUBLE PRECISION
  113. *> The desired norm of the matrix to be generated. The diagonal
  114. *> matrix of singular values or eigenvalues is scaled by this
  115. *> value.
  116. *> \endverbatim
  117. *>
  118. *> \param[out] MODEA
  119. *> \verbatim
  120. *> MODEA is INTEGER
  121. *> A key indicating how to choose the vector of eigenvalues.
  122. *> \endverbatim
  123. *>
  124. *> \param[out] MODEB
  125. *> \verbatim
  126. *> MODEB is INTEGER
  127. *> A key indicating how to choose the vector of eigenvalues.
  128. *> \endverbatim
  129. *>
  130. *> \param[out] CNDNMA
  131. *> \verbatim
  132. *> CNDNMA is DOUBLE PRECISION
  133. *> The desired condition number.
  134. *> \endverbatim
  135. *>
  136. *> \param[out] CNDNMB
  137. *> \verbatim
  138. *> CNDNMB is DOUBLE PRECISION
  139. *> The desired condition number.
  140. *> \endverbatim
  141. *>
  142. *> \param[out] DISTA
  143. *> \verbatim
  144. *> DISTA is CHARACTER*1
  145. *> The type of distribution to be used by the random number
  146. *> generator.
  147. *> \endverbatim
  148. *>
  149. *> \param[out] DISTB
  150. *> \verbatim
  151. *> DISTB is CHARACTER*1
  152. *> The type of distribution to be used by the random number
  153. *> generator.
  154. *> \endverbatim
  155. *
  156. * Authors:
  157. * ========
  158. *
  159. *> \author Univ. of Tennessee
  160. *> \author Univ. of California Berkeley
  161. *> \author Univ. of Colorado Denver
  162. *> \author NAG Ltd.
  163. *
  164. *> \ingroup double_eig
  165. *
  166. * =====================================================================
  167. SUBROUTINE DLATB9( PATH, IMAT, M, P, N, TYPE, KLA, KUA, KLB, KUB,
  168. $ ANORM, BNORM, MODEA, MODEB, CNDNMA, CNDNMB,
  169. $ DISTA, DISTB )
  170. *
  171. * -- LAPACK test routine --
  172. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  173. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  174. *
  175. * .. Scalar Arguments ..
  176. CHARACTER DISTA, DISTB, TYPE
  177. CHARACTER*3 PATH
  178. INTEGER IMAT, KLA, KLB, KUA, KUB, M, MODEA, MODEB, N, P
  179. DOUBLE PRECISION ANORM, BNORM, CNDNMA, CNDNMB
  180. * ..
  181. *
  182. * =====================================================================
  183. *
  184. * .. Parameters ..
  185. DOUBLE PRECISION SHRINK, TENTH
  186. PARAMETER ( SHRINK = 0.25D0, TENTH = 0.1D+0 )
  187. DOUBLE PRECISION ONE, TEN
  188. PARAMETER ( ONE = 1.0D+0, TEN = 1.0D+1 )
  189. * ..
  190. * .. Local Scalars ..
  191. LOGICAL FIRST
  192. DOUBLE PRECISION BADC1, BADC2, EPS, LARGE, SMALL
  193. * ..
  194. * .. External Functions ..
  195. LOGICAL LSAMEN
  196. DOUBLE PRECISION DLAMCH
  197. EXTERNAL LSAMEN, DLAMCH
  198. * ..
  199. * .. Intrinsic Functions ..
  200. INTRINSIC MAX, SQRT
  201. * ..
  202. * .. External Subroutines ..
  203. EXTERNAL DLABAD
  204. * ..
  205. * .. Save statement ..
  206. SAVE EPS, SMALL, LARGE, BADC1, BADC2, FIRST
  207. * ..
  208. * .. Data statements ..
  209. DATA FIRST / .TRUE. /
  210. * ..
  211. * .. Executable Statements ..
  212. *
  213. * Set some constants for use in the subroutine.
  214. *
  215. IF( FIRST ) THEN
  216. FIRST = .FALSE.
  217. EPS = DLAMCH( 'Precision' )
  218. BADC2 = TENTH / EPS
  219. BADC1 = SQRT( BADC2 )
  220. SMALL = DLAMCH( 'Safe minimum' )
  221. LARGE = ONE / SMALL
  222. *
  223. * If it looks like we're on a Cray, take the square root of
  224. * SMALL and LARGE to avoid overflow and underflow problems.
  225. *
  226. CALL DLABAD( SMALL, LARGE )
  227. SMALL = SHRINK*( SMALL / EPS )
  228. LARGE = ONE / SMALL
  229. END IF
  230. *
  231. * Set some parameters we don't plan to change.
  232. *
  233. TYPE = 'N'
  234. DISTA = 'S'
  235. DISTB = 'S'
  236. MODEA = 3
  237. MODEB = 4
  238. *
  239. * Set the lower and upper bandwidths.
  240. *
  241. IF( LSAMEN( 3, PATH, 'GRQ' ) .OR. LSAMEN( 3, PATH, 'LSE' ) .OR.
  242. $ LSAMEN( 3, PATH, 'GSV' ) ) THEN
  243. *
  244. * A: M by N, B: P by N
  245. *
  246. IF( IMAT.EQ.1 ) THEN
  247. *
  248. * A: diagonal, B: upper triangular
  249. *
  250. KLA = 0
  251. KUA = 0
  252. KLB = 0
  253. KUB = MAX( N-1, 0 )
  254. *
  255. ELSE IF( IMAT.EQ.2 ) THEN
  256. *
  257. * A: upper triangular, B: upper triangular
  258. *
  259. KLA = 0
  260. KUA = MAX( N-1, 0 )
  261. KLB = 0
  262. KUB = MAX( N-1, 0 )
  263. *
  264. ELSE IF( IMAT.EQ.3 ) THEN
  265. *
  266. * A: lower triangular, B: upper triangular
  267. *
  268. KLA = MAX( M-1, 0 )
  269. KUA = 0
  270. KLB = 0
  271. KUB = MAX( N-1, 0 )
  272. *
  273. ELSE
  274. *
  275. * A: general dense, B: general dense
  276. *
  277. KLA = MAX( M-1, 0 )
  278. KUA = MAX( N-1, 0 )
  279. KLB = MAX( P-1, 0 )
  280. KUB = MAX( N-1, 0 )
  281. *
  282. END IF
  283. *
  284. ELSE IF( LSAMEN( 3, PATH, 'GQR' ) .OR. LSAMEN( 3, PATH, 'GLM' ) )
  285. $ THEN
  286. *
  287. * A: N by M, B: N by P
  288. *
  289. IF( IMAT.EQ.1 ) THEN
  290. *
  291. * A: diagonal, B: lower triangular
  292. *
  293. KLA = 0
  294. KUA = 0
  295. KLB = MAX( N-1, 0 )
  296. KUB = 0
  297. ELSE IF( IMAT.EQ.2 ) THEN
  298. *
  299. * A: lower triangular, B: diagonal
  300. *
  301. KLA = MAX( N-1, 0 )
  302. KUA = 0
  303. KLB = 0
  304. KUB = 0
  305. *
  306. ELSE IF( IMAT.EQ.3 ) THEN
  307. *
  308. * A: lower triangular, B: upper triangular
  309. *
  310. KLA = MAX( N-1, 0 )
  311. KUA = 0
  312. KLB = 0
  313. KUB = MAX( P-1, 0 )
  314. *
  315. ELSE
  316. *
  317. * A: general dense, B: general dense
  318. *
  319. KLA = MAX( N-1, 0 )
  320. KUA = MAX( M-1, 0 )
  321. KLB = MAX( N-1, 0 )
  322. KUB = MAX( P-1, 0 )
  323. END IF
  324. *
  325. END IF
  326. *
  327. * Set the condition number and norm.
  328. *
  329. CNDNMA = TEN*TEN
  330. CNDNMB = TEN
  331. IF( LSAMEN( 3, PATH, 'GQR' ) .OR. LSAMEN( 3, PATH, 'GRQ' ) .OR.
  332. $ LSAMEN( 3, PATH, 'GSV' ) ) THEN
  333. IF( IMAT.EQ.5 ) THEN
  334. CNDNMA = BADC1
  335. CNDNMB = BADC1
  336. ELSE IF( IMAT.EQ.6 ) THEN
  337. CNDNMA = BADC2
  338. CNDNMB = BADC2
  339. ELSE IF( IMAT.EQ.7 ) THEN
  340. CNDNMA = BADC1
  341. CNDNMB = BADC2
  342. ELSE IF( IMAT.EQ.8 ) THEN
  343. CNDNMA = BADC2
  344. CNDNMB = BADC1
  345. END IF
  346. END IF
  347. *
  348. ANORM = TEN
  349. BNORM = TEN*TEN*TEN
  350. IF( LSAMEN( 3, PATH, 'GQR' ) .OR. LSAMEN( 3, PATH, 'GRQ' ) ) THEN
  351. IF( IMAT.EQ.7 ) THEN
  352. ANORM = SMALL
  353. BNORM = LARGE
  354. ELSE IF( IMAT.EQ.8 ) THEN
  355. ANORM = LARGE
  356. BNORM = SMALL
  357. END IF
  358. END IF
  359. *
  360. IF( N.LE.1 ) THEN
  361. CNDNMA = ONE
  362. CNDNMB = ONE
  363. END IF
  364. *
  365. RETURN
  366. *
  367. * End of DLATB9
  368. *
  369. END