comparison config/SMALL_solve_config.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
children c1efdd5d6250
comparison
equal deleted inserted replaced
198:83af80baf959 199:751fa3bddd30
1 %% Configuration file used in SMALL_solve
2 %
3 % Use this file to change the solvers in SMALLBox
4 % Please refer to the documentation before editing this file
5
6 % Centre for Digital Music, Queen Mary, University of London.
7 % This file copyright 2009 Ivan Damnjanovic.
8 %
9 % This program is free software; you can redistribute it and/or
10 % modify it under the terms of the GNU General Public License as
11 % published by the Free Software Foundation; either version 2 of the
12 % License, or (at your option) any later version. See the file
13 % COPYING included with this distribution for more information.
14 %
15 %%
16
17 if strcmpi(solver.toolbox,'sparselab')
18 y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']);
19 elseif strcmpi(solver.toolbox,'sparsify')
20 if isa(Problem.A,'float')
21 y = eval([solver.name,'(b, A, n,',solver.param,');']);
22 else
23 y = eval([solver.name,'(b, A, n, ''P_trans'', AT,',solver.param,');']);
24 end
25 elseif (strcmpi(solver.toolbox,'spgl1')||strcmpi(solver.toolbox,'gpsr'))
26 y = eval([solver.name,'(b, A,',solver.param,');']);
27 elseif (strcmpi(solver.toolbox,'SPAMS'))
28 y = eval([solver.name,'(b, A, solver.param);']);
29 elseif (strcmpi(solver.toolbox,'SMALL'))
30 if isa(Problem.A,'float')
31 y = eval([solver.name,'(A, b, n,',solver.param,');']);
32 else
33 y = eval([solver.name,'(A, b, n,',solver.param,',AT);']);
34 end
35 elseif (strcmpi(solver.toolbox, 'ompbox'))
36 G=A'*A;
37 epsilon=solver.param.epsilon;
38 maxatoms=solver.param.maxatoms;
39 y = eval([solver.name,'(A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
40 elseif (strcmpi(solver.toolbox, 'ompsbox'))
41 basedict = Problem.basedict;
42 if issparse(Problem.A)
43 A = Problem.A;
44 else
45 A = sparse(Problem.A);
46 end
47 G = dicttsep(basedict,A,dictsep(basedict,A,speye(size(A,2))));
48 epsilon=solver.param.epsilon;
49 maxatoms=solver.param.maxatoms;
50 y = eval([solver.name,'(basedict, A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
51 Problem.sparse=1;
52 elseif (strcmpi(solver.toolbox, 'ALPS'))
53 if ~isa(Problem.A,'float')
54 % ALPS does not accept implicit dictionary definition
55 A = opToMatrix(Problem.A, 1);
56 end
57 [y, numiter, time, y_path] = wrapper_ALPS_toolbox(b, A, solver.param);
58 elseif (strcmpi(solver.toolbox, 'MMbox'))
59 if ~isa(Problem.A,'float')
60 % MMbox does not accept implicit dictionary definition
61 A = opToMatrix(Problem.A, 1);
62 end
63
64 [y, cost] = wrapper_mm_solver(b, A, solver.param);
65
66 % To introduce new sparse representation algorithm put the files in
67 % your Matlab path. Next, unique name <TolboxID> for your toolbox and
68 % prefferd API <Preffered_API> needs to be defined.
69 %
70 % elseif strcmpi(solver.toolbox,'<ToolboxID>')
71 %
72 % % - Evaluate the function (solver.name - defined in the main) with
73 % % parameters given above
74 %
75 % y = eval([solver.name,'(<Preffered_API>);']);
76
77 else
78 printf('\nToolbox has not been registered. Please change SMALL_solver file.\n');
79 return
80 end