3
#include "polynomial.h"
6
#include "gfanapplication.h"
7
#include "polyhedralcone.h"
8
#include "polyhedralfan.h"
11
#include "polymakefile.h"
13
class FanConesApplication : public GFanApplication
15
StringOption inputOption;
16
SimpleOption resultantOption;
18
bool includeInDefaultInstallation()
22
const char *helpText()
24
return "This program lists the cones of a polyhedral fan.\n";
26
FanConesApplication():
27
inputOption("-i","Specify the name of the input file.","polymake.out"),
28
resultantOption("--resultant","Take codim 1 skeleton and wipe out bad cones.")
40
return (v==0) || (v==2);
44
PolyhedralFan f1=PolyhedralFan::readFan(inputOption.getValue(),true,0,0,0);
45
AsciiPrinter P(Stdout);
47
if(resultantOption.getValue())
49
PolyhedralFan f2=f1.facetComplex();
50
PolyhedralFan f3(f2.getAmbientDimension());
51
for(PolyhedralFan::coneIterator i=f2.conesBegin();i!=f2.conesEnd();i++)
53
IntegerVector v=i->getEquations().front();
54
IntegerVector u=v.supportAsZeroOneVector();
56
if(zeroOrTwo(u[0]+u[1]+u[2]+u[3]) &&
57
zeroOrTwo(u[4]+u[5]+u[6]) &&
58
zeroOrTwo(u[7]+u[8]/*+u[5]*/))
61
f3.printWithIndices(&pout);
65
for(PolyhedralFan::coneIterator i=f1.conesBegin();i!=f1.conesEnd();i++)
68
P<<"-------------------------------------\n";
77
static FanConesApplication theApplication;