Obtain initial scaling parameter: Get the scaling parameter such that the scaling residuals are balanced. Allows cell defined variables and uses the explicit dual variables to compute the residuals. %****************************************************************** % % theta = TEBD_GetInitialScaling_v2_1(prob,x,u,sigma) % % INPUT: prob = (struct) problem definition % x = the initial point x (1st block variable) % u = the initial point u (2nd block variable) % sigma = sgima parameter of 2EBD-HPE % % % OUTPUT: theta = the initial value of the scaling parameter % % % [1] R. D.C Monteiro, C. Ortiz and B. F. Svaiter. A first-order % block-decomposition method for solving two-easy-block structured % semidefinite programs, 2012. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 2EBD-HPE: % Modified by C.Ortiz % Last Modified: 5/31/2013
0001 %Obtain initial scaling parameter: Get the scaling parameter such that the 0002 %scaling residuals are balanced. Allows cell defined variables 0003 %and uses the explicit dual variables to compute the residuals. 0004 %%****************************************************************** 0005 %% 0006 %% theta = TEBD_GetInitialScaling_v2_1(prob,x,u,sigma) 0007 %% 0008 %% INPUT: prob = (struct) problem definition 0009 %% x = the initial point x (1st block variable) 0010 %% u = the initial point u (2nd block variable) 0011 %% sigma = sgima parameter of 2EBD-HPE 0012 %% 0013 %% 0014 %% OUTPUT: theta = the initial value of the scaling parameter 0015 %% 0016 %% 0017 %% [1] R. D.C Monteiro, C. Ortiz and B. F. Svaiter. A first-order 0018 %% block-decomposition method for solving two-easy-block structured 0019 %% semidefinite programs, 2012. 0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 %% 2EBD-HPE: 0022 %% Modified by C.Ortiz 0023 %% Last Modified: 5/31/2013 0024 0025 function theta = TEBD_GetInitialScaling_v2_1(prob,x,u,sigma) 0026 theta = 1; 0027 NotBalanced = 1; 0028 iter = 0; 0029 maxpower = 20; 0030 direction = 0; 0031 while NotBalanced && theta >= 2^-maxpower && theta <= 2^maxpower && iter <= maxpower 0032 [res1,res2] = GetFirstIterationResiduals(prob,x,u,theta,sigma); 0033 if direction ~= 2 && 2*res1 < res2 0034 direction = 1; 0035 theta = theta*2; 0036 elseif direction ~= 1 && 2*res2 < res1 0037 direction = 2; 0038 theta = theta/2; 0039 else 0040 NotBalanced = 0 ; 0041 end 0042 iter = iter + 1; 0043 end 0044 0045 end 0046 0047 function [res1,res2] = GetFirstIterationResiduals(prob,x,u,theta,sigma) 0048 lambda = sigma/sqrt(theta); 0049 Z_tilde.pos = 1; 0050 0051 % perform 1st prox 0052 gradf_x = prob.gradf(x); 0053 [x_tilde,Z_tilde] = prob.resolvent1(TEBD_ops(x,'X-alpha*(Y+X2)',gradf_x,theta*lambda,u),Z_tilde,lambda*theta); 0054 0055 % perform 2nd prox using Moreau's identity 0056 [u_plus_lambda_x_div_lambda, u_plus_lambda_x] = TEBD_ops(u ,'(X+Y*alpha)/alpha',x_tilde,lambda); 0057 [resolv2,y_tilde] = prob.resolvent2(u_plus_lambda_x_div_lambda,lambda);%recovers dual variable in y_tilde 0058 u_tilde = TEBD_ops(u_plus_lambda_x ,'-', resolv2,lambda); 0059 0060 % compute v\in T(x) or v\in T^\epsilon(x) 0061 [~, v_1_div_theta] = TEBD_ops(x,'[(X-Y)/alpha +(X2-Y2)*alpha2]/alpha2-X3-Y3',x_tilde,lambda,u_tilde,u,theta,gradf_x,u_tilde); 0062 [v_2] = TEBD_ops(u,'(X-Y)/alpha+X2',u_tilde,lambda,x_tilde); 0063 0064 0065 %% Obtain the residuals relevant to each problem 0066 obj = prob.evalf(x_tilde,y_tilde,Z_tilde); 0067 residuals = prob.residuals(x_tilde,u_tilde,v_1_div_theta,v_2,obj,y_tilde,Z_tilde,u_plus_lambda_x,lambda); 0068 0069 res1 = residuals.pfeas; 0070 res2 = residuals.dfeas; 0071 end