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

Update deprecated &x syntax in cholmod #23401

Merged
merged 1 commit into from
Aug 23, 2017
Merged
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
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