Skip to content

Commit

Permalink
Update deprecated &x syntax in cholmod (#23401)
Browse files Browse the repository at this point in the history
  • Loading branch information
musm authored and andreasnoack committed Aug 23, 2017
1 parent 6d38500 commit 7568df4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions base/sparse/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -487,21 +487,21 @@ function allocate_sparse(nrow::Integer, ncol::Integer, nzmax::Integer,
end
function free_sparse!(ptr::Ptr{C_Sparse{Tv}}) where Tv<:VTypes
@isok ccall((@cholmod_name("free_sparse", SuiteSparse_long), :libcholmod), Cint,
(Ptr{Ptr{C_Sparse{Tv}}}, Ptr{UInt8}),
&ptr, common())
(Ref{Ptr{C_Sparse{Tv}}}, Ptr{UInt8}),
ptr, common())
end

function free_sparse!(ptr::Ptr{C_SparseVoid})
@isok ccall((@cholmod_name("free_sparse", SuiteSparse_long), :libcholmod), Cint,
(Ptr{Ptr{C_SparseVoid}}, Ptr{UInt8}),
&ptr, common())
(Ref{Ptr{C_SparseVoid}}, Ptr{UInt8}),
ptr, common())
end

function free_factor!(ptr::Ptr{C_Factor{Tv}}) where Tv<:VTypes
# Warning! Important that finalizer doesn't modify the global Common struct.
@isok ccall((@cholmod_name("free_factor", SuiteSparse_long), :libcholmod), Cint,
(Ptr{Ptr{C_Factor{Tv}}}, Ptr{Void}),
&ptr, common())
(Ref{Ptr{C_Factor{Tv}}}, Ptr{Void}),
ptr, common())
end

function aat(A::Sparse{Tv}, fset::Vector{SuiteSparse_long}, mode::Integer) where Tv<:VRealTypes
Expand Down Expand Up @@ -1725,7 +1725,7 @@ function logdet(F::Factor{Tv}) where Tv<:VTypes
f = unsafe_load(pointer(F))
res = zero(Tv)
for d in diag(F); res += log(abs(d)) end
f.is_ll!=0 ? 2res : res
f.is_ll != 0 ? 2res : res
end

det(L::Factor) = exp(logdet(L))
Expand Down

0 comments on commit 7568df4

Please sign in to comment.