1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
# Copyright (c) 1997-2024
# Ewgenij Gawrilow, Michael Joswig, and the polymake team
# Technische Universität Berlin, Germany
# https://polymake.org
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version: http://www.gnu.org/licenses/gpl.txt.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#-------------------------------------------------------------------------------
object Polytope {
# @category Geometry
# Valid strict inequality for all affine points of the polyhedron.
property FAR_HYPERPLANE : Vector<Scalar>;
rule REL_INT_POINT : CONE_AMBIENT_DIM {
$this->REL_INT_POINT=unit_vector<Scalar>($this->CONE_AMBIENT_DIM,0);
}
precondition : CENTERED;
weight 0.10;
rule FAR_HYPERPLANE : CONE_AMBIENT_DIM {
my $dim=$this->CONE_AMBIENT_DIM-1;
$this->FAR_HYPERPLANE=[ 1, (0) x $dim ];
}
weight 0.10;
rule REL_INT_POINT = VERTEX_BARYCENTER;
precondition : BOUNDED;
rule REL_INT_POINT = CENTROID;
precondition : BOUNDED;
rule REL_INT_POINT : VERTICES | POINTS {
$this->REL_INT_POINT=inner_point($this->give("VERTICES | POINTS"));
}
rule FAR_HYPERPLANE : FACETS | INEQUALITIES {
$this->FAR_HYPERPLANE=inner_point($this->give("FACETS | INEQUALITIES"));
}
rule CONE_DIM, REL_INT_POINT : FACETS | INEQUALITIES, ONE_VERTEX, BOUNDED {
rel_int_point($this);
}
weight 3.25;
rule REL_INT_POINT : FACETS | INEQUALITIES, LINEALITY_SPACE {
my $AH = $this->lookup("AFFINE_HULL | EQUATIONS");
my $p = new Polytope(INEQUALITIES => $this->give("FACETS | INEQUALITIES"),
EQUATIONS => (defined($AH) ? $this->LINEALITY_SPACE/$AH : $this->LINEALITY_SPACE));
$this->REL_INT_POINT = $p->REL_INT_POINT;
}
precondition : !POINTED;
weight 3.40;
}
# Local Variables:
# mode: perl
# c-basic-offset:3
# End:
|