Skip to content

Commit

Permalink
Deprecate A_ldiv_B!(SparseMatrixCSC, StrideVecOrMat) thereby fixing #…
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Oct 14, 2015
1 parent d711b7d commit 87131f3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
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

0 comments on commit 87131f3

Please sign in to comment.