![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b SLANST 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download SLANST + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slanst.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slanst.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slanst.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * REAL FUNCTION SLANST( NORM, N, D, E ) 00022 * 00023 * .. Scalar Arguments .. 00024 * CHARACTER NORM 00025 * INTEGER N 00026 * .. 00027 * .. Array Arguments .. 00028 * REAL D( * ), E( * ) 00029 * .. 00030 * 00031 * 00032 *> \par Purpose: 00033 * ============= 00034 *> 00035 *> \verbatim 00036 *> 00037 *> SLANST returns the value of the one norm, or the Frobenius norm, or 00038 *> the infinity norm, or the element of largest absolute value of a 00039 *> real symmetric tridiagonal matrix A. 00040 *> \endverbatim 00041 *> 00042 *> \return SLANST 00043 *> \verbatim 00044 *> 00045 *> SLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm' 00046 *> ( 00047 *> ( norm1(A), NORM = '1', 'O' or 'o' 00048 *> ( 00049 *> ( normI(A), NORM = 'I' or 'i' 00050 *> ( 00051 *> ( normF(A), NORM = 'F', 'f', 'E' or 'e' 00052 *> 00053 *> where norm1 denotes the one norm of a matrix (maximum column sum), 00054 *> normI denotes the infinity norm of a matrix (maximum row sum) and 00055 *> normF denotes the Frobenius norm of a matrix (square root of sum of 00056 *> squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. 00057 *> \endverbatim 00058 * 00059 * Arguments: 00060 * ========== 00061 * 00062 *> \param[in] NORM 00063 *> \verbatim 00064 *> NORM is CHARACTER*1 00065 *> Specifies the value to be returned in SLANST as described 00066 *> above. 00067 *> \endverbatim 00068 *> 00069 *> \param[in] N 00070 *> \verbatim 00071 *> N is INTEGER 00072 *> The order of the matrix A. N >= 0. When N = 0, SLANST is 00073 *> set to zero. 00074 *> \endverbatim 00075 *> 00076 *> \param[in] D 00077 *> \verbatim 00078 *> D is REAL array, dimension (N) 00079 *> The diagonal elements of A. 00080 *> \endverbatim 00081 *> 00082 *> \param[in] E 00083 *> \verbatim 00084 *> E is REAL array, dimension (N-1) 00085 *> The (n-1) sub-diagonal or super-diagonal elements of A. 00086 *> \endverbatim 00087 * 00088 * Authors: 00089 * ======== 00090 * 00091 *> \author Univ. of Tennessee 00092 *> \author Univ. of California Berkeley 00093 *> \author Univ. of Colorado Denver 00094 *> \author NAG Ltd. 00095 * 00096 *> \date November 2011 00097 * 00098 *> \ingroup auxOTHERauxiliary 00099 * 00100 * ===================================================================== 00101 REAL FUNCTION SLANST( NORM, N, D, E ) 00102 * 00103 * -- LAPACK auxiliary routine (version 3.4.0) -- 00104 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00105 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00106 * November 2011 00107 * 00108 * .. Scalar Arguments .. 00109 CHARACTER NORM 00110 INTEGER N 00111 * .. 00112 * .. Array Arguments .. 00113 REAL D( * ), E( * ) 00114 * .. 00115 * 00116 * ===================================================================== 00117 * 00118 * .. Parameters .. 00119 REAL ONE, ZERO 00120 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 ) 00121 * .. 00122 * .. Local Scalars .. 00123 INTEGER I 00124 REAL ANORM, SCALE, SUM 00125 * .. 00126 * .. External Functions .. 00127 LOGICAL LSAME 00128 EXTERNAL LSAME 00129 * .. 00130 * .. External Subroutines .. 00131 EXTERNAL SLASSQ 00132 * .. 00133 * .. Intrinsic Functions .. 00134 INTRINSIC ABS, MAX, SQRT 00135 * .. 00136 * .. Executable Statements .. 00137 * 00138 IF( N.LE.0 ) THEN 00139 ANORM = ZERO 00140 ELSE IF( LSAME( NORM, 'M' ) ) THEN 00141 * 00142 * Find max(abs(A(i,j))). 00143 * 00144 ANORM = ABS( D( N ) ) 00145 DO 10 I = 1, N - 1 00146 ANORM = MAX( ANORM, ABS( D( I ) ) ) 00147 ANORM = MAX( ANORM, ABS( E( I ) ) ) 00148 10 CONTINUE 00149 ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' .OR. 00150 $ LSAME( NORM, 'I' ) ) THEN 00151 * 00152 * Find norm1(A). 00153 * 00154 IF( N.EQ.1 ) THEN 00155 ANORM = ABS( D( 1 ) ) 00156 ELSE 00157 ANORM = MAX( ABS( D( 1 ) )+ABS( E( 1 ) ), 00158 $ ABS( E( N-1 ) )+ABS( D( N ) ) ) 00159 DO 20 I = 2, N - 1 00160 ANORM = MAX( ANORM, ABS( D( I ) )+ABS( E( I ) )+ 00161 $ ABS( E( I-1 ) ) ) 00162 20 CONTINUE 00163 END IF 00164 ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN 00165 * 00166 * Find normF(A). 00167 * 00168 SCALE = ZERO 00169 SUM = ONE 00170 IF( N.GT.1 ) THEN 00171 CALL SLASSQ( N-1, E, 1, SCALE, SUM ) 00172 SUM = 2*SUM 00173 END IF 00174 CALL SLASSQ( N, D, 1, SCALE, SUM ) 00175 ANORM = SCALE*SQRT( SUM ) 00176 END IF 00177 * 00178 SLANST = ANORM 00179 RETURN 00180 * 00181 * End of SLANST 00182 * 00183 END