# HG changeset patch
# User Harald Schilly <harald.schilly@gmail.com>
# Date 1269806313 7200
# Node ID 8c4bfe376498282b005f4a8a9412cda95929adc3
# Parent bda0676f78aa75d66701775b308384c84afb100a
cvxopt update needs some trivial changes for the doctested examples in the numerical_sage section for cvxopt
diff r bda0676f78aa r 8c4bfe376498 doc/en/numerical_sage/cvxopt.rst
a

b


55  55  [ 1.] 
56  56  [ 1.]] 
57  57  sage: print(A) 
58   SIZE: (5,5) 
59   (0, 0) 2.0000e+00 
60   (1, 0) 3.0000e+00 
61   (0, 1) 3.0000e+00 
62   (2, 1) 1.0000e+00 
63   (4, 1) 4.0000e+00 
64   (1, 2) 4.0000e+00 
65   (2, 2) 3.0000e+00 
66   (3, 2) 1.0000e+00 
67   (4, 2) 2.0000e+00 
68   (2, 3) 2.0000e+00 
69   (1, 4) 6.0000e+00 
70   (4, 4) 1.0000e+00 
 58  [ 2.00e+00 3.00e+00 0 0 0 ] 
 59  [ 3.00e+00 0 4.00e+00 0 6.00e+00] 
 60  [ 0 1.00e+00 3.00e+00 2.00e+00 0 ] 
 61  [ 0 0 1.00e+00 0 0 ] 
 62  [ 0 4.00e+00 2.00e+00 0 1.00e+00] 
71  63  sage: C=m(B) 
72  64  sage: umfpack.linsolve(A,C) 
73  65  sage: print(C) 
74   5.7895e01 
75   5.2632e02 
76   1.0000e+00 
77   1.9737e+00 
78   7.8947e01 
 66  [ 5.79e01] 
 67  [5.26e02] 
 68  [ 1.00e+00] 
 69  [ 1.97e+00] 
 70  [7.89e01] 
79  71  
80  72  Note the solution is stored in :math:`B` afterward. also note the 
81  73  m(B), this turns our numpy array into a format cvxopt understands. 
… 
… 

95  87  sage: A=spmatrix([10,3,5,2,5,2],[0,2,1,2,2,3],[0,0,1,1,2,3]) 
96  88  sage: P=amd.order(A) 
97  89  sage: print(P) 
98   1 
99   0 
100   2 
101   3 
 90  [ 1] 
 91  [ 0] 
 92  [ 2] 
 93  [ 3] 
102  94  
103  95  For a simple linear programming example, if we want to solve 
104  96  
… 
… 

135  127  :: 
136  128  
137  129  sage: print sol['x'] # ... below since can get 00 or +00 depending on architecture 
138   1.0000e...00 
139   1.0000e+00 
140   
 130  [ 1.00e+00] 
 131  [ 1.00e+00] 