| |
| documentation:master:polytope [2026/09/17 12:17] – created - external edit 127.0.0.1 | documentation:master:polytope [2026/10/01 08:40] (current) – external edit 127.0.0.1 |
|---|
| {{anchor:circuits2matrix:}} | {{anchor:circuits2matrix:}} |
| ? **''circuits2matrix([[.:common#Set |Set]]<[[.:common#Pair |Pair]]<[[.:common#Set |Set]]<[[.:common#Int |Int]]>,[[.:common#Set |Set]]<[[.:common#Int |Int]]%%>>%%> co)''** | ? **''circuits2matrix([[.:common#Set |Set]]<[[.:common#Pair |Pair]]<[[.:common#Set |Set]]<[[.:common#Int |Int]]>,[[.:common#Set |Set]]<[[.:common#Int |Int]]%%>>%%> co)''** |
| :: Convert ''[[.:polytope:VectorConfiguration#CIRCUITS |CIRCUITS]]'' or ''[[.:polytope:VectorConfiguration#COCIRCUITS |COCIRCUITS]]'' to a 0/+1/-1 matrix, with one row for each circuit/cocircuit, and as many columns as there are VECTORs/POINTS. | :: Convert ''[[.:polytope:Polytope#CIRCUITS |CIRCUITS]]'' or ''[[.:polytope:Polytope#COCIRCUITS |COCIRCUITS]]'' to a 0/+1/-1 matrix, with one row for each circuit/cocircuit, and as many columns as there are VECTORs/POINTS. |
| ? Parameters: | ? Parameters: |
| :: ''[[.:common#Set |Set]]<[[.:common#Pair |Pair]]<[[.:common#Set |Set]]<[[.:common#Int |Int]]>,[[.:common#Set |Set]]<[[.:common#Int |Int]]%%>>%%>'' ''co'': /circuits a set of circuits or cocircuits | :: ''[[.:common#Set |Set]]<[[.:common#Pair |Pair]]<[[.:common#Set |Set]]<[[.:common#Int |Int]]>,[[.:common#Set |Set]]<[[.:common#Int |Int]]%%>>%%>'' ''co'': /circuits a set of circuits or cocircuits |
| {{anchor:affine_float_coords:}} | {{anchor:affine_float_coords:}} |
| ? **''affine_float_coords([[.:polytope:Polytope |Polytope]] P)''** | ? **''affine_float_coords([[.:polytope:Polytope |Polytope]] P)''** |
| :: Dehomogenize the [[.:polytope:Polytope#VERTICES |vertex coordinates]] and convert them to Float | :: Dehomogenize the [[.:polytope:SchlegelDiagram#VERTICES |vertex coordinates]] and convert them to Float |
| ? Parameters: | ? Parameters: |
| :: ''[[.:polytope:Polytope |Polytope]]'' ''P'': source object | :: ''[[.:polytope:Polytope |Polytope]]'' ''P'': source object |
| {{anchor:center_distance:}} | {{anchor:center_distance:}} |
| ? **''center_distance([[.:polytope:Polytope |Polytope]] p)''** | ? **''center_distance([[.:polytope:Polytope |Polytope]] p)''** |
| :: Compute the mean or median distance of the ''[[.:polytope:Polytope#VERTICES |VERTICES]]'' to the ''[[.:polytope:Polytope#VERTEX_BARYCENTER |VERTEX_BARYCENTER]]''. | :: Compute the mean or median distance of the ''[[.:polytope:SchlegelDiagram#VERTICES |VERTICES]]'' to the ''[[.:polytope:Polytope#VERTEX_BARYCENTER |VERTEX_BARYCENTER]]''. |
| ? Parameters: | ? Parameters: |
| :: ''[[.:polytope:Polytope |Polytope]]'' ''p'' | :: ''[[.:polytope:Polytope |Polytope]]'' ''p'' |
| :: <code perl> > $p = SIM_body(new Vector(sequence(3,1))); | :: <code perl> > $p = SIM_body(new Vector(sequence(3,1))); |
| > $s = new Polytope(POINTS=>$p->VERTICES->minor(All,~[$p->CONE_DIM])); | > $s = new Polytope(POINTS=>$p->VERTICES->minor(All,~[$p->CONE_DIM])); |
| | </code> |
| | |
| | |
| | ---- |
| | {{anchor:agv_cube:}} |
| | ? **''agv_cube([[.:common#Int |Int]] n)''** |
| | :: Produce the n-dimensional polytope with 2n facets underlying the linear program cex_n(t) of Allamigeon, Gaubert and Vandame, https://dl.acm.org/doi/10.1145/3519935.3519997 , for which every self-concordant barrier interior point method requires at least 2^n-1 iterations. |
| | ? Parameters: |
| | :: ''[[.:common#Int |Int]]'' ''n'': defining parameter |
| | ? Options: |
| | : |
| | :: ''[[.:common#Rational |Rational]]'' ''eval_ratio'': parameter for evaluating the puiseux rational functions |
| | :: ''[[.:common#Int |Int]]'' ''eval_exp'': to evaluate at eval_ratio^eval_exp, default: 1 |
| | :: ''[[.:common#Float |Float]]'' ''eval_float'': parameter for evaluating the puiseux rational functions |
| | ? Returns: |
| | :''[[.:polytope:Polytope |Polytope]]<[[.:common#PuiseuxFraction |PuiseuxFraction]]<[[.:common#Max |Max]],[[.:common#Rational |Rational]],[[.:common#Rational |Rational]]%%>>%%'' |
| | ? Example: |
| | :: This yields a 3-polytope over the field of Puiseux fractions. |
| | :: <code perl> > $p = agv_cube(3); |
| | </code> |
| | ? Example: |
| | :: This yields a rational 3-polytope with the same combinatorics. |
| | :: <code perl> > $p = agv_cube(3,eval_ratio=>4); |
| </code> | </code> |
| |