LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
ssxt1.f
Go to the documentation of this file.
00001 *> \brief \b SSXT1
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *  Definition:
00009 *  ===========
00010 *
00011 *       REAL             FUNCTION SSXT1( IJOB, D1, N1, D2, N2, ABSTOL,
00012 *                        ULP, UNFL )
00013 * 
00014 *       .. Scalar Arguments ..
00015 *       INTEGER            IJOB, N1, N2
00016 *       REAL               ABSTOL, ULP, UNFL
00017 *       ..
00018 *       .. Array Arguments ..
00019 *       REAL               D1( * ), D2( * )
00020 *       ..
00021 *  
00022 *
00023 *> \par Purpose:
00024 *  =============
00025 *>
00026 *> \verbatim
00027 *>
00028 *> SSXT1  computes the difference between a set of eigenvalues.
00029 *> The result is returned as the function value.
00030 *>
00031 *> IJOB = 1:   Computes   max { min | D1(i)-D2(j) | }
00032 *>                         i     j
00033 *>
00034 *> IJOB = 2:   Computes   max { min | D1(i)-D2(j) | /
00035 *>                         i     j
00036 *>                              ( ABSTOL + |D1(i)|*ULP ) }
00037 *> \endverbatim
00038 *
00039 *  Arguments:
00040 *  ==========
00041 *
00042 *> \param[in] IJOB
00043 *> \verbatim
00044 *>          IJOB is INTEGER
00045 *>          Specifies the type of tests to be performed.  (See above.)
00046 *> \endverbatim
00047 *>
00048 *> \param[in] D1
00049 *> \verbatim
00050 *>          D1 is REAL array, dimension (N1)
00051 *>          The first array.  D1 should be in increasing order, i.e.,
00052 *>          D1(j) <= D1(j+1).
00053 *> \endverbatim
00054 *>
00055 *> \param[in] N1
00056 *> \verbatim
00057 *>          N1 is INTEGER
00058 *>          The length of D1.
00059 *> \endverbatim
00060 *>
00061 *> \param[in] D2
00062 *> \verbatim
00063 *>          D2 is REAL array, dimension (N2)
00064 *>          The second array.  D2 should be in increasing order, i.e.,
00065 *>          D2(j) <= D2(j+1).
00066 *> \endverbatim
00067 *>
00068 *> \param[in] N2
00069 *> \verbatim
00070 *>          N2 is INTEGER
00071 *>          The length of D2.
00072 *> \endverbatim
00073 *>
00074 *> \param[in] ABSTOL
00075 *> \verbatim
00076 *>          ABSTOL is REAL
00077 *>          The absolute tolerance, used as a measure of the error.
00078 *> \endverbatim
00079 *>
00080 *> \param[in] ULP
00081 *> \verbatim
00082 *>          ULP is REAL
00083 *>          Machine precision.
00084 *> \endverbatim
00085 *>
00086 *> \param[in] UNFL
00087 *> \verbatim
00088 *>          UNFL is REAL
00089 *>          The smallest positive number whose reciprocal does not
00090 *>          overflow.
00091 *> \endverbatim
00092 *
00093 *  Authors:
00094 *  ========
00095 *
00096 *> \author Univ. of Tennessee 
00097 *> \author Univ. of California Berkeley 
00098 *> \author Univ. of Colorado Denver 
00099 *> \author NAG Ltd. 
00100 *
00101 *> \date November 2011
00102 *
00103 *> \ingroup single_eig
00104 *
00105 *  =====================================================================
00106       REAL             FUNCTION SSXT1( IJOB, D1, N1, D2, N2, ABSTOL,
00107      $                 ULP, UNFL )
00108 *
00109 *  -- LAPACK test routine (version 3.4.0) --
00110 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00111 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00112 *     November 2011
00113 *
00114 *     .. Scalar Arguments ..
00115       INTEGER            IJOB, N1, N2
00116       REAL               ABSTOL, ULP, UNFL
00117 *     ..
00118 *     .. Array Arguments ..
00119       REAL               D1( * ), D2( * )
00120 *     ..
00121 *
00122 *  =====================================================================
00123 *
00124 *     .. Parameters ..
00125       REAL               ZERO
00126       PARAMETER          ( ZERO = 0.0E0 )
00127 *     ..
00128 *     .. Local Scalars ..
00129       INTEGER            I, J
00130       REAL               TEMP1, TEMP2
00131 *     ..
00132 *     .. Intrinsic Functions ..
00133       INTRINSIC          ABS, MAX, MIN
00134 *     ..
00135 *     .. Executable Statements ..
00136 *
00137       TEMP1 = ZERO
00138 *
00139       J = 1
00140       DO 20 I = 1, N1
00141    10    CONTINUE
00142          IF( D2( J ).LT.D1( I ) .AND. J.LT.N2 ) THEN
00143             J = J + 1
00144             GO TO 10
00145          END IF
00146          IF( J.EQ.1 ) THEN
00147             TEMP2 = ABS( D2( J )-D1( I ) )
00148             IF( IJOB.EQ.2 )
00149      $         TEMP2 = TEMP2 / MAX( UNFL, ABSTOL+ULP*ABS( D1( I ) ) )
00150          ELSE
00151             TEMP2 = MIN( ABS( D2( J )-D1( I ) ),
00152      $              ABS( D1( I )-D2( J-1 ) ) )
00153             IF( IJOB.EQ.2 )
00154      $         TEMP2 = TEMP2 / MAX( UNFL, ABSTOL+ULP*ABS( D1( I ) ) )
00155          END IF
00156          TEMP1 = MAX( TEMP1, TEMP2 )
00157    20 CONTINUE
00158 *
00159       SSXT1 = TEMP1
00160       RETURN
00161 *
00162 *     End of SSXT1
00163 *
00164       END
 All Files Functions