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.

clctes.f 2.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. *> \brief \b CLCTES
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. * Definition:
  9. * ===========
  10. *
  11. * LOGICAL FUNCTION CLCTES( Z, D )
  12. *
  13. * .. Scalar Arguments ..
  14. * COMPLEX D, Z
  15. * ..
  16. *
  17. *
  18. *> \par Purpose:
  19. * =============
  20. *>
  21. *> \verbatim
  22. *>
  23. *> CLCTES returns .TRUE. if the eigenvalue Z/D is to be selected
  24. *> (specifically, in this subroutine, if the real part of the
  25. *> eigenvalue is negative), and otherwise it returns .FALSE..
  26. *>
  27. *> It is used by the test routine CDRGES to test whether the driver
  28. *> routine CGGES successfully sorts eigenvalues.
  29. *> \endverbatim
  30. *
  31. * Arguments:
  32. * ==========
  33. *
  34. *> \param[in] Z
  35. *> \verbatim
  36. *> Z is COMPLEX
  37. *> The numerator part of a complex eigenvalue Z/D.
  38. *> \endverbatim
  39. *>
  40. *> \param[in] D
  41. *> \verbatim
  42. *> D is COMPLEX
  43. *> The denominator part of a complex eigenvalue Z/D.
  44. *> \endverbatim
  45. *
  46. * Authors:
  47. * ========
  48. *
  49. *> \author Univ. of Tennessee
  50. *> \author Univ. of California Berkeley
  51. *> \author Univ. of Colorado Denver
  52. *> \author NAG Ltd.
  53. *
  54. *> \ingroup complex_eig
  55. *
  56. * =====================================================================
  57. LOGICAL FUNCTION CLCTES( Z, D )
  58. *
  59. * -- LAPACK test routine --
  60. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  61. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  62. *
  63. * .. Scalar Arguments ..
  64. COMPLEX D, Z
  65. * ..
  66. *
  67. * =====================================================================
  68. *
  69. * .. Parameters ..
  70. *
  71. REAL ZERO, ONE
  72. PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
  73. COMPLEX CZERO
  74. PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ) )
  75. * ..
  76. * .. Local Scalars ..
  77. REAL ZMAX
  78. * ..
  79. * .. Intrinsic Functions ..
  80. INTRINSIC ABS, AIMAG, MAX, REAL, SIGN
  81. * ..
  82. * .. Executable Statements ..
  83. *
  84. IF( D.EQ.CZERO ) THEN
  85. CLCTES = ( REAL( Z ).LT.ZERO )
  86. ELSE
  87. IF( REAL( Z ).EQ.ZERO .OR. REAL( D ).EQ.ZERO ) THEN
  88. CLCTES = ( SIGN( ONE, AIMAG( Z ) ).NE.
  89. $ SIGN( ONE, AIMAG( D ) ) )
  90. ELSE IF( AIMAG( Z ).EQ.ZERO .OR. AIMAG( D ).EQ.ZERO ) THEN
  91. CLCTES = ( SIGN( ONE, REAL( Z ) ).NE.
  92. $ SIGN( ONE, REAL( D ) ) )
  93. ELSE
  94. ZMAX = MAX( ABS( REAL( Z ) ), ABS( AIMAG( Z ) ) )
  95. CLCTES = ( ( REAL( Z ) / ZMAX )*REAL( D )+
  96. $ ( AIMAG( Z ) / ZMAX )*AIMAG( D ).LT.ZERO )
  97. END IF
  98. END IF
  99. *
  100. RETURN
  101. *
  102. * End of CLCTES
  103. *
  104. END