2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101 DOUBLE PRECISION ZERO, ONE
2102 parameter( zero = 0.0d0, one = 1.0d0 )
2103 DOUBLE PRECISION ROGUE
2104 parameter( rogue = -1.0d10 )
2105
2106 DOUBLE PRECISION TRANSL
2107 INTEGER LDA, M, N, NMAX
2108 LOGICAL RESET
2109 CHARACTER*1 DIAG, UPLO
2110 CHARACTER*2 TYPE
2111
2112 DOUBLE PRECISION A( NMAX, * ), AA( * )
2113
2114 INTEGER I, IBEG, IEND, J
2115 LOGICAL GEN, LOWER, SYM, TRI, UNIT, UPPER
2116
2117 DOUBLE PRECISION DBEG
2119
2120 gen = type.EQ.'GE'
2121 sym = type.EQ.'SY'
2122 tri = type.EQ.'TR'
2123 upper = ( sym.OR.tri ).AND.uplo.EQ.'U'
2124 lower = ( sym.OR.tri ).AND.uplo.EQ.'L'
2125 unit = tri.AND.diag.EQ.'U'
2126
2127
2128
2129 DO 20 j = 1, n
2130 DO 10 i = 1, m
2131 IF( gen.OR.( upper.AND.i.LE.j ).OR.( lower.AND.i.GE.j ) )
2132 $ THEN
2133 a( i, j ) =
dbeg( reset ) + transl
2134 IF( i.NE.j )THEN
2135
2136 IF( n.GT.3.AND.j.EQ.n/2 )
2137 $ a( i, j ) = zero
2138 IF( sym )THEN
2139 a( j, i ) = a( i, j )
2140 ELSE IF( tri )THEN
2141 a( j, i ) = zero
2142 END IF
2143 END IF
2144 END IF
2145 10 CONTINUE
2146 IF( tri )
2147 $ a( j, j ) = a( j, j ) + one
2148 IF( unit )
2149 $ a( j, j ) = one
2150 20 CONTINUE
2151
2152
2153
2154 IF( type.EQ.'GE' )THEN
2155 DO 50 j = 1, n
2156 DO 30 i = 1, m
2157 aa( i + ( j - 1 )*lda ) = a( i, j )
2158 30 CONTINUE
2159 DO 40 i = m + 1, lda
2160 aa( i + ( j - 1 )*lda ) = rogue
2161 40 CONTINUE
2162 50 CONTINUE
2163 ELSE IF( type.EQ.'SY'.OR.type.EQ.'TR' )THEN
2164 DO 90 j = 1, n
2165 IF( upper )THEN
2166 ibeg = 1
2167 IF( unit )THEN
2168 iend = j - 1
2169 ELSE
2170 iend = j
2171 END IF
2172 ELSE
2173 IF( unit )THEN
2174 ibeg = j + 1
2175 ELSE
2176 ibeg = j
2177 END IF
2178 iend = n
2179 END IF
2180 DO 60 i = 1, ibeg - 1
2181 aa( i + ( j - 1 )*lda ) = rogue
2182 60 CONTINUE
2183 DO 70 i = ibeg, iend
2184 aa( i + ( j - 1 )*lda ) = a( i, j )
2185 70 CONTINUE
2186 DO 80 i = iend + 1, lda
2187 aa( i + ( j - 1 )*lda ) = rogue
2188 80 CONTINUE
2189 90 CONTINUE
2190 END IF
2191 RETURN
2192
2193
2194
double precision function dbeg(reset)