Creating a sparse matrix with zeros should obviously be discouraged but I
don't think it should be an error. One should just have to pay for the cost
of the extra operations.
In JuMP the sparse constraint matrix follows the structure of the model,
and it's possible for some coefficients to be zero in some instances.

In test/sparse.jl:

> @@ -182,3 +182,7 @@ mfe22 = eye(Float64, 2)
>
>  # issue #5169
>  @test nnz(sparse([1,1],[1,2],[0.0,-0.0])) == 0
> +
> +# issue #5386
> +I,J,V = findnz(SparseMatrixCSC(2,1,[1,3],[1,2],[1.0,0.0]))

Although this constructor is available, one should really not be creating
sparse matrices with stored zeros. A lot of routines assume no stored
zeros. Maybe we should not export SparseMatrixCSC?

—
Reply to this email directly or view it on
GitHub<https://github.com/JuliaLang/julia/pull/5386/files#r8894990>
.