@@ -20,7 +20,7 @@ julia> @minimize ls(A*x-b) st x >= 0.;
20
20
21
21
julia> ~x # access array with solution
22
22
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( );
24
24
25
25
julia> ~x # access array with solution
26
26
```
@@ -29,28 +29,28 @@ Returns as output a tuple containing the optimization variables and the number
29
29
of iterations spent by the solver algorithm.
30
30
"""
31
31
macro minimize (cf:: Union{Expr, Symbol} )
32
- cost = esc (cf)
32
+ cost = esc (cf)
33
33
return :(solve (problem ($ (cost)), default_solver ()))
34
34
end
35
35
36
36
macro 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)
43
43
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
47
47
end
48
48
49
49
macro 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)
55
55
return :(solve (problem ($ (cost), $ (constraints)), $ (solver)))
56
56
end
0 commit comments