comparison util/SMALL_solve.m @ 140:31d2864dfdd4 ivand_dev

Audio Impainting additional constraints with cvx added
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Mon, 25 Jul 2011 17:27:05 +0100
parents 8e660fd14774
children 0de08f68256b a4d0977d4595
comparison
equal deleted inserted replaced
139:4bd6856a7128 140:31d2864dfdd4
37 b = Problem.b1; 37 b = Problem.b1;
38 else 38 else
39 b = Problem.b; % The right-hand-side vector. 39 b = Problem.b; % The right-hand-side vector.
40 end 40 end
41 %% 41 %%
42 fprintf('\nStarting solver %s... \n', solver.name); 42 if (solver.profile)
43 fprintf('\nStarting solver %s... \n', solver.name);
44 end
45
43 start=cputime; 46 start=cputime;
44 tStart=tic; 47 tStart=tic;
45 if strcmpi(solver.toolbox,'sparselab') 48 if strcmpi(solver.toolbox,'sparselab')
46 y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']); 49 y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']);
47 elseif strcmpi(solver.toolbox,'sparsify') 50 elseif strcmpi(solver.toolbox,'sparsify')
91 94
92 %% 95 %%
93 % Sparse representation time 96 % Sparse representation time
94 tElapsed=toc(tStart); 97 tElapsed=toc(tStart);
95 solver.time = cputime - start; 98 solver.time = cputime - start;
96 fprintf('Solver %s finished task in %2f seconds (cpu time). \n', solver.name, solver.time); 99 if (solver.profile)
97 fprintf('Solver %s finished task in %2f seconds (tic-toc time). \n', solver.name, tElapsed); 100 fprintf('Solver %s finished task in %2f seconds (cpu time). \n', solver.name, solver.time);
101 fprintf('Solver %s finished task in %2f seconds (tic-toc time). \n', solver.name, tElapsed);
102 end
98 solver.time=tElapsed; 103 solver.time=tElapsed;
99 % geting around out of memory problem when converting big matrix from 104 % geting around out of memory problem when converting big matrix from
100 % sparse to full... 105 % sparse to full...
101 106
102 if isfield(Problem, 'sparse')&&(Problem.sparse==1) 107 if isfield(Problem, 'sparse')&&(Problem.sparse==1)
103 solver.solution = y; 108 solver.solution = y;
104 else 109 else
105 solver.solution = full(y); 110 solver.solution = full(y);
106 end 111 end
107 if isfield(Problem,'reconstruct') 112 if isfield(Problem,'reconstruct')
108 % Reconstruct the signal from the solution 113 % Reconstruct the signal from the solution
109 solver.reconstructed = Problem.reconstruct(solver.solution); 114 solver.reconstructed = Problem.reconstruct(solver.solution);
110 end 115 end
111 end 116 end