This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

### Publishers

Scribd Selects Books

Hand-picked favorites from

our editors

our editors

Scribd Selects Audiobooks

Hand-picked favorites from

our editors

our editors

Scribd Selects Comics

Hand-picked favorites from

our editors

our editors

Scribd Selects Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

P. 1

024|Views: 0|Likes: 0

Published by Sadiq Sarfaraz

See more

See less

https://www.scribd.com/doc/169081624/024

12/18/2015

text

original

**Flexible Object Hierarchies in polymake
**

Ewgenij Gawrilow, Michael Joswig

Depts. of Mathematics at Technische Universit¨ at Berlin & Technische Universit¨ at Darmstadt

ICMS 2006 – Castro Urdiales September 2, 2006

Gawrilow,Joswig

Flexible Object Hierarchies in polymake

Introduction Objects Programming Model

About... General Design

Project History

Initiated 1996 by Prof. G¨ unter M. Ziegler, chair for Discrete Geometry, Berlin, as a collection of tools for studying polytopes (convex polyhedra). Since 1997 in co-authorship with Michael Joswig with many contributions from Thilo R¨ ohrig, Nikolaus Witte, Marc Pfetsch, Volker Kaibel, Axel Werner, et al. First presented at ICM 1998, Berlin Fully free, open source software under GPL www.polymake.de Available in source code form and as Linux RPM; included in FreeBSD port collection and MacOS X Fink project.

Gawrilow,Joswig Flexible Object Hierarchies in polymake

. combinatorial. . Template Library rapid prototyping . General Design Project Goals Uniﬁed user interface to a variety of free software tools available in the ﬁeld (a plenty of mutually incompatible ﬁle formats..) Providing means for visualization from diﬀerent aspects (geometric. command-line options. . . ease of interfacing of new tools. ) Flexibility on many levels: user preferences.Introduction Objects Programming Model About. etc.perl as scripting language for repetitive tasks like searching for special properties in a large family of objects Gawrilow. self-made extensions: C++ API.Joswig Flexible Object Hierarchies in polymake .

. as well as programming aids like C++ libraries or perl modules.. graphical primitives. visualization methods.Joswig Flexible Object Hierarchies in polymake . the whole mathematical know-how is bundled in applications (∼ = packages). and other top-level user functions.Introduction Objects Programming Model About. polytope – convex polytopes and unbounded polyhedra in arbitrary dimensions topaz – ﬁnite simplicial complexes surface – polyhedral surfaces (currently in 2-D only) tropical – tropical polytopes Applications may import everythings from each other (inheritance) or reuse some deﬁnitions (aggregation). algorithms. atomic property types. Gawrilow. An application is a collection of object types. General Design Modularity The core system is almost “math-free” .

lifting.Joswig Flexible Object Hierarchies in polymake . .. and 4-D (Schlegel diagrams). projections. . tight spans. integral lattice points. Gale diagrams . truncation. graphs and face lattice.Introduction Objects Programming Model About. . Special cases: zonotopes. . stacking . face lattice. convex hull computation (V ↔ H representation). linear and abstract objective functions. visualization in 2-D. General Design polytope Main object type: Polyhedron: over 100 geometric and combinatorial properties. Voronoi diagrams. Steiner points . . rigid frameworks Gawrilow. . vertex graph (skeleton).. 3-D. . triangulations . . transformations.

} Gawrilow. // data access boolean getSimplicial() const. polymake How would an implementation in a classical OO-language (C++. Java) look like? class Polyhedron { Matrix vertices.Joswig Flexible Object Hierarchies in polymake .Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Classical Objects vs. Polyhedron(Matrix facets). FaceLattice face_lattice. FaceLattice getFaceLattice() const. boolean simplicial. // constructors Polyhedron(Matrix vertices). Matrix facets.

