annotate config/SMALL_solve_config.m @ 239:71128ec3e532 ver_2.0_beta

added documentation file/folder
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Wed, 25 Apr 2012 13:06:28 +0100
parents 198d4d9cee74
children 5c8bcdadb380
rev   line source
luis@199 1 %% Configuration file used in SMALL_solve
luis@199 2 %
luis@228 3 % Please DO NOT use this file to change the solvers used in SMALLBox
luis@228 4 % If you want to change the solvers create a copy
luis@228 5 % of this file named 'SMALL_learn_config_local.m'
luis@228 6 %
luis@228 7 % Please refer to the documentation for further information
luis@199 8
luis@199 9 % Centre for Digital Music, Queen Mary, University of London.
luis@199 10 % This file copyright 2009 Ivan Damnjanovic.
luis@199 11 %
luis@199 12 % This program is free software; you can redistribute it and/or
luis@199 13 % modify it under the terms of the GNU General Public License as
luis@199 14 % published by the Free Software Foundation; either version 2 of the
luis@199 15 % License, or (at your option) any later version. See the file
luis@199 16 % COPYING included with this distribution for more information.
luis@199 17 %
luis@199 18 %%
luis@199 19
luis@228 20
luis@199 21 if strcmpi(solver.toolbox,'sparselab')
luis@199 22 y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']);
luis@199 23 elseif strcmpi(solver.toolbox,'sparsify')
luis@199 24 if isa(Problem.A,'float')
luis@199 25 y = eval([solver.name,'(b, A, n,',solver.param,');']);
luis@199 26 else
luis@199 27 y = eval([solver.name,'(b, A, n, ''P_trans'', AT,',solver.param,');']);
luis@199 28 end
luis@199 29 elseif (strcmpi(solver.toolbox,'spgl1')||strcmpi(solver.toolbox,'gpsr'))
luis@199 30 y = eval([solver.name,'(b, A,',solver.param,');']);
luis@199 31 elseif (strcmpi(solver.toolbox,'SPAMS'))
luis@199 32 y = eval([solver.name,'(b, A, solver.param);']);
luis@199 33 elseif (strcmpi(solver.toolbox,'SMALL'))
luis@199 34 if isa(Problem.A,'float')
luis@199 35 y = eval([solver.name,'(A, b, n,',solver.param,');']);
luis@199 36 else
luis@199 37 y = eval([solver.name,'(A, b, n,',solver.param,',AT);']);
luis@199 38 end
luis@199 39 elseif (strcmpi(solver.toolbox, 'ompbox'))
luis@199 40 G=A'*A;
luis@199 41 epsilon=solver.param.epsilon;
luis@199 42 maxatoms=solver.param.maxatoms;
luis@199 43 y = eval([solver.name,'(A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
luis@228 44 % danieleb: added call to omp functions with fast implementation.
daniele@221 45 elseif (strcmpi(solver.toolbox, 'ompbox_fast'))
daniele@221 46 DtX=A'*b;
luis@228 47 XtX = sum(b.*b);
luis@228 48 G=A'*A;
daniele@221 49 epsilon=solver.param.epsilon;
daniele@221 50 maxatoms=solver.param.maxatoms;
daniele@221 51 y = eval([solver.name,'(DtX, XtX, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
luis@199 52 elseif (strcmpi(solver.toolbox, 'ompsbox'))
luis@199 53 basedict = Problem.basedict;
luis@199 54 if issparse(Problem.A)
luis@199 55 A = Problem.A;
luis@199 56 else
luis@199 57 A = sparse(Problem.A);
luis@199 58 end
luis@199 59 G = dicttsep(basedict,A,dictsep(basedict,A,speye(size(A,2))));
luis@199 60 epsilon=solver.param.epsilon;
luis@199 61 maxatoms=solver.param.maxatoms;
luis@199 62 y = eval([solver.name,'(basedict, A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']);
luis@199 63 Problem.sparse=1;
luis@199 64 elseif (strcmpi(solver.toolbox, 'ALPS'))
luis@199 65 if ~isa(Problem.A,'float')
luis@199 66 % ALPS does not accept implicit dictionary definition
luis@199 67 A = opToMatrix(Problem.A, 1);
luis@199 68 end
luis@199 69 [y, numiter, time, y_path] = wrapper_ALPS_toolbox(b, A, solver.param);
luis@199 70 elseif (strcmpi(solver.toolbox, 'MMbox'))
luis@199 71 if ~isa(Problem.A,'float')
luis@199 72 % MMbox does not accept implicit dictionary definition
luis@199 73 A = opToMatrix(Problem.A, 1);
luis@199 74 end
luis@199 75
luis@199 76 [y, cost] = wrapper_mm_solver(b, A, solver.param);
luis@199 77
luis@228 78 %%
luis@228 79 % Please do not make any changes to the 'SMALL_solve_config.m' file
luis@228 80 % All the changes should be done to your local configuration file
luis@228 81 % named 'SMALL_solve_config_local.m'
luis@228 82 %
luis@199 83 % To introduce new sparse representation algorithm put the files in
luis@199 84 % your Matlab path. Next, unique name <TolboxID> for your toolbox and
luis@199 85 % prefferd API <Preffered_API> needs to be defined.
luis@199 86 %
luis@199 87 % elseif strcmpi(solver.toolbox,'<ToolboxID>')
luis@199 88 %
luis@199 89 % % - Evaluate the function (solver.name - defined in the main) with
luis@199 90 % % parameters given above
luis@199 91 %
luis@199 92 % y = eval([solver.name,'(<Preffered_API>);']);
luis@199 93
luis@199 94 else
luis@199 95 printf('\nToolbox has not been registered. Please change SMALL_solver file.\n');
luis@199 96 return
luis@199 97 end