Mercurial > hg > smallbox
diff util/SMALL_solve.m @ 154:0de08f68256b ivand_dev
ALPS toolbox - Algebraic Pursuit added to smallbox
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Fri, 12 Aug 2011 11:17:47 +0100 |
parents | 31d2864dfdd4 |
children | b14209313ba4 |
line wrap: on
line diff
--- a/util/SMALL_solve.m Fri Jul 29 12:35:52 2011 +0100 +++ b/util/SMALL_solve.m Fri Aug 12 11:17:47 2011 +0100 @@ -48,7 +48,11 @@ if strcmpi(solver.toolbox,'sparselab') y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']); elseif strcmpi(solver.toolbox,'sparsify') - y = eval([solver.name,'(b, A, n, ''P_trans'', AT,',solver.param,');']); + if isa(Problem.A,'float') + y = eval([solver.name,'(b, A, n,',solver.param,');']); + else + y = eval([solver.name,'(b, A, n, ''P_trans'', AT,',solver.param,');']); + end elseif (strcmpi(solver.toolbox,'spgl1')||strcmpi(solver.toolbox,'gpsr')) y = eval([solver.name,'(b, A,',solver.param,');']); elseif (strcmpi(solver.toolbox,'SPAMS')) @@ -66,27 +70,35 @@ y = eval([solver.name,'(A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); elseif (strcmpi(solver.toolbox, 'ompsbox')) basedict = Problem.basedict; - if issparse(Problem.A) + if issparse(Problem.A) A = Problem.A; - else + else A = sparse(Problem.A); - end + end G = dicttsep(basedict,A,dictsep(basedict,A,speye(size(A,2)))); epsilon=solver.param.epsilon; maxatoms=solver.param.maxatoms; y = eval([solver.name,'(basedict, A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); Problem.sparse=1; -% To introduce new sparse representation algorithm put the files in -% your Matlab path. Next, unique name <TolboxID> for your toolbox and -% prefferd API <Preffered_API> needs to be defined. -% -% elseif strcmpi(solver.toolbox,'<ToolboxID>') -% -% % - Evaluate the function (solver.name - defined in the main) with -% % parameters given above -% -% y = eval([solver.name,'(<Preffered_API>);']); - +elseif (strcmpi(solver.toolbox, 'ALPS')) + if ~isa(Problem.A,'float') + % ALPS does not accept implicit dictionary definition + A = opToMatrix(Problem.A, 1); + end + [y, numiter, time, y_path] = wrapper_ALPS_toolbox(b, A, solver.param); + + + % To introduce new sparse representation algorithm put the files in + % your Matlab path. Next, unique name <TolboxID> for your toolbox and + % prefferd API <Preffered_API> needs to be defined. + % + % elseif strcmpi(solver.toolbox,'<ToolboxID>') + % + % % - Evaluate the function (solver.name - defined in the main) with + % % parameters given above + % + % y = eval([solver.name,'(<Preffered_API>);']); + else printf('\nToolbox has not been registered. Please change SMALL_solver file.\n'); return