Skip to content

Convex does not support broadcasting #479

@odow

Description

@odow

Convex.jl lacks support for a lot of broadcasting operations.

This causes a bunch of problems like this:

julia> using Convex

julia> x = Variable(2)
Variable
size: (2, 1)
sign: real
vexity: affine
id: 181059

julia> A = rand(2, 2)
2×2 Matrix{Float64}:
 0.290045  0.201488
 0.890725  0.771457

julia> A * x .+ 1
ERROR: MethodError: no method matching iterate(::Convex.MultiplyAtom)
Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen}) at range.jl:664
  iterate(::Union{LinRange, StepRangeLen}, ::Int64) at range.jl:664
  iterate(::T) where T<:Union{Base.KeySet{var"#s79", var"#s78"} where {var"#s79", var"#s78"<:Dict}, Base.ValueIterator{var"#s77"} where var"#s77"<:Dict} at dict.jl:693
  ...
Stacktrace:
 [1] copyto!(dest::Vector{Any}, src::Convex.MultiplyAtom)
   @ Base ./abstractarray.jl:843
 [2] _collect(cont::UnitRange{Int64}, itr::Convex.MultiplyAtom, #unused#::Base.HasEltype, isz::Base.HasLength)
   @ Base ./array.jl:608
 [3] collect(itr::Convex.MultiplyAtom)
   @ Base ./array.jl:602
 [4] broadcastable(x::Convex.MultiplyAtom)
   @ Base.Broadcast ./broadcast.jl:682
 [5] broadcasted(::Function, ::Convex.MultiplyAtom, ::Int64)
   @ Base.Broadcast ./broadcast.jl:1312
 [6] top-level scope
   @ REPL[4]:1

The purpose of this issue is to collate the currently open issues into a single thread, and to make it more discoverable for users coming to report bugs.

Replaces:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions