Skip to content

Commit

Permalink
julia v0.5 doesn't have iszero
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeits committed Dec 19, 2017
1 parent 51a9e2b commit 5c49e40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PATHSolver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const user_f = Ref(FunctionWrapper{Vector{Cdouble}, Tuple{Vector{Cdouble}}}(iden
const user_j = Ref(FunctionWrapper{SparseMatrixCSC{Cdouble, Cint}, Tuple{Vector{Cdouble}}}(identity))

count_nonzeros(M::AbstractSparseMatrix) = nnz(M)
count_nonzeros(M::AbstractMatrix) = count(x -> !iszero(x), M) # fallback for dense matrices
count_nonzeros(M::AbstractMatrix) = count(x -> x != 0, M) # fallback for dense matrices

function solveMCP(f_eval::Function, lb::Vector, ub::Vector, var_name=C_NULL, con_name=C_NULL)
j_eval = x -> ForwardDiff.jacobian(f_eval, x)
Expand Down

0 comments on commit 5c49e40

Please sign in to comment.