annotate util/unloc_solver.m @ 244:5c8bcdadb380 unlocbox

added UNLocBox interface, example and a 128x128 Lena
author bmailhe
date Tue, 04 Sep 2012 11:00:36 +0100
parents
children
rev   line source
bmailhe@244 1 function [ sol ] = unloc_solver( b, A, param,name )
bmailhe@244 2 %UNLOC_SOLVER Solve the minimisation problem using UNLOCBOX toolbox
bmailhe@244 3 %
bmailhe@244 4 % argmin_x ||x||_1 such that ||Ax-b||_2 < sima_t
bmailhe@244 5
bmailhe@244 6 if nargin<3, param=struct; end
bmailhe@244 7
bmailhe@244 8 % set parameters
bmailhe@244 9 if ~isfield(param, 'verbose'), param.verbose = 1; end
bmailhe@244 10 if ~isfield(param, 'T'), param.T = 256; end
bmailhe@244 11 if ~isfield(param, 'sigma'), param.sigma = 1; end
bmailhe@244 12 if ~isfield(param, 'max_iter'), param.max_iter = 100; end
bmailhe@244 13 if ~isfield(param, 'epsilon'), param.epsilon = 1e-3; end
bmailhe@244 14
bmailhe@244 15 [b2,f1,f2,param] = small_to_unloc(b,A,param);
bmailhe@244 16
bmailhe@244 17 if strcmpi(name, 'Douglas_Rachford')
bmailhe@244 18 sol=douglas_rachford(b2,f2,f1,param);
bmailhe@244 19 elseif strcmpi(name, 'Forward_Backard')
bmailhe@244 20 sol=forward_backward(b2,f1,f2,param);
bmailhe@244 21 elseif strcmpi(name, 'ADMM')
bmailhe@244 22 opL= @(x) x;
bmailhe@244 23 sol=admm(b2,f1,f2,opL,param);
bmailhe@244 24 else
bmailhe@244 25 error('UNLocBox tells you: Unknown solver name!')
bmailhe@244 26 end;
bmailhe@244 27
bmailhe@244 28
bmailhe@244 29
bmailhe@244 30 end
bmailhe@244 31