Home > solver > TEBD_GetInitialScaling_NC_v2_2.m

TEBD_GetInitialScaling_NC_v2_2

PURPOSE ^

Obtain initial scaling parameter: Get the scaling parameter such that the

SYNOPSIS ^

function theta = TEBD_GetInitialScaling_NC_v2_2(prob,x,u,sigma)

DESCRIPTION ^

Obtain initial scaling parameter: Get the scaling parameter such that the
scaling residuals are balanced. Does NOT allows cell defined variables 
and does NOT use the explicit dual variables to compute the residuals. 
%******************************************************************
%
%   theta = TEBD_GetInitialScaling_NC_v2_2(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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 %Obtain initial scaling parameter: Get the scaling parameter such that the
0002 %scaling residuals are balanced. Does NOT allows cell defined variables
0003 %and does NOT use the explicit dual variables to compute the residuals.
0004 %%******************************************************************
0005 %%
0006 %%   theta = TEBD_GetInitialScaling_NC_v2_2(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_NC_v2_2(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 gradf_x_plus_u = gradf_x+u;
0054 [x_tilde,~] = prob.resolvent1(x - gradf_x_plus_u*(theta*lambda),Z_tilde,lambda*theta);
0055 
0056 % perform 2nd prox using Moreau's identity
0057 u_plus_lambda_x = (u +x_tilde*lambda);
0058 [resolv2] = prob.resolvent2(u_plus_lambda_x/lambda,lambda);
0059 u_tilde = u_plus_lambda_x - resolv2*lambda;
0060 
0061 v_1 = (((x-x_tilde)/lambda) +((u_tilde-u)*theta));
0062 v_2 = ((u-u_tilde)/lambda);
0063 
0064 %% Obtain the residuals relevant to each problem
0065 dh2 = v_2+x_tilde;
0066 dh1 = v_1/theta - gradf_x - u_tilde;
0067 
0068 obj = prob.evalf2(x_tilde,u_tilde,dh2,dh1);
0069 residuals = prob.residuals2(x_tilde,u_tilde,v_1/theta,v_2,obj);
0070 
0071 res1 = residuals.pfeas;
0072 res2 = residuals.dfeas;
0073 end

Generated on Tue 06-Aug-2013 17:07:59 by m2html © 2005