Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate A_ldiv_B!(SparseMatrixCSC, StridedVecOrMat) thereby fixing #10787 #13496

Merged
merged 1 commit into from
Oct 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Library improvements
Deprecated or removed
---------------------

* The method `A_ldiv_B!(SparseMatrixCSC, StrideVecOrMat)` has been deprecated in favor
of versions that require the matrix to in factored form ([#13496]).

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

Expand Down
4 changes: 4 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ for f in (:remotecall, :remotecall_fetch, :remotecall_wait)
end
end

#13465
@deprecate cov(x::AbstractVector; corrected=true, mean=Base.mean(x)) covm(x, mean, corrected)
@deprecate cov(X::AbstractMatrix; vardim=1, corrected=true, mean=Base.mean(X, vardim)) covm(X, mean, vardim, corrected)
@deprecate cov(x::AbstractVector, y::AbstractVector; corrected=true, mean=(Base.mean(x), Base.mean(y))) covm(x, mean[1], y, mean[2], corrected)
Expand All @@ -854,3 +855,6 @@ end
@deprecate cor(X::AbstractVecOrMat, Y::AbstractVecOrMat; vardim=1, mean=(Base.mean(X, vardim), Base.mean(Y, vardim))) corm(X, mean[1], Y, mean[2], vardim)

@deprecate_binding SparseMatrix SparseArrays

#13496
@deprecate A_ldiv_B!(A::SparseMatrixCSC, B::StridedVecOrMat) A_ldiv_B!(factorize(A), B)
14 changes: 0 additions & 14 deletions base/sparse/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,6 @@ function spmatmul{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti};
end

## solvers
function A_ldiv_B!(A::SparseMatrixCSC, b::AbstractVecOrMat)
if eltype(b)<:Complex; A = complex(A); end

if istril(A)
# TODO: Fix diagonal case. Diagonal(A.nzval) needs to handle
# the case where there are zeros on the diagonal and error out.
# It also does not work in the complex case. VBS.
#if istriu(A); return A_ldiv_B!(Diagonal(A.nzval), b); end
return fwdTriSolve!(A, b)
end
if istriu(A); return bwdTriSolve!(A, b); end
return A_ldiv_B!(lufact(A),b)
end

function fwdTriSolve!(A::SparseMatrixCSC, B::AbstractVecOrMat)
# forward substitution for CSC matrices
n = length(B)
Expand Down
3 changes: 0 additions & 3 deletions test/sparsedir/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ for i = 1:5
@test (maximum(abs(a\b - full(a)\b)) < 1000*eps())
@test (maximum(abs(a'\b - full(a')\b)) < 1000*eps())
@test (maximum(abs(a.'\b - full(a.')\b)) < 1000*eps())
@test (maximum(abs(A_ldiv_B!(a,copy(b)) - full(a)\b)) < 1000*eps())

a = speye(5) + tril(0.1*sprandn(5, 5, 0.2) + 0.1*im*sprandn(5, 5, 0.2))
b = randn(5,3)
Expand All @@ -145,7 +144,6 @@ for i = 1:5
@test (maximum(abs(a\b - full(a)\b)) < 1000*eps())
@test (maximum(abs(a'\b - full(a')\b)) < 1000*eps())
@test (maximum(abs(a.'\b - full(a.')\b)) < 1000*eps())
@test (maximum(abs(A_ldiv_B!(a,copy(b)) - full(a)\b)) < 1000*eps())

a = speye(5) + triu(0.1*sprandn(5, 5, 0.2) + 0.1*im*sprandn(5, 5, 0.2))
b = randn(5,3)
Expand All @@ -164,7 +162,6 @@ for i = 1:5
@test (maximum(abs(a\b - full(a)\b)) < 1000*eps())
@test (maximum(abs(a'\b - full(a')\b)) < 1000*eps())
@test (maximum(abs(a.'\b - full(a.')\b)) < 1000*eps())
@test (maximum(abs(A_ldiv_B!(a,copy(b)) - full(a)\b)) < 1000*eps())

a = spdiagm(randn(5)) + im*spdiagm(randn(5))
b = randn(5,3)
Expand Down