Skip to content

Commit

Permalink
Some fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Dec 21, 2017
1 parent 2a84077 commit c4e0e30
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion base/linalg/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ eigmax(A::SymTridiagonal) = eigvals(A, size(A, 1):size(A, 1))[1]
eigmin(A::SymTridiagonal) = eigvals(A, 1:1)[1]

#Compute selected eigenvectors only corresponding to particular eigenvalues
eigvecs(A::SymTridiagonal) = eigfact(A)[:vectors]
eigvecs(A::SymTridiagonal) = eigfact(A).vectors

"""
eigvecs(A::SymTridiagonal[, eigvals]) -> Matrix
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ end
F = cholfact(Hermitian(AcA, uplo))
G = cholfact(Hermitian(BcB, uplo))
@test Base.getproperty(LinAlg.lowrankupdate(F, v), uplo) Base.getproperty(G, uplo)
@test_throws DimensionMismatch LinAlg.lowrankupdate(F, ones(eltype($v), length($v)+1))
@test_throws DimensionMismatch LinAlg.lowrankupdate(F, ones(eltype(v), length(v)+1))
@test Base.getproperty(LinAlg.lowrankdowndate(G, v), uplo) Base.getproperty(F, uplo)
@test_throws DimensionMismatch LinAlg.lowrankdowndate(G, ones(eltype(v), length(v)+1))
end
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/lq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ rectangularQ(Q::LinAlg.LQPackedQ) = convert(Array, Q)
@test size(lqa,3) == 1
@test size(lqa.Q,3) == 1
@test_throws ErrorException lqa.Z
@test Array(lqa') a'
@test Array(adjoint(lqa)) a'
@test lqa * lqa' a * a'
@test lqa' * lqa a' * a
@test q*squareQ(q)' Matrix(I, n, n)
Expand Down
4 changes: 2 additions & 2 deletions test/linalg/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ rectangularQ(Q::LinAlg.AbstractQ) = convert(Array, Q)
a = raw_a
qrpa = factorize(a[:,1:n1])
q, r = qrpa.Q, qrpa.R
@test mul!(squareQ(q)', q) Matrix(I, n, n)
@test mul!(adjoint(squareQ(q)), q) Matrix(I, n, n)
@test_throws DimensionMismatch mul!(Matrix{eltya}(I, n+1, n+1),q)
@test mul!(squareQ(q), Adjoint(q)) Matrix(I, n, n)
@test_throws DimensionMismatch mul!(Matrix{eltya}(I, n+1, n+1), Adjoint(q))
Expand All @@ -145,7 +145,7 @@ rectangularQ(Q::LinAlg.AbstractQ) = convert(Array, Q)

qra = qrfact(a[:,1:n1], Val(false))
q, r = qra.Q, qra.R
@test mul!(squareQ(q)', q) Matrix(I, n, n)
@test mul!(adjoint(squareQ(q)), q) Matrix(I, n, n)
@test_throws DimensionMismatch mul!(Matrix{eltya}(I, n+1, n+1),q)
@test mul!(squareQ(q), Adjoint(q)) Matrix(I, n, n)
@test_throws DimensionMismatch mul!(Matrix{eltya}(I, n+1, n+1),Adjoint(q))
Expand Down
4 changes: 2 additions & 2 deletions test/linalg/triangular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int)
debug && println("\ntype of A: ", eltya, " type of b: ", eltyb, "\n")

debug && println("Solve upper triangular system")
Atri = UpperTriangular(lufact(A)[:U]) |> t -> eltya <: Complex && eltyb <: Real ? real(t) : t # Here the triangular matrix can't be too badly conditioned
Atri = UpperTriangular(lufact(A).U) |> t -> eltya <: Complex && eltyb <: Real ? real(t) : t # Here the triangular matrix can't be too badly conditioned
b = convert(Matrix{eltyb}, eltya <: Complex ? Matrix(Atri)*ones(n, 2) : Matrix(Atri)*ones(n, 2))
x = Matrix(Atri) \ b

Expand Down Expand Up @@ -449,7 +449,7 @@ for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int)
end

debug && println("Solve lower triangular system")
Atri = UpperTriangular(lufact(A)[:U]) |> t -> eltya <: Complex && eltyb <: Real ? real(t) : t # Here the triangular matrix can't be too badly conditioned
Atri = UpperTriangular(lufact(A).U) |> t -> eltya <: Complex && eltyb <: Real ? real(t) : t # Here the triangular matrix can't be too badly conditioned
b = convert(Matrix{eltyb}, eltya <: Complex ? Matrix(Atri)*ones(n, 2) : Matrix(Atri)*ones(n, 2))
x = Matrix(Atri)\b

Expand Down

0 comments on commit c4e0e30

Please sign in to comment.