Closed ericphanson closed 3 weeks ago
julia> using Convex julia> N = 10 10 julia> b = rand(N) 10-element Vector{Float64}: 0.13262633847871297 0.9254408726815795 0.13936575019827857 0.3329759851512133 0.5964209280418487 0.8590087709390417 0.7599860068305675 0.841494184551078 0.1349705410637151 0.017608754157530382 julia> x = Variable(10) Variable size: (10, 1) sign: real vexity: affine id: 493…512 julia> relative_entropy(b, x) ERROR: MethodError: no method matching relative_entropy(::Vector{Float64}, ::Variable) Closest candidates are: relative_entropy(::Convex.AbstractExpr, ::Convex.AbstractExpr) @ Convex ~/.julia/packages/Convex/y7lu0/src/atoms/RelativeEntropyAtom.jl:53 Stacktrace: [1] top-level scope @ REPL[72]:1 julia> relative_entropy(constant(b), x) relative_entropy (convex; real) ├─ 10×1 Matrix{Float64} └─ 10-element real variable (id: 493…512)
We should add some methods to add constant automatically.
constant
We should add some methods to add
constant
automatically.