comparison solvers/SMALL_chol.m @ 63:e08af264ef93

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:23:35 +0000
parents 524cc3fff5ac
children f6cedfec9ffb
comparison
equal deleted inserted replaced
62:92a9b18c3bd3 63:e08af264ef93
27 % This Dictionary check is based on Thomas Blumensath work in sparsify 0_4 greedy solvers 27 % This Dictionary check is based on Thomas Blumensath work in sparsify 0_4 greedy solvers
28 explicitD=0; 28 explicitD=0;
29 if isa(Dict,'float') 29 if isa(Dict,'float')
30 D =@(z) Dict*z; 30 D =@(z) Dict*z;
31 Dt =@(z) Dict'*z; 31 Dt =@(z) Dict'*z;
32 explicitD=1; 32 explicitD=0;
33 elseif isobject(Dict) 33 elseif isobject(Dict)
34 D =@(z) Dict*z; 34 D =@(z) Dict*z;
35 Dt =@(z) Dict'*z; 35 Dt =@(z) Dict'*z;
36 elseif isa(Dict,'function_handle') 36 elseif isa(Dict,'function_handle')
37 try 37 try
38 DictT=varargin{1}; 38 DictT=varargin{1};
39 if isa(DictT,'function_handle'); 39 if isa(DictT,'function_handle');
40 D=Dict; 40 D=@(z)Dict(z,1);
41 Dt=DictT; 41 Dt=@(z)Dict(z,2);
42 else 42 else
43 error('If Dictionary is a function handle,Transpose Dictionary also needs to be a function handle. '); 43 error('If Dictionary is a function handle,Transpose Dictionary also needs to be a function handle. ');
44 end 44 end
45 catch 45 catch
46 error('If Dictionary is a function handle, Transpose Dictionary needs to be specified. Exiting.'); 46 error('If Dictionary is a function handle, Transpose Dictionary needs to be specified. Exiting.');
65 x=X(:,k); 65 x=X(:,k);
66 residual=x; 66 residual=x;
67 indx = []; 67 indx = [];
68 a = zeros(m,1); 68 a = zeros(m,1);
69 currResNorm = norm(residual); 69 currResNorm = norm(residual);
70 errorGoal=errorGoal*currResNorm; 70 errorGoal1=errorGoal*currResNorm;
71 j = 0; 71 j = 0;
72 while currResNorm>errorGoal & j < maxNumCoef, 72 while currResNorm>errorGoal & j < maxNumCoef,
73 j = j+1; 73 j = j+1;
74 dir=Dt(residual); 74 dir=Dt(residual);
75 75