Builds and solves a simple least-squares problem using cvx

echo on

n = 100;
A = randn(2*n,n);
b = randn(2*n,1);
cvx_begin
   variable x(n)
   minimize( norm( A*x-b ) )
cvx_end

echo off
 
Calling SeDuMi: 301 variables (100 free), 200 equality constraints
------------------------------------------------------------------------
SeDuMi 1.1 by AdvOL, 2005 and Jos F. Sturm, 1998, 2001-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
Split 100 free variables
eqs m = 200, order n = 203, dim = 402, blocks = 2
nnz(A) = 40200 + 0, nnz(ADA) = 40000, nnz(L) = 20100
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            1.87E-001 0.000
  1 :  1.24E+001 4.44E-002 0.000 0.2375 0.9000 0.9000  -0.48  1  1  1.5E+000
  2 :  9.65E+000 4.02E-003 0.000 0.0906 0.9900 0.9900   0.98  1  1  2.0E-001
  3 :  9.65E+000 1.72E-006 0.248 0.0004 0.9999 0.9999   1.04  1  1  9.0E-005
  4 :  9.65E+000 8.29E-009 0.000 0.0048 0.9990 0.9990   1.32  1  1  2.6E-007
  5 :  9.65E+000 2.05E-012 0.000 0.0002 0.9999 0.9999   1.00  1  1  6.4E-011

iter seconds digits       c*x               b*y
  5      0.4   Inf  9.6490906200e+000  9.6490906203e+000
|Ax-b| =  2.6e-010, [Ay-c]_+ =  2.1E-011, |x|= 1.0e+002, |y|= 1.0e+000

Detailed timing (sec)
   Pre          IPM          Post
8.012E-002    3.906E-001    0.000E+000    
Max-norms: ||b||=3.191291e+000, ||c|| = 1,
Cholesky |add|=0, |skip| = 0, ||L.L|| = 18.0441.
------------------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +9.64909