1 /*
2   This is posets.h
3 
4   Coxeter version 3.0 Copyright (C) 2002 Fokko du Cloux
5   See file main.cpp for full copyright notice
6 */
7 
8 #ifndef POSETS_H  /* guard against multiple inclusions */
9 #define POSETS_H
10 
11 #include "globals.h"
12 
13 namespace posets {
14   using namespace coxeter;
15 };
16 
17 /******** type declarations *************************************************/
18 
19 namespace posets {
20   typedef Ulong PosetElt;
21   class Poset;
22 };
23 
24 /******** type definitions **************************************************/
25 
26 #include "bits.h"
27 #include "list.h"
28 #include "memory.h"
29 #include "wgraph.h"
30 
31 namespace posets {
32   using namespace bits;
33   using namespace list;
34   using namespace wgraph;
35 };
36 
37 namespace posets {
38 
39 class Poset {
40   List<BitMap> d_closure;
41  public:
42 /* constructors and destructors */
delete(void * ptr,size_t size)43   void operator delete(void* ptr, size_t size)
44     {return arena().free(ptr,sizeof(Poset));}
45   Poset();
46   Poset(const Ulong &n);
47   Poset(const OrientedGraph& G);
48   ~Poset();
49 /* manipulators */
50 /* accessors */
51   void findMaximals(const BitMap& D, Set& a) const;
52   bool isTriangular() const;
53   Ulong size() const;
54   void hasseDiagram(OrientedGraph& H);
55 /* input/output */
56 };
57 
58 };
59 
60 /******** inline implementations ********************************************/
61 
62 namespace posets {
63 
size()64 inline Ulong Poset::size() const {return d_closure.size();}
65 
66 };
67 
68 #endif
69