One free point localization
n = 2;
K = 11;
randn('state',0);
P = randn(n,K);
fprintf(1,'Minimizing the sum of the squares the distances to fixed points...');
cvx_begin
variable x(2)
minimize ( sum( square_pos( norms(x*ones(1,K) - P,2) ) ) )
cvx_end
fprintf(1,'Done! \n');
disp('------------------------------------------------------------------');
disp('The optimal point location is: ');
disp(x);
disp('The average location of the fixed points is');
disp(sum(P,2)/K);
disp('They are the same as expected!');
Minimizing the sum of the squares the distances to fixed points...
Calling SDPT3: 77 variables, 35 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------
num. of constraints = 35
dim. of sdp var = 22, num. of sdp blk = 11
dim. of socp var = 33, num. of socp blk = 11
dim. of linear var = 11
*******************************************************************
SDPT3: Infeasible path-following algorithms
*******************************************************************
version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap mean(obj) cputime
-------------------------------------------------------------------
0|0.000|0.000|4.3e+00|3.6e+00|6.5e+02| 2.200000e+01| 0:0:00| chol 1 1
1|0.890|0.763|4.7e-01|9.2e-01|1.6e+02|-3.891138e+00| 0:0:00| chol 1 1
2|0.996|0.838|1.7e-03|1.6e-01|4.7e+01|-1.770238e+01| 0:0:00| chol 1 1
3|0.913|0.889|1.5e-04|1.8e-02|6.3e+00|-1.716402e+01| 0:0:00| chol 1 1
4|1.000|1.000|1.1e-07|1.3e-04|2.2e+00|-1.698325e+01| 0:0:00| chol 1 1
5|0.978|0.925|2.0e-08|1.9e-05|2.0e-01|-1.673558e+01| 0:0:00| chol 1 1
6|1.000|0.960|8.9e-09|1.7e-06|1.6e-02|-1.668730e+01| 0:0:00| chol 1 1
7|0.977|0.978|3.4e-09|1.4e-07|4.5e-04|-1.668322e+01| 0:0:00| chol 1 1
8|0.984|0.986|1.2e-10|2.6e-09|6.6e-06|-1.668312e+01| 0:0:00| chol 1 1
9|1.000|0.994|8.6e-12|4.1e-11|1.9e-07|-1.668312e+01| 0:0:00|
stop: max(relative gap, infeasibilities) < 1.49e-08
-------------------------------------------------------------------
number of iterations = 9
primal objective value = -1.66831188e+01
dual objective value = -1.66831190e+01
gap := trace(XZ) = 1.86e-07
relative gap = 5.41e-09
actual relative gap = 5.32e-09
rel. primal infeas = 8.60e-12
rel. dual infeas = 4.12e-11
norm(X), norm(y), norm(Z) = 1.7e+01, 8.1e+00, 1.1e+01
norm(A), norm(b), norm(C) = 1.0e+01, 4.3e+00, 6.3e+00
Total CPU time (secs) = 0.3
CPU time per iteration = 0.0
termination code = 0
DIMACS: 1.9e-11 0.0e+00 8.1e-11 0.0e+00 5.3e-09 5.4e-09
-------------------------------------------------------------------
------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +16.6831
Done!
------------------------------------------------------------------
The optimal point location is:
0.0379
0.0785
The average location of the fixed points is
0.0379
0.0785
They are the same as expected!