ivan@140: function solver = SMALL_init_solver(toolbox, name, param, profile) ivan@128: %% Function initialise SMALL structure for sparse representation. ivan@128: % Optional input variables: ivan@128: % toolbox - name of Dictionary Learning toolbox you want to use ivan@128: % name - name of the algorithm from above toolbox ivan@128: % param - parameters you want to set ivan@128: idamnjanovic@24: % idamnjanovic@24: % Centre for Digital Music, Queen Mary, University of London. idamnjanovic@24: % This file copyright 2010 Ivan Damnjanovic. idamnjanovic@24: % idamnjanovic@24: % This program is free software; you can redistribute it and/or idamnjanovic@24: % modify it under the terms of the GNU General Public License as idamnjanovic@24: % published by the Free Software Foundation; either version 2 of the idamnjanovic@24: % License, or (at your option) any later version. See the file idamnjanovic@24: % COPYING included with this distribution for more information. idamnjanovic@24: % idamnjanovic@24: %% idamnjanovic@24: ivan@140: if ~ exist( 'toolbox', 'var' ) || isempty(toolbox) ivan@140: solver.toolbox = []; ivan@140: else ivan@140: solver.toolbox = toolbox; ivan@140: end ivan@140: if ~ exist( 'name', 'var' ) || isempty(name) ivan@140: solver.name = []; ivan@140: else ivan@140: solver.name = name; ivan@140: end ivan@140: if ~ exist( 'param', 'var' ) || isempty(param) ivan@140: solver.param = []; ivan@140: else ivan@140: solver.param = param; ivan@140: end ivan@140: if ~ exist( 'profile', 'var' ) || isempty(profile) ivan@140: solver.profile = 1; ivan@140: else ivan@140: solver.profile = profile; ivan@140: end ivan@140: solver.add_constraints = 0; ivan@140: solver.solution = []; ivan@140: solver.reconstructed = []; ivan@140: solver.time = []; idamnjanovic@24: idamnjanovic@8: end