Weighted analytic center of a set of linear inequalities

% Joëlle Skaf - 04/29/08
%
% The weighted analytic center of a set of linear inequalities:
%           a_i^Tx <= b_i   i=1,...,m,
% is the solution of the unconstrained minimization problem
%           minimize    -sum_{i=1}^m w_i*log(b_i-a_i^Tx),
% where w_i>0

% Input data
randn('state', 0);
rand('state', 0);
n = 10;
m = 50;
tmp = randn(n,1);
A = randn(m,n);
b = A*tmp + 2*rand(m,1);
w = rand(m,1);

% Analytic center
cvx_begin
    variable x(n)
    minimize -sum(w.*log(b-A*x))
cvx_end

disp('The weighted analytic center of the set of linear inequalities is: ');
disp(x);
 
Successive approximation method to be employed.
   For improved efficiency, sedumi is solving the dual problem.
   sedumi will be called several times to refine the solution.
   Original size: 150 variables, 60 equality constraints
   50 exponentials add 400 variables, 250 equality constraints
-----------------------------------------------------------------
          Errors   
Act Centering    Conic    Status
-----------------------------------
50  3.534e+00  1.215e+00  Solved
50  3.015e-01  7.641e-03  Solved
50  1.751e-02  2.422e-05  Solved
50  2.259e-03  6.714e-07  Solved
50  2.831e-04  4.010e-07  Solved
50  3.706e-04S 1.109e-08  Solved
50  6.259e-05  0.000e+00  Solved
-----------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +5.99254
The weighted analytic center of the set of linear inequalities is: 
   -0.5100
   -1.4794
    0.3397
    0.1944
   -1.0444
    1.1956
    1.3927
   -0.2815
    0.2863
    0.3779