Skip to content

Commit

Permalink
Changed issym to issymmetric. Updated docs, NEWS.md, and deprecated i…
Browse files Browse the repository at this point in the history
…ssym.
  • Loading branch information
pkofod committed Feb 26, 2016
1 parent 3585235 commit 7a3cc31
Show file tree
Hide file tree
Showing 27 changed files with 76 additions and 71 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ Deprecated or removed

* Deprecate `chol(A,Val{:U/:L})` in favor of `chol(A)` ([#13680]).

* `issym` is deprecated in favor of `issymmetric` to match similar functions (`ishermitian`, ...) ([#15192])

Julia v0.4.0 Release Notes
==========================

Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -990,3 +990,6 @@ end
export call

@deprecate_binding LambdaStaticData LambdaInfo

# Changed issym to issymmetric. #15192
@deprecate issym issymmetric
6 changes: 3 additions & 3 deletions base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6698,11 +6698,11 @@ The arguments to a function or constructor are outside the valid domain.
DomainError

"""
issym(A) -> Bool
issymmetric(A) -> Bool
Test whether a matrix is symmetric.
"""
issym
issymmetric

"""
acosh(x)
Expand Down Expand Up @@ -8427,7 +8427,7 @@ rand!
Compute the Bunch-Kaufman [^Bunch1977] factorization of a real symmetric or complex Hermitian
matrix `A` and return a `BunchKaufman` object. The following functions are available for
`BunchKaufman` objects: `size`, `\\`, `inv`, `issym`, `ishermitian`.
`BunchKaufman` objects: `size`, `\\`, `inv`, `issymmetric`, `ishermitian`.
[^Bunch1977]: J R Bunch and L Kaufman, Some stable methods for calculating inertia and solving symmetric linear systems, Mathematics of Computation 31:137 (1977), 163-179. [url](http://www.ams.org/journals/mcom/1977-31-137/S0025-5718-1977-0428694-0).
Expand Down
2 changes: 1 addition & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ export
ishermitian,
isposdef!,
isposdef,
issym,
issymmetric,
istril,
istriu,
kron,
Expand Down
2 changes: 1 addition & 1 deletion base/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export
ishermitian,
isposdef,
isposdef!,
issym,
issymmetric,
istril,
istriu,
kron,
Expand Down
4 changes: 2 additions & 2 deletions base/linalg/arnoldi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function _eigs(A, B;
T = eltype(A)
iscmplx = T <: Complex
isgeneral = B !== I
sym = issym(A) && !iscmplx
sym = issymmetric(A) && !iscmplx
nevmax=sym ? n-1 : n-2
if nevmax <= 0
throw(ArgumentError("Input matrix A is too small. Use eigfact instead."))
Expand Down Expand Up @@ -297,7 +297,7 @@ end
## v = [ left_singular_vector; right_singular_vector ]
*{T,S}(s::SVDOperator{T,S}, v::Vector{T}) = [s.X * v[s.m+1:end]; s.X' * v[1:s.m]]
size(s::SVDOperator) = s.m + s.n, s.m + s.n
issym(s::SVDOperator) = true
issymmetric(s::SVDOperator) = true

svds{T<:BlasFloat}(A::AbstractMatrix{T}; kwargs...) = _svds(A; kwargs...)
svds(A::AbstractMatrix{BigFloat}; kwargs...) = throw(MethodError(svds, Any[A, kwargs...]))
Expand Down
4 changes: 2 additions & 2 deletions base/linalg/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ end

## Structure query functions

issym(A::BitMatrix) = size(A, 1)==size(A, 2) && countnz(A - A.')==0
ishermitian(A::BitMatrix) = issym(A)
issymmetric(A::BitMatrix) = size(A, 1)==size(A, 2) && countnz(A - A.')==0
ishermitian(A::BitMatrix) = issymmetric(A)

function nonzero_chunks(chunks::Vector{UInt64}, pos0::Int, pos1::Int)
k0, l0 = Base.get_chunks_id(pos0)
Expand Down
20 changes: 10 additions & 10 deletions base/linalg/bunchkaufman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ immutable BunchKaufman{T,S<:AbstractMatrix} <: Factorization{T}
end
BunchKaufman{T}(LD::AbstractMatrix{T}, ipiv::Vector{BlasInt}, uplo::Char, symmetric::Bool, rook::Bool) = BunchKaufman{T,typeof(LD)}(LD, ipiv, uplo, symmetric, rook)

function bkfact!{T<:BlasReal}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issym(A), rook::Bool=false)
function bkfact!{T<:BlasReal}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issymmetric(A), rook::Bool=false)
if !symmetric
throw(ArgumentError("Bunch-Kaufman decomposition is only valid for symmetric matrices"))
end
LD, ipiv = rook ? LAPACK.sytrf_rook!(char_uplo(uplo) , A) : LAPACK.sytrf!(char_uplo(uplo) , A)
BunchKaufman(LD, ipiv, char_uplo(uplo), symmetric, rook)
end
function bkfact!{T<:BlasComplex}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issym(A), rook::Bool=false)
function bkfact!{T<:BlasComplex}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issymmetric(A), rook::Bool=false)
if rook
LD, ipiv = (symmetric ? LAPACK.sytrf_rook! : LAPACK.hetrf_rook!)(char_uplo(uplo) , A)
else
LD, ipiv = (symmetric ? LAPACK.sytrf! : LAPACK.hetrf!)(char_uplo(uplo) , A)
end
BunchKaufman(LD, ipiv, char_uplo(uplo), symmetric, rook)
end
bkfact{T<:BlasFloat}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issym(A), rook::Bool=false) = bkfact!(copy(A), uplo, symmetric, rook)
bkfact{T}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issym(A), rook::Bool=false) = bkfact!(convert(Matrix{promote_type(Float32,typeof(sqrt(one(T))))},A),uplo,symmetric,rook)
bkfact{T<:BlasFloat}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issymmetric(A), rook::Bool=false) = bkfact!(copy(A), uplo, symmetric, rook)
bkfact{T}(A::StridedMatrix{T}, uplo::Symbol=:U, symmetric::Bool=issymmetric(A), rook::Bool=false) = bkfact!(convert(Matrix{promote_type(Float32,typeof(sqrt(one(T))))},A),uplo,symmetric,rook)

convert{T}(::Type{BunchKaufman{T}},B::BunchKaufman) = BunchKaufman(convert(Matrix{T},B.LD),B.ipiv,B.uplo,B.symmetric,B.rook)
convert{T}(::Type{Factorization{T}}, B::BunchKaufman) = convert(BunchKaufman{T}, B)

size(B::BunchKaufman) = size(B.LD)
size(B::BunchKaufman,d::Integer) = size(B.LD,d)
issym(B::BunchKaufman) = B.symmetric
issymmetric(B::BunchKaufman) = B.symmetric
ishermitian(B::BunchKaufman) = !B.symmetric

function inv{T<:BlasReal}(B::BunchKaufman{T})
Expand All @@ -49,7 +49,7 @@ function inv{T<:BlasReal}(B::BunchKaufman{T})
end

function inv{T<:BlasComplex}(B::BunchKaufman{T})
if issym(B)
if issymmetric(B)
if B.rook
copytri!(LAPACK.sytri_rook!(B.uplo, copy(B.LD), B.ipiv), B.uplo)
else
Expand All @@ -73,9 +73,9 @@ function A_ldiv_B!{T<:BlasReal}(B::BunchKaufman{T}, R::StridedVecOrMat{T})
end
function A_ldiv_B!{T<:BlasComplex}(B::BunchKaufman{T}, R::StridedVecOrMat{T})
if B.rook
(issym(B) ? LAPACK.sytrs_rook! : LAPACK.hetrs_rook!)(B.uplo, B.LD, B.ipiv, R)
(issymmetric(B) ? LAPACK.sytrs_rook! : LAPACK.hetrs_rook!)(B.uplo, B.LD, B.ipiv, R)
else
(issym(B) ? LAPACK.sytrs! : LAPACK.hetrs!)(B.uplo, B.LD, B.ipiv, R)
(issymmetric(B) ? LAPACK.sytrs! : LAPACK.hetrs!)(B.uplo, B.LD, B.ipiv, R)
end
end

Expand All @@ -94,9 +94,9 @@ function det(F::BunchKaufman)
else
# 2x2 pivot case. Make sure not to square before the subtraction by scaling with the off-diagonal element. This is safe because the off diagonal is always large for 2x2 pivots.
if F.uplo == 'U'
d *= M[i, i + 1]*(M[i,i]/M[i, i + 1]*M[i + 1, i + 1] - (issym(F) ? M[i, i + 1] : conj(M[i, i + 1])))
d *= M[i, i + 1]*(M[i,i]/M[i, i + 1]*M[i + 1, i + 1] - (issymmetric(F) ? M[i, i + 1] : conj(M[i, i + 1])))
else
d *= M[i + 1,i]*(M[i, i]/M[i + 1, i]*M[i + 1, i + 1] - (issym(F) ? M[i + 1, i] : conj(M[i + 1, i])))
d *= M[i + 1,i]*(M[i, i]/M[i + 1, i]*M[i + 1, i + 1] - (issymmetric(F) ? M[i + 1, i] : conj(M[i + 1, i])))
end
i += 2
end
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ end
logm(a::Complex) = log(a)

function sqrtm{T<:Real}(A::StridedMatrix{T})
if issym(A)
if issymmetric(A)
return full(sqrtm(Symmetric(A)))
end
n = checksquare(A)
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ parent(D::Diagonal) = D.diag

ishermitian{T<:Real}(D::Diagonal{T}) = true
ishermitian(D::Diagonal) = all(D.diag .== real(D.diag))
issym(D::Diagonal) = true
issymmetric(D::Diagonal) = true
isposdef(D::Diagonal) = all(D.diag .> 0)

factorize(D::Diagonal) = D
Expand Down
8 changes: 4 additions & 4 deletions base/linalg/eigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ isposdef(A::Union{Eigen,GeneralizedEigen}) = isreal(A.values) && all(A.values .>
function eigfact!{T<:BlasReal}(A::StridedMatrix{T}; permute::Bool=true, scale::Bool=true)
n = size(A, 2)
n==0 && return Eigen(zeros(T, 0), zeros(T, 0, 0))
issym(A) && return eigfact!(Symmetric(A))
issymmetric(A) && return eigfact!(Symmetric(A))
A, WR, WI, VL, VR, _ = LAPACK.geevx!(permute ? (scale ? 'B' : 'P') : (scale ? 'S' : 'N'), 'N', 'V', 'N', A)
all(WI .== 0.) && return Eigen(WR, VR)
evec = zeros(Complex{T}, n, n)
Expand Down Expand Up @@ -81,7 +81,7 @@ eigvals{T,V,S,U}(F::Union{Eigen{T,V,S,U}, GeneralizedEigen{T,V,S,U}}) = F[:value
Same as `eigvals`, but saves space by overwriting the input `A` (and `B`), instead of creating a copy.
"""
function eigvals!{T<:BlasReal}(A::StridedMatrix{T}; permute::Bool=true, scale::Bool=true)
issym(A) && return eigvals!(Symmetric(A))
issymmetric(A) && return eigvals!(Symmetric(A))
_, valsre, valsim, _ = LAPACK.geevx!(permute ? (scale ? 'B' : 'P') : (scale ? 'S' : 'N'), 'N', 'N', 'N', A)
return all(valsim .== 0) ? valsre : complex(valsre, valsim)
end
Expand Down Expand Up @@ -120,7 +120,7 @@ det(A::Eigen) = prod(A.values)

# Generalized eigenproblem
function eigfact!{T<:BlasReal}(A::StridedMatrix{T}, B::StridedMatrix{T})
issym(A) && isposdef(B) && return eigfact!(Symmetric(A), Symmetric(B))
issymmetric(A) && isposdef(B) && return eigfact!(Symmetric(A), Symmetric(B))
n = size(A, 1)
alphar, alphai, beta, _, vr = LAPACK.ggev!('N', 'V', A, B)
all(alphai .== 0) && return GeneralizedEigen(alphar ./ beta, vr)
Expand Down Expand Up @@ -160,7 +160,7 @@ function eig(A::Number, B::Number)
end

function eigvals!{T<:BlasReal}(A::StridedMatrix{T}, B::StridedMatrix{T})
issym(A) && isposdef(B) && return eigvals!(Symmetric(A), Symmetric(B))
issymmetric(A) && isposdef(B) && return eigvals!(Symmetric(A), Symmetric(B))
alphar, alphai, beta, vl, vr = LAPACK.ggev!('N', 'N', A, B)
return (all(alphai .== 0) ? alphar : complex(alphar, alphai))./beta
end
Expand Down
4 changes: 2 additions & 2 deletions base/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ condskeel{T<:Integer}(A::AbstractMatrix{T}, p::Real=Inf) = norm(abs(inv(float(A)
condskeel(A::AbstractMatrix, x::AbstractVector, p::Real=Inf) = norm(abs(inv(A))*abs(A)*abs(x), p)
condskeel{T<:Integer}(A::AbstractMatrix{T}, x::AbstractVector, p::Real=Inf) = norm(abs(inv(float(A)))*abs(A)*abs(x), p)

function issym(A::AbstractMatrix)
function issymmetric(A::AbstractMatrix)
m, n = size(A)
if m != n
return false
Expand All @@ -395,7 +395,7 @@ function issym(A::AbstractMatrix)
return true
end

issym(x::Number) = true
issymmetric(x::Number) = true

function ishermitian(A::AbstractMatrix)
m, n = size(A)
Expand Down
10 changes: 5 additions & 5 deletions base/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ copy{T,S}(A::Hermitian{T,S}) = Hermitian{T,S}(copy(A.data),A.uplo)
ishermitian(A::Hermitian) = true
ishermitian{T<:Real,S}(A::Symmetric{T,S}) = true
ishermitian{T<:Complex,S}(A::Symmetric{T,S}) = all(imag(A.data) .== 0)
issym{T<:Real,S}(A::Hermitian{T,S}) = true
issym{T<:Complex,S}(A::Hermitian{T,S}) = all(imag(A.data) .== 0)
issym(A::Symmetric) = true
issymmetric{T<:Real,S}(A::Hermitian{T,S}) = true
issymmetric{T<:Complex,S}(A::Hermitian{T,S}) = all(imag(A.data) .== 0)
issymmetric(A::Symmetric) = true
transpose(A::Symmetric) = A
ctranspose{T<:Real}(A::Symmetric{T}) = A
function ctranspose(A::Symmetric)
Expand Down Expand Up @@ -138,15 +138,15 @@ A_mul_B!{T<:BlasComplex,S<:StridedMatrix}(C::StridedMatrix{T}, A::StridedMatrix{
*(A::HermOrSym, B::HermOrSym) = full(A)*full(B)
*(A::StridedMatrix, B::HermOrSym) = A*full(B)

bkfact(A::HermOrSym) = bkfact(A.data, symbol(A.uplo), issym(A))
bkfact(A::HermOrSym) = bkfact(A.data, symbol(A.uplo), issymmetric(A))
factorize(A::HermOrSym) = bkfact(A)

# Is just RealHermSymComplexHerm, but type alias seems to be broken
det{T<:Real,S}(A::Union{Hermitian{T,S}, Symmetric{T,S}, Hermitian{Complex{T},S}}) = real(det(bkfact(A)))
det{T<:Real}(A::Symmetric{T}) = det(bkfact(A))
det(A::Symmetric) = det(bkfact(A))

\{T,S<:StridedMatrix}(A::HermOrSym{T,S}, B::StridedVecOrMat) = \(bkfact(A.data, symbol(A.uplo), issym(A)), B)
\{T,S<:StridedMatrix}(A::HermOrSym{T,S}, B::StridedVecOrMat) = \(bkfact(A.data, symbol(A.uplo), issymmetric(A)), B)

inv{T<:BlasFloat,S<:StridedMatrix}(A::Hermitian{T,S}) = Hermitian{T,S}(inv(bkfact(A.data, symbol(A.uplo))), A.uplo)
inv{T<:BlasFloat,S<:StridedMatrix}(A::Symmetric{T,S}) = Symmetric{T,S}(inv(bkfact(A.data, symbol(A.uplo), true)), A.uplo)
Expand Down
8 changes: 4 additions & 4 deletions base/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import Base.LinAlg: At_ldiv_B!, Ac_ldiv_B!
import Base: @get!, acos, acosd, acot, acotd, acsch, asech, asin, asind, asinh,
atan, atand, atanh, broadcast!, chol, conj!, cos, cosc, cosd, cosh, cospi, cot,
cotd, coth, countnz, csc, cscd, csch, ctranspose!, diag, diff, done, dot, eig,
exp10, exp2, eye, findn, floor, hash, indmin, inv, issym, istril, istriu, log10,
log2, lu, maxabs, minabs, next, sec, secd, sech, show, showarray, sin, sinc,
sind, sinh, sinpi, squeeze, start, sum, sumabs, sumabs2, summary, tan, tand,
tanh, trace, transpose!, tril!, triu!, trunc, vecnorm, writemime, abs, abs2,
exp10, exp2, eye, findn, floor, hash, indmin, inv, issymmetric, istril, istriu,
log10, log2, lu, maxabs, minabs, next, sec, secd, sech, show, showarray, sin,
sinc, sind, sinh, sinpi, squeeze, start, sum, sumabs, sumabs2, summary, tan,
tand, tanh, trace, transpose!, tril!, triu!, trunc, vecnorm, writemime, abs, abs2,
broadcast, ceil, complex, cond, conj, convert, copy, copy!, ctranspose, diagm,
exp, expm1, factorize, find, findmax, findmin, findnz, float, full, getindex,
hcat, hvcat, imag, indmax, ishermitian, kron, length, log, log1p, max, min,
Expand Down
6 changes: 3 additions & 3 deletions base/sparse/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Base: (*), convert, copy, eltype, get, getindex, show, showarray, size,

import Base.LinAlg: (\), A_mul_Bc, A_mul_Bt, Ac_ldiv_B, Ac_mul_B, At_ldiv_B, At_mul_B,
cholfact, cholfact!, det, diag, ishermitian, isposdef,
issym, ldltfact, ldltfact!, logdet
issymmetric, ldltfact, ldltfact!, logdet

importall ..SparseArrays

Expand Down Expand Up @@ -986,7 +986,7 @@ function convert{Tv}(::Type{SparseMatrixCSC{Tv,SuiteSparse_long}}, A::Sparse{Tv}
end
function convert(::Type{Symmetric{Float64,SparseMatrixCSC{Float64,SuiteSparse_long}}}, A::Sparse{Float64})
s = unsafe_load(A.p)
if !issym(A)
if !issymmetric(A)
throw(ArgumentError("matrix is not symmetric"))
end
return Symmetric(SparseMatrixCSC(s.nrow, s.ncol, increment(pointer_to_array(s.p, (s.ncol + 1,), false)), increment(pointer_to_array(s.i, (s.nzmax,), false)), copy(pointer_to_array(s.x, (s.nzmax,), false))), s.stype > 0 ? :U : :L)
Expand Down Expand Up @@ -1536,7 +1536,7 @@ function isposdef{Tv<:VTypes}(A::SparseMatrixCSC{Tv,SuiteSparse_long})
true
end

function issym(A::Sparse)
function issymmetric(A::Sparse)
s = unsafe_load(A.p)
if s.stype != 0
return isreal(A)
Expand Down
2 changes: 1 addition & 1 deletion base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,7 @@ function blkdiag(X::SparseMatrixCSC...)
end

## Structure query functions
issym(A::SparseMatrixCSC) = is_hermsym(A, IdFun())
issymmetric(A::SparseMatrixCSC) = is_hermsym(A, IdFun())

ishermitian(A::SparseMatrixCSC) = is_hermsym(A, ConjFun())

Expand Down
4 changes: 2 additions & 2 deletions doc/stdlib/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f

.. Docstring generated from Julia source
Compute the Bunch-Kaufman [Bunch1977]_ factorization of a real symmetric or complex Hermitian matrix ``A`` and return a ``BunchKaufman`` object. The following functions are available for ``BunchKaufman`` objects: ``size``\ , ``\``\ , ``inv``\ , ``issym``\ , ``ishermitian``\ .
Compute the Bunch-Kaufman [Bunch1977]_ factorization of a real symmetric or complex Hermitian matrix ``A`` and return a ``BunchKaufman`` object. The following functions are available for ``BunchKaufman`` objects: ``size``\ , ``\``\ , ``inv``\ , ``issymmetric``\ , ``ishermitian``\ .

.. [Bunch1977] J R Bunch and L Kaufman, Some stable methods for calculating inertia and solving symmetric linear systems, Mathematics of Computation 31:137 (1977), 163-179. `url <http://www.ams.org/journals/mcom/1977-31-137/S0025-5718-1977-0428694-0>`_\ .
Expand Down Expand Up @@ -1093,7 +1093,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f
Computes the solution ``X`` to the Sylvester equation ``AX + XB + C = 0``\ , where ``A``\ , ``B`` and ``C`` have compatible dimensions and ``A`` and ``-B`` have no eigenvalues with equal real part.

.. function:: issym(A) -> Bool
.. function:: issymmetric(A) -> Bool

.. Docstring generated from Julia source
Expand Down
2 changes: 1 addition & 1 deletion test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ end

# Handle block matrices
A = [randn(2,2) for i = 1:2, j = 1:2]
@test issym(A.'A)
@test issymmetric(A.'A)
A = [complex(randn(2,2), randn(2,2)) for i = 1:2, j = 1:2]
@test ishermitian(A'A)

Expand Down
2 changes: 1 addition & 1 deletion test/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ b1 = triu(bitrand(n2, n1))

b1 = bitrand(n1,n1)
b1 |= b1.'
@check_bit_operation issym(b1) Bool
@check_bit_operation issymmetric(b1) Bool
@check_bit_operation ishermitian(b1) Bool

b1 = bitrand(n1)
Expand Down
2 changes: 1 addition & 1 deletion test/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ for elty in [Float32, Float64, Complex64, Complex128]

A = rand(elty,n,n)
A = A + A.'
@test issym(A)
@test issymmetric(A)
@test_approx_eq triu(BLAS.syr!('U',α,x,copy(A))) triu(A + α*x*x.')
@test_throws DimensionMismatch BLAS.syr!('U',α,ones(elty,n+1),copy(A))

Expand Down
4 changes: 2 additions & 2 deletions test/linalg/arnoldi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ let A6965 = [
end

# Example from Quantum Information Theory
import Base: size, issym, ishermitian
import Base: size, issymmetric, ishermitian

type CPM{T<:Base.LinAlg.BlasFloat}<:AbstractMatrix{T} # completely positive map
kraus::Array{T,3} # kraus operator representation
end
size(Phi::CPM)=(size(Phi.kraus,1)^2,size(Phi.kraus,3)^2)
issym(Phi::CPM)=false
issymmetric(Phi::CPM)=false
ishermitian(Phi::CPM)=false
import Base: *
function *{T<:Base.LinAlg.BlasFloat}(Phi::CPM{T},rho::Vector{T})
Expand Down
4 changes: 2 additions & 2 deletions test/linalg/bunchkaufman.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ debug && println("(Automatic) Bunch-Kaufman factor of indefinite matrix")
end
debug && println("Bunch-Kaufman factors of a pos-def matrix")
for rook in (false, true)
bc2 = bkfact(apd, :U, issym(apd), rook)
bc2 = bkfact(apd, :U, issymmetric(apd), rook)
@test_approx_eq inv(bc2) * apd eye(n)
@test_approx_eq_eps apd * (bc2\b) b 150000ε
@test ishermitian(bc2) == !issym(bc2)
@test ishermitian(bc2) == !issymmetric(bc2)
end

end
Expand Down
4 changes: 2 additions & 2 deletions test/linalg/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ for relty in (Float32, Float64, BigFloat), elty in (relty, Complex{relty})
@test isa(similar(D, Int, (3,2)), Matrix{Int})

#10036
@test issym(D2)
@test issymmetric(D2)
@test ishermitian(D2)
if elty <: Complex
dc = d + im*convert(Vector{elty}, ones(n))
D3 = Diagonal(dc)
@test issym(D3)
@test issymmetric(D3)
@test !ishermitian(D3)
end

Expand Down
Loading

0 comments on commit 7a3cc31

Please sign in to comment.