Skip to content

Commit d9aadd1

Browse files
committed
Make A_ldiv_B work for Factor and SubArrays
1 parent 768ea70 commit d9aadd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base/sparse/cholmod.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -809,15 +809,15 @@ get_perm(FC::FactorComponent) = get_perm(Factor(FC))
809809
#########################
810810

811811
# Convertion/construction
812-
function convert{T<:VTypes}(::Type{Dense{T}}, A::VecOrMat)
812+
function convert{T<:VTypes}(::Type{Dense{T}}, A::StridedVecOrMat)
813813
d = allocate_dense(size(A, 1), size(A, 2), stride(A, 2), T)
814814
s = unsafe_load(d.p)
815815
for i in eachindex(A)
816816
unsafe_store!(s.x, A[i], i)
817817
end
818818
d
819819
end
820-
function convert(::Type{Dense}, A::VecOrMat)
820+
function convert(::Type{Dense}, A::StridedVecOrMat)
821821
T = promote_type(eltype(A), Float64)
822822
return convert(Dense{T}, A)
823823
end
@@ -1464,7 +1464,7 @@ Ac_ldiv_B(L::FactorComponent, B) = ctranspose(L)\B
14641464

14651465
(\){T}(L::Factor{T}, B::Dense{T}) = solve(CHOLMOD_A, L, B)
14661466
(\)(L::Factor{Float64}, B::VecOrMat{Complex{Float64}}) = L\real(B) + L\imag(B)
1467-
(\)(L::Factor, b::Vector) = Vector(L\convert(Dense{eltype(L)}, b))
1467+
(\)(L::Factor, b::StridedVector) = Vector(L\convert(Dense{eltype(L)}, b))
14681468
(\)(L::Factor, B::Matrix) = Matrix(L\convert(Dense{eltype(L)}, B))
14691469
(\)(L::Factor, B::Sparse) = spsolve(CHOLMOD_A, L, B)
14701470
# When right hand side is sparse, we have to ensure that the rhs is not marked as symmetric.

0 commit comments

Comments
 (0)