user_guide:tutorials:apps_matroid

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
Last revisionBoth sides next revision
tutorial:apps_matroid [2014/11/14 10:32] – [Other Constructions] schroeteruser_guide:tutorials:apps_matroid [2019/01/25 09:38] – ↷ Page moved from user_guide:apps_matroid to user_guide:tutorials:apps_matroid oroehrig
Line 1: Line 1:
-====== Short Introduction to New Application ''matroid'' ======+====== Short Introduction to application ''matroid'' ======
  
-The application ''matroid'' introduced with version 2.9.7 is in its infancy.  This tutorial is meant to show the main features available.+**This tutorial is also available as a {{ user_guide:apps_matroid.ipynb |jupyter notebook}} for polymake 3.1.**
  
-To make ''matroid'' your current application start ''polymake'' with the option ''-A matroid'' or use the context switch ''%%application "matroid";%%'' from within the ''polymake'' shell.  A permanent setting can be stored with ''%%set_custom $default_application="matroid";%%''+This tutorial is meant to show the main features for handling matroids available. To make ''matroid'' your current application start ''polymake'' with the option ''-A matroid'' or use the context switch 
 +<code> 
 +application "matroid"; 
 +</code> 
 +from within the ''polymake'' shell.  A permanent setting can be stored with ''%%set_custom $default_application="matroid";%%''
  
 ===== Constructing a Simple Matroid and Playing Around ===== ===== Constructing a Simple Matroid and Playing Around =====
Line 10: Line 14:
  
 <code> <code>
-matroid > $M=new Matroid(POINTS=>[[1,0,0],[1,0,1],[1,1,0],[1,0,2]]);+matroid > $M=new Matroid(VECTORS=>[[1,0,0],[1,0,1],[1,1,0],[1,0,2]]);
 </code> </code>
  
Line 16: Line 20:
  
 <code> <code>
-polytope > $M=new matroid::Matroid(POINTS=>[[1,0,0],[1,0,1],[1,1,0],[1,0,2]]);+polytope > $M=new matroid::Matroid(VECTORS=>[[1,0,0],[1,0,1],[1,1,0],[1,0,2]]);
 </code> </code>
  
Line 24: Line 28:
 3 4 3 3 4 3
 </code> </code>
-{{ :tutorial:matroid_lattice_of_flats_example.png?nolink&200|}} +{{ user_guide:matroid_lattice_of_flats_example.png?nolink&200|}} 
-The ''POINTS'' are numbered consecutively, starting from zero.  The bases are encoded as sets of these ordinal numbers.+The ''VECTORS'' are numbered consecutively, starting from zero.  The bases are encoded as sets of these ordinal numbers.
  
 <code> <code>
Line 49: Line 53:
 You can also compute other properties, like  You can also compute other properties, like 
 <code> <code>
-matroid > print $M->PAVING?"1":"0", " ", $M->BINARY?"1":"0", " ", $M->SERIES_PARALLEL?"1":"0", " ", $M->CONNECTED?"1":"0";+matroid > print $M->PAVING?"1":"0", " ", 
 +matroid (2)> $M->BINARY?"1":"0", " ", 
 +matroid (3)> $M->SERIES_PARALLEL?"1":"0", " ", 
 +matroid (4)> $M->CONNECTED?"1":"0";
 1 1 0 0 1 1 0 0
  
Line 62: Line 69:
 Even the lattice of flats could be computed and visualised. Even the lattice of flats could be computed and visualised.
 <code> <code>
-matroid > $lattice=$M->LATTICE_OF_FLATS; foreach (@{$lattice->nodes_of_dim(2)}){print $lattice->FACES->[$_]," "};+matroid > $lattice=$M->LATTICE_OF_FLATS; 
 +matroid > foreach (@{$lattice->nodes_of_rank(2)}){print $lattice->FACES->[$_]," "};
 {0 2} {0 1 3} {1 2} {2 3} {0 2} {0 1 3} {1 2} {2 3}
    
Line 92: Line 100:
  
 <code> <code>
-matroid > $C=new Matroid(POINTS=>polytope::cube(3)->VERTICES);+matroid > $C=new Matroid(VECTORS=>polytope::cube(3)->VERTICES);
  
 matroid > print $C->N_BASES; matroid > print $C->N_BASES;
Line 109: Line 117:
 It is also possible to derive a new matroid from others.  It is also possible to derive a new matroid from others. 
 <code> <code>
-matroid > $se=series_extension(uniform_matroid(2,3),0,uniform_matroid(1,3),0); # the arguments are two matroids and for each matroid a basepoint.The basepoints will be identified. +matroid > # The arguments are two matroids and for each matroid a basepoint. The basepoints will be identified.  
 +matroid > $se=series_extension(uniform_matroid(2,3),0,uniform_matroid(1,3),0);
  
-matroid > print deletion($se,4)->POINTS;+matroid > print deletion($se,4)->VECTORS;
 1 0 0 1 0 0
 0 1 0 0 1 0
Line 119: Line 128:
 matroid > $pe=parallel_extension(uniform_matroid(1,3),0,uniform_matroid(2,3),0); matroid > $pe=parallel_extension(uniform_matroid(1,3),0,uniform_matroid(2,3),0);
  
-matroid > print dual(contraction($pe,4))->POINTS;+matroid > print dual(contraction($pe,4))->VECTORS;
 1 0 0 1 0 0
 0 1 0 0 1 0
  • user_guide/tutorials/apps_matroid.txt
  • Last modified: 2019/02/04 22:55
  • by 127.0.0.1