comparison config/SMALL_solve_config.m @ 224:fd0b5d36f6ad danieleb

Updated the contents of this branch with the contents of the default branch.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 12 Apr 2012 13:52:28 +0100
parents c1efdd5d6250
children 198d4d9cee74
comparison
equal deleted inserted replaced
196:82b0d3f982cb 224:fd0b5d36f6ad
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 % danieleb: added call to omp functions with fast implementation.
41 elseif (strcmpi(solver.toolbox, 'ompbox_fast'))
42 DtX=A'*b;
43 XtX = sum(b.*b);
44 G=A'*A;
45 epsilon=solver.param.epsilon;
46 maxatoms=solver.param.maxatoms;
47 y = eval([solver.name,'(DtX, XtX, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
48 elseif (strcmpi(solver.toolbox, 'ompsbox'))
49 basedict = Problem.basedict;
50 if issparse(Problem.A)
51 A = Problem.A;
52 else
53 A = sparse(Problem.A);
54 end
55 G = dicttsep(basedict,A,dictsep(basedict,A,speye(size(A,2))));
56 epsilon=solver.param.epsilon;
57 maxatoms=solver.param.maxatoms;
58 y = eval([solver.name,'(basedict, A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
59 Problem.sparse=1;
60 elseif (strcmpi(solver.toolbox, 'ALPS'))
61 if ~isa(Problem.A,'float')
62 % ALPS does not accept implicit dictionary definition
63 A = opToMatrix(Problem.A, 1);
64 end
65 [y, numiter, time, y_path] = wrapper_ALPS_toolbox(b, A, solver.param);
66 elseif (strcmpi(solver.toolbox, 'MMbox'))
67 if ~isa(Problem.A,'float')
68 % MMbox does not accept implicit dictionary definition
69 A = opToMatrix(Problem.A, 1);
70 end
71
72 [y, cost] = wrapper_mm_solver(b, A, solver.param);
73
74 % To introduce new sparse representation algorithm put the files in
75 % your Matlab path. Next, unique name <TolboxID> for your toolbox and
76 % prefferd API <Preffered_API> needs to be defined.
77 %
78 % elseif strcmpi(solver.toolbox,'<ToolboxID>')
79 %
80 % % - Evaluate the function (solver.name - defined in the main) with
81 % % parameters given above
82 %
83 % y = eval([solver.name,'(<Preffered_API>);']);
84
85 else
86 printf('\nToolbox has not been registered. Please change SMALL_solver file.\n');
87 return
88 end