Skip to content

Commit

Permalink
Bug fixes in simplex and new prox_diag code
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenbeckr committed Jun 21, 2016
1 parent 8bae116 commit eb46447
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion private/tfocs_iterate.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@
if saddle,
% errs(err_j) = errFcn{err_j}(f_w,x,out.dual);
% April 14 '14
if isempty( get_dual(cur_dual) )
%if isempty( get_dual(cur_dual) )
% March 10 '15
if isempty(cur_dual) || isempty( get_dual(cur_dual) )
errs(err_j) = errFcn{err_j}(f_v,cur_pri,0);
else
errs(err_j) = errFcn{err_j}(f_v,cur_pri,get_dual(cur_dual));
Expand Down
2 changes: 1 addition & 1 deletion proj_simplex.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
% VECTORIZE = true;

if nargin > 4 && t > 0,
if any( x(:) < 0 ) || any( sum( x ) > q ),
if any( x(:) < 0 ) || any( sum( x ) > q ) || ( EQ && norm( sum( x ) - q)>1e-8/norm(q) )
if VECTORIZE
s = sort( x(:), 'descend' );
else
Expand Down
2 changes: 1 addition & 1 deletion prox_diag.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
elseif ~isa( funcG, 'function_handle' ),
error( 'The second argument must be a function handle.' );
end
op = @(varargin)prox_diag_impl( funcF, funcF, n, varargin{:} );
op = @(varargin)prox_diag_impl( funcF, funcG, n, varargin{:} );


function [ v, x ] = prox_diag_impl( prox_f, prox_g, n, x, t )
Expand Down

0 comments on commit eb46447

Please sign in to comment.