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 revision
Previous revision
Next revisionBoth sides next revision
tutorial:caratheodory [2014/01/03 15:45] – external edit 127.0.0.1user_guide:caratheodory [2019/01/25 09:27] – ↷ Page moved from tutorial:caratheodory to user_guide:caratheodory 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