Mercurial > hg > smallbox
comparison util/small_to_unloc.m @ 246:cef4500b936f ver_2.1
Merge
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Oct 2012 12:10:13 +0000 |
parents | 5c8bcdadb380 |
children |
comparison
equal
deleted
inserted
replaced
245:96d17e5dc5d3 | 246:cef4500b936f |
---|---|
1 function [b2,f1,f2,param] = small_to_unloc(b,A,param) | |
2 | |
3 | |
4 if nargin<3, param=struct; end | |
5 % set parameters | |
6 if ~isfield(param, 'verbose'), param.verbose = 0; end | |
7 if ~isfield(param, 'T'), param.T = 1; end | |
8 if ~isfield(param, 'gamma'), param.gamma = 1/(1.1*norm(A)^2); end | |
9 if ~isfield(param, 'sigma'), param.sigma = 1; end | |
10 | |
11 | |
12 %set function f2 | |
13 param_f2.verbose=param.verbose; | |
14 param_f2.A=@(x) A*x; | |
15 param_f2.At=@(x) A'*x; | |
16 param_f2.y=b; | |
17 param_f2.tight=0; | |
18 param_f2.nu=norm(A,2)^2; | |
19 param_f2.epsilon=param.sigma; | |
20 | |
21 f2.prox= @(x,l) fast_proj_B2(x,l,param_f2); % douglas rachford, admm | |
22 f2.grad= @(x) 2*A'*(A*x-b); %forward backward | |
23 f2.x0=A'*b; | |
24 f2.norm=@(x) 0; | |
25 | |
26 | |
27 | |
28 | |
29 %set function f1 | |
30 param_f1.verbose=param.verbose; | |
31 | |
32 f1.x0=A'*b; | |
33 f1.norm= @(x) sum(sum(abs(x))); | |
34 f1.prox= @(x,l) prox_L1(x,param.T*l,param_f1); | |
35 | |
36 | |
37 | |
38 %set initial point | |
39 b2=A'*b; | |
40 | |
41 | |
42 end | |
43 |