@@ -20,7 +20,7 @@ julia> @minimize ls(A*x-b) st x >= 0.;
2020
2121julia> ~x # access array with solution
2222
23- julia> @minimize ls(A*x-b) st norm(x) == 2.0 with ForwardBackward(fast=true );
23+ julia> @minimize ls(A*x-b) st norm(x) == 2.0 with PANOCplus( );
2424
2525julia> ~x # access array with solution
2626```
@@ -29,28 +29,28 @@ Returns as output a tuple containing the optimization variables and the number
2929of iterations spent by the solver algorithm.
3030"""
3131macro minimize (cf:: Union{Expr, Symbol} )
32- cost = esc (cf)
32+ cost = esc (cf)
3333 return :(solve (problem ($ (cost)), default_solver ()))
3434end
3535
3636macro minimize (cf:: Union{Expr, Symbol} , s:: Symbol , cstr:: Union{Expr, Symbol} )
37- cost = esc (cf)
38- if s == :(st)
39- constraints = esc (cstr)
40- return :(solve (problem ($ (cost), $ (constraints)), default_solver ()))
41- elseif s == :(with)
42- solver = esc (cstr)
37+ cost = esc (cf)
38+ if s == :(st)
39+ constraints = esc (cstr)
40+ return :(solve (problem ($ (cost), $ (constraints)), default_solver ()))
41+ elseif s == :(with)
42+ solver = esc (cstr)
4343 return :(solve (problem ($ (cost)), $ (solver)))
44- else
45- error (" wrong symbol after cost function! use `st` or `with`" )
46- end
44+ else
45+ error (" wrong symbol after cost function! use `st` or `with`" )
46+ end
4747end
4848
4949macro minimize (cf:: Union{Expr, Symbol} , s:: Symbol , cstr:: Union{Expr, Symbol} , w:: Symbol , slv:: Union{Expr, Symbol} )
50- cost = esc (cf)
51- s != :(st) && error (" wrong symbol after cost function! use `st`" )
52- constraints = esc (cstr)
53- w != :(with) && error (" wrong symbol after constraints! use `with`" )
54- solver = esc (slv)
50+ cost = esc (cf)
51+ s != :(st) && error (" wrong symbol after cost function! use `st`" )
52+ constraints = esc (cstr)
53+ w != :(with) && error (" wrong symbol after constraints! use `with`" )
54+ solver = esc (slv)
5555 return :(solve (problem ($ (cost), $ (constraints)), $ (solver)))
5656end
0 commit comments