;### SIMPLE COMPUTATIONS WITH POLYTOPES $c=cube(3); print $c->FACETS; print_constraints($c); print $c->F_VECTOR; $c_polar=polarize($c); print $c_polar->F_VECTOR; $c_polar->VISUAL; product(n_gon(5),n_gon(7))->SCHLEGEL(FACET=>1,EdgeColor=>"blue"); ;# how to do it yourself: BEG, visualization: VIS, polytopes: SEM ; ;### RULE BASED COMPUTATION $p=permutahedron(3); print join(", ", $p->list_properties); $schedule=$p->get_schedule("SIMPLE"); print join("\n", $schedule->list); $schedule->apply($p); print join(", ", $p->list_properties); print $p->SIMPLE; ;# rules and such for beginners: PRL, ... for experts: EXT ; ;### GETTING HELP help 'objects'; help 'objects/Polytope'; $t=typeof $c; print join(", ", sorted_uniq(sort { $a cmp $b } map { keys %{$_->properties} } $t, @{$t->super})); ;# you already tried, but now you are stuck: STK, more help: HLP ; ;### LONG INTEGER ARITHMETIC $f = new Integer(1); for ($i = new Integer(100); $i>0; --$i) { $f *= $i; } print $f; ; ;### NEW: POLYNOMIALS $r=new Ring("x","y"); ($x,$y)=$r->variables; $p=1*(1+$x*$y)-1*($x+($y^2))+2*(($x^2)+$y); $N=newton($p); print $N->VERTICES; print fac($N->DIM)*$N->VOLUME; ; ;### PERL POWER use Benchmark qw(:all); $r=rand_sphere(3,100); $t=timeit(1,'$r->FACETS;'); print timestr($t); $r=rand_sphere(3,100); $t=timeit(1,'prefer_now("beneath_beyond");$r->FACETS;'); print timestr($t); ;# using Perl: PRL ; ;### OTHER KINDS OF OBJECTS application 'topaz'; $rp2=projective_plane(); print $rp2->HOMOLOGY; print $rp2->CONNECTED; print rows_labeled($rp2->HOMOLOGY); $t=torus(); print $t->FACETS; $t->VISUAL; ;# other applications: APP, tropical geometry: TRP ;