luis@199: %% Configuration file used in SMALL_solve luis@199: % luis@228: % Please DO NOT use this file to change the solvers used in SMALLBox luis@228: % If you want to change the solvers create a copy luis@228: % of this file named 'SMALL_learn_config_local.m' luis@228: % luis@228: % Please refer to the documentation for further information luis@199: luis@199: % Centre for Digital Music, Queen Mary, University of London. luis@199: % This file copyright 2009 Ivan Damnjanovic. luis@199: % luis@199: % This program is free software; you can redistribute it and/or luis@199: % modify it under the terms of the GNU General Public License as luis@199: % published by the Free Software Foundation; either version 2 of the luis@199: % License, or (at your option) any later version. See the file luis@199: % COPYING included with this distribution for more information. luis@199: % luis@199: %% luis@199: luis@228: luis@199: if strcmpi(solver.toolbox,'sparselab') luis@199: y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']); luis@199: elseif strcmpi(solver.toolbox,'sparsify') luis@199: if isa(Problem.A,'float') luis@199: y = eval([solver.name,'(b, A, n,',solver.param,');']); luis@199: else luis@199: y = eval([solver.name,'(b, A, n, ''P_trans'', AT,',solver.param,');']); luis@199: end luis@199: elseif (strcmpi(solver.toolbox,'spgl1')||strcmpi(solver.toolbox,'gpsr')) luis@199: y = eval([solver.name,'(b, A,',solver.param,');']); luis@199: elseif (strcmpi(solver.toolbox,'SPAMS')) luis@199: y = eval([solver.name,'(b, A, solver.param);']); luis@199: elseif (strcmpi(solver.toolbox,'SMALL')) luis@199: if isa(Problem.A,'float') luis@199: y = eval([solver.name,'(A, b, n,',solver.param,');']); luis@199: else luis@199: y = eval([solver.name,'(A, b, n,',solver.param,',AT);']); luis@199: end luis@199: elseif (strcmpi(solver.toolbox, 'ompbox')) luis@199: G=A'*A; luis@199: epsilon=solver.param.epsilon; luis@199: maxatoms=solver.param.maxatoms; luis@199: y = eval([solver.name,'(A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); luis@228: % danieleb: added call to omp functions with fast implementation. daniele@221: elseif (strcmpi(solver.toolbox, 'ompbox_fast')) daniele@221: DtX=A'*b; luis@228: XtX = sum(b.*b); luis@228: G=A'*A; daniele@221: epsilon=solver.param.epsilon; daniele@221: maxatoms=solver.param.maxatoms; daniele@221: y = eval([solver.name,'(DtX, XtX, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); luis@199: elseif (strcmpi(solver.toolbox, 'ompsbox')) luis@199: basedict = Problem.basedict; luis@199: if issparse(Problem.A) luis@199: A = Problem.A; luis@199: else luis@199: A = sparse(Problem.A); luis@199: end luis@199: G = dicttsep(basedict,A,dictsep(basedict,A,speye(size(A,2)))); luis@199: epsilon=solver.param.epsilon; luis@199: maxatoms=solver.param.maxatoms; luis@199: y = eval([solver.name,'(basedict, A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); luis@199: Problem.sparse=1; luis@199: elseif (strcmpi(solver.toolbox, 'ALPS')) luis@199: if ~isa(Problem.A,'float') luis@199: % ALPS does not accept implicit dictionary definition luis@199: A = opToMatrix(Problem.A, 1); luis@199: end luis@199: [y, numiter, time, y_path] = wrapper_ALPS_toolbox(b, A, solver.param); luis@199: elseif (strcmpi(solver.toolbox, 'MMbox')) luis@199: if ~isa(Problem.A,'float') luis@199: % MMbox does not accept implicit dictionary definition luis@199: A = opToMatrix(Problem.A, 1); luis@199: end luis@199: luis@199: [y, cost] = wrapper_mm_solver(b, A, solver.param); luis@199: luis@228: %% luis@228: % Please do not make any changes to the 'SMALL_solve_config.m' file luis@228: % All the changes should be done to your local configuration file luis@228: % named 'SMALL_solve_config_local.m' luis@228: % luis@199: % To introduce new sparse representation algorithm put the files in luis@199: % your Matlab path. Next, unique name for your toolbox and luis@199: % prefferd API needs to be defined. luis@199: % luis@199: % elseif strcmpi(solver.toolbox,'') luis@199: % luis@199: % % - Evaluate the function (solver.name - defined in the main) with luis@199: % % parameters given above luis@199: % luis@199: % y = eval([solver.name,'();']); luis@199: luis@199: else luis@199: printf('\nToolbox has not been registered. Please change SMALL_solver file.\n'); luis@199: return luis@199: end