Optimization: principles and algorithms, by Michel Bierlaire
run0908cg.m
Go to the documentation of this file.
1 %> \file
2 %> Runs example 9.8 for the conjugate gradient algorithm (Table 9.1).
3 %>
4 %> @ingroup Running
5 %> @ingroup chap09
6 %> @author <a href="http://people.epfl.ch/michel.bierlaire">Michel Bierlaire</a>
7 %> @date Fri Mar 20 14:30:01 2015
8 
9 %> @note Calls \ref conjugateGradient
10 
11 Q = [1 1 1 1 ; 1 2 2 2 ; 1 2 3 3 ; 1 2 3 4] ;
12 b = [-4 ; -7 ; -9 ; -10 ] ;
13 x0 = [5 ; 5 ; 5 ; 5] ;
14 [D,solution] = conjugateGradient(Q,b,x0,1)
15 
16 
function conjugateGradient(in Q, in b, in x0, in printlevel)
Applies the conjugate gradient method to solve where and .
Copyright 2015-2018 Michel Bierlaire