diff util/SMALL_solve.m @ 199:751fa3bddd30 luisf_dev

Added config file for SMALL_solve (removed the if/else code from SMALL_solve); added headers to both config files;
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 20 Mar 2012 14:28:51 +0000
parents f42aa8bcb82f
children f3b6ddd2f04f
line wrap: on
line diff
--- a/util/SMALL_solve.m	Tue Mar 20 12:29:47 2012 +0000
+++ b/util/SMALL_solve.m	Tue Mar 20 14:28:51 2012 +0000
@@ -15,9 +15,11 @@
 %   published by the Free Software Foundation; either version 2 of the
 %   License, or (at your option) any later version.  See the file
 %   COPYING included with this distribution for more information.
-%   
+%
 %%
 
+global SMALL_path
+
 if isa(Problem.A,'float')
     A = Problem.A;
     SparseLab_A=Problem.A;
@@ -45,72 +47,9 @@
 
 start=cputime;
 tStart=tic;
-if strcmpi(solver.toolbox,'sparselab')
-    y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']);
-elseif strcmpi(solver.toolbox,'sparsify')
-    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'))
-    y = eval([solver.name,'(b, A, solver.param);']);
-elseif (strcmpi(solver.toolbox,'SMALL'))
-    if isa(Problem.A,'float')
-        y = eval([solver.name,'(A, b, n,',solver.param,');']);
-    else
-        y = eval([solver.name,'(A, b, n,',solver.param,',AT);']);
-    end
-elseif (strcmpi(solver.toolbox, 'ompbox'))
-    G=A'*A;
-    epsilon=solver.param.epsilon;
-    maxatoms=solver.param.maxatoms;
-    y = eval([solver.name,'(A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
-elseif (strcmpi(solver.toolbox, 'ompsbox'))
-    basedict = Problem.basedict;
-    if issparse(Problem.A)
-        A = Problem.A;
-    else
-        A = sparse(Problem.A);
-    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;
-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);
-elseif (strcmpi(solver.toolbox, 'MMbox'))
-    if ~isa(Problem.A,'float')
-        % MMbox does not accept implicit dictionary definition
-        A = opToMatrix(Problem.A, 1);
-    end
-    
-    [y, cost] = wrapper_mm_solver(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
-end
+
+% solvers configuration file
+run(fullfile(SMALL_path, 'config/SMALL_solve_config.m'));
 
 %%
 %   Sparse representation time