diff util/SMALL_init_solver.m @ 144:19e0af570914 release_1.5

Merge from branch "ivand_dev"
author Ivan <ivan.damnjanovic@eecs.qmul.ac.uk>
date Tue, 26 Jul 2011 15:14:15 +0100
parents 31d2864dfdd4
children
line wrap: on
line diff
--- a/util/SMALL_init_solver.m	Tue Jul 26 15:13:29 2011 +0100
+++ b/util/SMALL_init_solver.m	Tue Jul 26 15:14:15 2011 +0100
@@ -1,4 +1,4 @@
-function solver = SMALL_init_solver(varargin)
+function solver = SMALL_init_solver(toolbox, name, param, profile)
 %%   Function initialise SMALL structure for sparse representation.
 %   Optional input variables:
 %       toolbox - name of Dictionary Learning toolbox you want to use
@@ -17,11 +17,29 @@
 %
 %%
 
-solver.toolbox=[];
-solver.name=[];
-solver.param=[];
-solver.solution=[];
-solver.reconstructed=[];
-solver.time=[];
+if ~ exist( 'toolbox', 'var' ) || isempty(toolbox) 
+    solver.toolbox = []; 
+else
+    solver.toolbox = toolbox;
+end
+if ~ exist( 'name', 'var' ) || isempty(name) 
+    solver.name = [];
+else
+    solver.name = name;
+end
+if ~ exist( 'param', 'var' ) || isempty(param) 
+    solver.param = [];
+else
+    solver.param = param;
+end
+if ~ exist( 'profile', 'var' ) || isempty(profile) 
+    solver.profile = 1;
+else
+    solver.profile = profile;
+end
+solver.add_constraints = 0;
+solver.solution = [];
+solver.reconstructed = [];
+solver.time = [];
 
 end
\ No newline at end of file