@@ -262,7 +262,7 @@ condskeel{T<:Integer}(A::AbstractMatrix{T}, p::Real=Inf) = norm(abs(inv(float(A)
262
262
condskeel (A:: AbstractMatrix , x:: AbstractVector , p:: Real = Inf ) = norm (abs (inv (A))* abs (A)* abs (x), p)
263
263
condskeel {T<:Integer} (A:: AbstractMatrix{T} , x:: AbstractVector , p:: Real = Inf ) = norm (abs (inv (float (A)))* abs (A)* abs (x), p)
264
264
265
- function issym (A:: AbstractMatrix )
265
+ function _issym (A:: AbstractMatrix )
266
266
m, n = size (A)
267
267
m== n || return false
268
268
for i = 1 : (n- 1 ), j = (i+ 1 ): n
275
275
276
276
issym (x:: Number ) = true
277
277
278
- function ishermitian (A:: AbstractMatrix )
278
+ function _ishermitian (A:: AbstractMatrix )
279
279
m, n = size (A)
280
280
m== n || return false
281
281
for i = 1 : n, j = i: n
@@ -286,9 +286,14 @@ function ishermitian(A::AbstractMatrix)
286
286
return true
287
287
end
288
288
289
+ ishermitian (A:: AbstractMatrix ) = _ishermitian (A:: AbstractMatrix )
290
+ issym (A:: AbstractMatrix ) = _issym (A:: AbstractMatrix )
291
+
289
292
for (f,t) in ((:ishermitian , :ctranspose ),(:issym , :transpose ))
290
293
eval (quote
291
294
function $f {T<:FloatingPoint} (A:: Union(AbstractMatrix{Complex{T}}, AbstractMatrix{T}) ,tol= 1e-10 )
295
+ # This is performed due to if tol==0. _issym/_ishermitian is a lot faster for exact equality.
296
+ tol == 0. && return $ (symbol (" _" ,:f ))(A)
292
297
m,n = size (A)
293
298
Tnorm = typeof (float (real (zero (T))))
294
299
Tsum = promote_type (Float64,Tnorm)
0 commit comments