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

conv fails for complex inputs #288

Closed
ericphanson opened this issue May 9, 2019 · 0 comments · Fixed by #330
Closed

conv fails for complex inputs #288

ericphanson opened this issue May 9, 2019 · 0 comments · Fixed by #330
Labels
Milestone

Comments

@ericphanson
Copy link
Collaborator

ericphanson commented May 9, 2019

julia> x = rand(5) + im*rand(5);
julia> y = Constant(rand(5));
julia> conv(x,y)
ERROR: InexactError: Float64(0.43372749030578417 + 0.16456075616898147im)
Stacktrace:
 [1] setindex!(::Array{Float64,1}, ::Complex{Float64}, ::Int64) at ./complex.jl:37
 [2] SparseMatrixCSC{Float64,Int64}(::Array{Complex{Float64},2}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/SparseArrays/src/sparsematrix.jl:394
 [3] convert at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/SparseArrays/src/sparsematrix.jl:430 [inlined]
 [4] _to_same_csc at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/SparseArrays/src/sparsematrix.jl:2566 [inlined]
 [5] setindex!(::SparseMatrixCSC{Float64,Int64}, ::Array{Complex{Float64},1}, ::UnitRange{Int64}, ::Int64) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/SparseArrays/src/sparsematrix.jl:2573
 [6] conv(::Array{Complex{Float64},1}, ::Constant{Array{Float64,1}}) at /Users/ephhome/.julia/dev/Convex/src/atoms/affine/conv.jl:16
 [7] top-level scope at none:0

The problem is the line https://github.com/JuliaOpt/Convex.jl/blob/fe366821b77d8243f2ca21a7deb35f4d50c579ce/src/atoms/affine/conv.jl#L14 where a Float64 matrix is constructed to hold elements of x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant