user_guide:tutorials:caratheodory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
tutorial:caratheodory [2014/01/03 15:45] – external edit 127.0.0.1tutorial:caratheodory [2017/06/13 11:27] – added some formatting to enable automated tests oroehrig
Line 8: Line 8:
 The rows of this matrix describe a cone //C//: The rows of this matrix describe a cone //C//:
 <code> <code>
-polytope > $M=new +polytope > $M = new Matrix<Rational>([[0,1,0,0,0,0], 
-Matrix<Rational>([[0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1],[1,0,2,1,1,2],[1,2,0,2,1,1],[1,1,2,0,2,1],[1,1,1,2,0,2],[1,2,1,1,2,0]]);+polytope (2)> [0,0,1,0,0,0], 
 +polytope (3)> [0,0,0,1,0,0], 
 +polytope (4)> [0,0,0,0,1,0], 
 +polytope (5)> [0,0,0,0,0,1], 
 +polytope (6)> [1,0,2,1,1,2], 
 +polytope (7)> [1,2,0,2,1,1], 
 +polytope (8)> [1,1,2,0,2,1], 
 +polytope (9)> [1,1,1,2,0,2], 
 +polytope (10)> [1,2,1,1,2,0]]);
 polytope > $C=new Polytope<Rational>(POINTS=>$M); polytope > $C=new Polytope<Rational>(POINTS=>$M);
 </code> </code>
Line 36: Line 44:
 The following loop iterates over all invertible 6x6 submatrices of //M// and computes the unique representation of //x// as a linear combination of the rows of the submatrix.  The output (suppressed as it is too long) shows that each such linear combination requires at least one negative or one non-integral coefficient. The following loop iterates over all invertible 6x6 submatrices of //M// and computes the unique representation of //x// as a linear combination of the rows of the submatrix.  The output (suppressed as it is too long) shows that each such linear combination requires at least one negative or one non-integral coefficient.
 <code> <code>
-foreach (all_subsets_of_k(6,0..9)) { +foreach (all_subsets_of_k(6,0..9)) { 
-  $B=$M->minor($_,All); +>   $B = $M->minor($_,All); 
-  if (det($B)) { +>   if (det($B)) { 
-    print lin_solve(transpose($B),$x), "\n"; +>     print lin_solve(transpose($B),$x), "\n"; 
-  +>   
-}+}
 </code> </code>
 This means that //x// cannot be represented as a non-negative linear combination of any six of the given generators of //C//. This means that //x// cannot be represented as a non-negative linear combination of any six of the given generators of //C//.
  • user_guide/tutorials/caratheodory.txt
  • Last modified: 2019/02/11 23:09
  • by 127.0.0.1