otherwise the object state would be instable ⇒ Solution: access functions deploy lazy evaluation Introducing independent new features: Someone wants to add FLAG_VECTOR.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Problems Each constructor should compute every known property. } The third wants to use the both extensions.... } class Polyhedron_with_LatticePoints : public Polyhedron { . the second wants to add N_LATTICE_POINTS class Polyhedron_with_FlagVector : public Polyhedron { .. But multiple inheritance is not viable! Gawrilow.Joswig Flexible Object Hierarchies in polymake .

Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Open Object The deﬁnition scope of an object type in polymake can be reopened as often as needed. property SIMPLICIAL : Boolean. Core description: object Polyhedron { property VERTICES : Matrix. property FACETS : Matrix. even spread over multiple source ﬁles.Joswig Flexible Object Hierarchies in polymake . } Gawrilow. } First extension: object Polyhedron { property FLAG_VECTOR : Vector.

Gawrilow. The most properties are computed on demand. VERTICES_IN_FACETS : VERTICES | POINTS SIMPLICIAL : VERTICES_IN_FACETS Design guideline: try to keep each computational step as short as possible. A production rule is an algorithm adorned with declarations of the source properties (inputs) and target properties (results): FACETS.Joswig Flexible Object Hierarchies in polymake . using production rules. but without losing eﬃciency and/or useful by-products.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Lazy Evaluation polymake objects usually start with minimal information needed to uniquely identify the chosen equivalence class of mathematical objects.

Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Rule Scheduling Being asked for an object property. super-polynomial) PRECONDITION nested rule tells whether the rule is applicable to the given object. polymake tries to ﬁnd an applicable chain of production rules. Along with the main information about source and targets. rule weights. several intermediate steps. groups of similar production rules can be ordered by user’s preferences. polynomial.r. Gawrilow. so that the favourite one is always tried ﬁrst The rule scheduling then boils down to a Dijkstra-like shortest path search w. probably. including.t. it uses some optional meta-data describing the rules: WEIGHT nested rule delivering a coarse measure of the computational complexity (linear-time.Joswig Flexible Object Hierarchies in polymake .

immutable. Neither rules nor other methods are allowed to overwrite existing object properties. in fact. This approach resembles the usual mathematical way of expression. Gawrilow. paragraph. . polymake objects are. “Let P be a polytope . . ” means P stays the same until its scope (theorem.) ends. etc.Joswig Flexible Object Hierarchies in polymake .Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Object Consistency Why is it safe to let everybody reopen and extend the object deﬁnitions? Production rules are only object methods that are allowed to add new computed properties to the object.

Therefore polymake keeps all properties. all its properties go with it.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Object Persistence The object properties are considered “valueable” and expensive to compute. This allows to avoid re-computations if the object properties are being queried later again. can be declared temporary. Gawrilow. Usually these are either very trivial properties.Joswig Flexible Object Hierarchies in polymake . polymake gets rid of them as soon as possible. If the object is going to be stored in a data ﬁle. or ones requiring huge amount of space to be stored. including those needed in intermediate steps. however. after the computation is ﬁnished. Some properties.

They are opaque from the polymake core’s point of view. For example. Matrix. Many complex types are implemented in C++ and have an eﬃcient perl interface. subobject properties take other polymake objects as values.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Property Types Property types are declared in the object or application scope. property VERTICES : Matrix.Joswig Flexible Object Hierarchies in polymake . IncidenceMatrix. the triangulation of a polytope is a special case of a ﬁnite simplicial complex. deﬁned in the application topaz. in the last case shareable between diﬀerent object types. atomic properties like Scalar. property TRIANGULATION : topaz::SimplicialComplex. Gawrilow. Vector.

some of them having special features.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Unique and Multiple Properties The cardinality of occurance in the object. multiple properties can be declared in cases when some property can take substantially diﬀerent values. A polytope can be triangulated in very many ways. unique property is allowed to occur at most once. but it still describes the same polytope. It’s the default behaviour. suitable for the most of the properties: VERTICES. Gawrilow. each of them being potentially interesting for further research. etc. Thus it is allowed to possess several TRIANGULATION instances.Joswig Flexible Object Hierarchies in polymake . This does not imply the uniqueness of representation: the set of VERTICES can be arbitrarily permuted. FACETS.

FACES : VERTICES VOLUME : TRIANGULATION. object Polyhedron { TRIANGULATION. The set of available production rules for an object is automatically augmented by the suitable rules deﬁned in the containing object.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Rules for Subobjects Production rules may have the subobject’s properties as both their sources and targets. Gawrilow.FACETS.Joswig Flexible Object Hierarchies in polymake . This can be seen as a kind of dynamic class derivation. VERTICES } Each subobject always knows its containing object via the special parent property.

LP.OBJECTIVE.MAXIMAL_VALUE. VERTICES. } object Polyhedron { property LP : LinearProgram. property MAXIMAL_VALUE : Scalar. mainly to gain proﬁt from the rule scheduling. object LinearProgram { property OBJECTIVE : Vector.Joswig Flexible Object Hierarchies in polymake . LP. Example: a linear programming problem applied to a polytope – a mutable mulitple property.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Mutable Subobjects Can be attached to an object without changing its semantics. property MAXIMAL_FACE : Set. GRAPH } Gawrilow.MAXIMAL_FACE : \ LP.

deriving from an object type always expresses some narrowing of the modelled domain. object CombinatorialPolytope { property VERTICES_IN_FACETS. narrower equivalence classes: an instance of CombinatorialPolytope represents all polytopes combinatorially isomorphic to each other. The vertex-facet incidence information suﬃces to get all combinatorial properties. Instead. } object Polyhedron : CombinatorialPolytope { VERTICES_IN_FACETS : VERTICES. FACETS } Gawrilow.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Object Derivation Revisited polymake does not use object derivation for expanding its capabilities.Joswig Flexible Object Hierarchies in polymake .

FACETS : INPUT_VECTORS } object VoronoiDiagram : Polyhedron { property SITES : Matrix. VERTICES. Some special constructions may be comfortably encoded this way. FACETS : SITES } Gawrilow. continued Special cases: Some properties are only deﬁned for restricted families of polytopes.Joswig Flexible Object Hierarchies in polymake . object Zonotope : Polyhedron { property INPUT_VECTORS : Matrix. too.Introduction Objects Programming Model Object Deﬁnition Object Properties Object Inheritance Object Derivation.

Joswig Flexible Object Hierarchies in polymake . q.) Gawrilow. (Sometimes involves template metaprogramming.give("VERTICES") >> V. } The programmer has (almost) free choice of data structures where to store the properties. return q.Introduction Objects Programming Model C++ binding How to access these funny objects from “real” programs? polymake::Object polarize(polymake::Object& p) { polymake::Object q("Polyhedron").take("FACETS") << V. Matrix<Rational> V. The only requirement: the C++ class should be structurally equivalent to the declared type of object property. p.

or stochastic algorithms involves an overhead for an interpreted language.Joswig Flexible Object Hierarchies in polymake . not suitable for numeric applications.Introduction Objects Programming Model Conclusions polymake object model: promotes the modularization of software comes close to the mathematical notion of objects allows for ﬂexible extensions of property sets and inheritance hierarchies. even dynamically at runtime allows the programmer freedom in choice of data structures is aimed primarily for exact algorithms on discrete structures. approximation. not a pure C++ solution Gawrilow.

examples from FEM

Mixed FEM for elastoplasticity

Markov Chain Monte Carlo

implementation of anisotropic damage model

Bsc Thesis

concepts of higher order finite elements using sparse grids

multiscale method

coupled damage plasticity model

implementation of component based parallel finite element library

1620290802_ftp

Web 5155

space time FEM

ms10_2012

Flow

cuda3

Slide Chpt09

week7_PolyGen

Week2 ODEs

week5_part1

Lecture 4

File Streams

15 Spherical Trigonometry

Nom

Non Conservative Euler

vl_neu05

- Read and print without ads
- Download to keep your version
- Edit, email or read offline

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

CANCEL

OK

You've been reading!

NO, THANKS

OK

scribd

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->