OptimizationProblems.jl
OptimizationProblems.jl copied to clipboard
Some problems objective function allocate
Here is the list:
- [ ] brybnd
- [ ] clplatea
- [ ] clplateb
- [ ] clplatec
- [ ] curly
- [ ] curly10
- [ ] curly20
- [ ] curly30
- [ ] elec
- [ ] fminsrf2
- [ ] hovercraft1d
- [ ] hs111
- [ ] hs117
- [ ] hs119
- [ ] hs86
- [ ] ncb20
- [ ] ncb20b
- [ ] palmer1c
- [ ] palmer1d
- [ ] palmer2c
- [ ] palmer3c
- [ ] palmer4c
- [ ] palmer5c
- [ ] palmer5d
- [ ] palmer6c
- [ ] palmer7c
- [ ] palmer8c
- [ ] penalty2
- [ ] polygon2
- [ ] sbrybnd
- [ ] spmsrtls
- [ ] tetra
- [ ] tetra_duct12
- [ ] tetra_duct15
- [ ] tetra_duct20
- [ ] tetra_foam5
- [ ] tetra_gear
- [ ] tetra_hook
- [ ] threepk
- [ ] triangle
- [ ] triangle_deer
- [ ] triangle_pacman
- [ ] triangle_turtle
Originally posted by @tmigot in https://github.com/JuliaSmoothOptimizers/OptimizationProblems.jl/issues/242#issuecomment-1360255319
Some here are due to imbricated sums, for instance:
julia> function f(x) return sum(sum(i * j * x[i] for i=1:j) * x[j] for j=1:10) end
f (generic function with 3 methods)
julia> @code_warntype f(x)
MethodInstance for f(::Vector{Float64})
from f(x; n) in Main at REPL[65]:1
Arguments
#self#::Core.Const(f)
x::Vector{Float64}
Locals
#144::var"#144#146"{Vector{Float64}}
Body::Any
1 ─ %1 = Main.:(var"#144#146")::Core.Const(var"#144#146")
│ %2 = Core.typeof(x)::Core.Const(Vector{Float64})
│ %3 = Core.apply_type(%1, %2)::Core.Const(var"#144#146"{Vector{Float64}})
│ (#144 = %new(%3, x))
│ %5 = #144::var"#144#146"{Vector{Float64}}
│ %6 = (1:10)::Core.Const(1:10)
│ %7 = Base.Generator(%5, %6)::Core.PartialStruct(Base.Generator{UnitRange{Int64}, var"#144#146"{Vector{Float64}}}, Any[var"#144#146"{Vector{Float64}}, Core.Const(1:10)])
│ %8 = Main.sum(%7)::Any
└── return %8