Skip to content

Commit

Permalink
Changed issym to issymmetric.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod committed Feb 22, 2016
1 parent 34e9516 commit e600f73
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 65 deletions.
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/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,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 @@ -47,9 +47,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 @@ -126,15 +126,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 @@ -2608,7 +2608,7 @@ end
squeeze(S::SparseMatrixCSC, dims::Dims) = throw(ArgumentError("squeeze is not available for sparse matrices"))

## 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
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 @@ -162,12 +162,12 @@ for relty in (Float32, Float64, BigFloat), elty in (relty, Complex{relty})
@test length(diag(similar(D, eltype(D), (n,n)))) == n

#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
4 changes: 2 additions & 2 deletions test/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ y = ['a','b','c','d','e']
@test_throws DimensionMismatch Base.LinAlg.axpy!(α,x,collect(1:2),['a','b'],collect(1:2))

@test_throws ArgumentError diag(rand(10))
@test !issym(ones(5,3))
@test !issymmetric(ones(5,3))
@test !ishermitian(ones(5,3))
@test cross(ones(3),ones(3)) == zeros(3)

Expand Down Expand Up @@ -193,7 +193,7 @@ for elty in [Float32,Float64,Complex64,Complex128]
@test !isfinite(cond(zero(elty)))
@test cond(a) == one(elty)
@test cond(a,1) == one(elty)
@test issym(a)
@test issymmetric(a)
@test ishermitian(one(elty))
@test det(a) == a
end
Expand Down
4 changes: 2 additions & 2 deletions test/linalg/symmetric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ let n=10
#trace
@test trace(asym) == trace(Hermitian(asym))

# issym, ishermitian
# issymmetric, ishermitian
if eltya <: Real
@test issym(Symmetric(asym))
@test issymmetric(Symmetric(asym))
@test ishermitian(Symmetric(asym))
end
if eltya <: Complex
Expand Down
10 changes: 5 additions & 5 deletions test/sparsedir/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ end
@test eltype(A) == Float64
@test eltype(chma) == Float64

# test Sparse constructor Symmetric and Hermitian input (and issym and ishermitian)
# test Sparse constructor Symmetric and Hermitian input (and issymmetric and ishermitian)
ACSC = sprandn(10, 10, 0.3) + I
@test issym(Sparse(Symmetric(ACSC, :L)))
@test issym(Sparse(Symmetric(ACSC, :U)))
@test issymmetric(Sparse(Symmetric(ACSC, :L)))
@test issymmetric(Sparse(Symmetric(ACSC, :U)))
@test ishermitian(Sparse(Hermitian(complex(ACSC), :L)))
@test ishermitian(Sparse(Hermitian(complex(ACSC), :U)))

Expand Down Expand Up @@ -387,7 +387,7 @@ for elty in (Float64, Complex{Float64})
@test !isposdef(A1 + A1' |> t -> t - 2eigmax(full(t))*I)

if elty <: Real
@test CHOLMOD.issym(Sparse(A1pd, 0))
@test CHOLMOD.issymmetric(Sparse(A1pd, 0))
@test CHOLMOD.Sparse(cholfact(Symmetric(A1pd, :L))) == CHOLMOD.Sparse(cholfact(A1pd))
F1 = CHOLMOD.Sparse(cholfact(Symmetric(A1pd, :L), shift=2))
F2 = CHOLMOD.Sparse(cholfact(A1pd, shift=2))
Expand All @@ -397,7 +397,7 @@ for elty in (Float64, Complex{Float64})
F2 = CHOLMOD.Sparse(ldltfact(A1pd, shift=2))
@test F1 == F2
else
@test !CHOLMOD.issym(Sparse(A1pd, 0))
@test !CHOLMOD.issymmetric(Sparse(A1pd, 0))
@test CHOLMOD.ishermitian(Sparse(A1pd, 0))
@test CHOLMOD.Sparse(cholfact(Hermitian(A1pd, :L))) == CHOLMOD.Sparse(cholfact(A1pd))
F1 = CHOLMOD.Sparse(cholfact(Hermitian(A1pd, :L), shift=2))
Expand Down
Loading

0 comments on commit e600f73

Please sign in to comment.