Optimization: principles and algorithms, by Michel Bierlaire
ex1401.m
Go to the documentation of this file.
1 %> @file
2 %> Example 14.1 in \cite Bier15-book
3 %> @author <a href="http://people.epfl.ch/michel.bierlaire">Michel Bierlaire</a>
4 %> @date Fri Mar 20 16:03:42 2015
5 %> @ingroup Examples
6 %> @ingroup chap14
7 
8 %> Example 14.1 in \cite Bier15-book
9 function [g,gradg] = ex1401(x)
10 
11  A = [ 77005.0 1.0 ;
12  76315.0 1.0 ;
13  70891.0 1.0 ;
14  67667.0 1.0 ;
15  64643.0 1.0 ;
16  61770.0 1.0 ;
17  61593.0 1.0 ;
18  63227.0 1.0 ;
19  63684.0 1.0 ;
20  66914.0 1.0 ;
21  72407.0 1.0 ;
22  82413.0 1.0 ;
23  86515.0 1.0 ;
24  84896.0 1.0 ;
25  79660.0 1.0 ;
26  75827.0 1.0 ;
27  72606.0 1.0 ;
28  69423.0 1.0 ;
29  69690.0 1.0 ;
30  69744.0 1.0 ;
31  70418.0 1.0 ;
32  71998.0 1.0 ;
33  77268.0 1.0 ;
34  87299.0 1.0 ] ;
35 
36  b = [ 57312.0 ;
37  56839.0 ;
38  55501.0 ;
39  55491.0 ;
40  54217.0 ;
41  53098.0 ;
42  54701.0 ;
43  56596.0 ;
44  56663.0 ;
45  58622.0 ;
46  59660.0 ;
47  59896.0 ;
48  61643.0 ;
49  61105.0 ;
50  59333.0 ;
51  60024.0 ;
52  58684.0 ;
53  57075.0 ;
54  58826.0 ;
55  60212.0 ;
56  60654.0 ;
57  61445.0 ;
58  61805.0 ;
59  62138.0 ] ;
60 
61  [m n] = size(A) ;
62  if (size(x,1) != n)
63  error("Incompatible size between A and x") ;
64  endif
65  if (size(b,1) != m)
66  error("Incompatible size between A and b") ;
67  endif
68  g = A*x-b ;
69  gradg = A';
70 endfunction
function ex1401(in x)
Example 14.1 in .
Copyright 2015-2018 Michel Bierlaire