~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to polymakefile.h

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 public:
16
16
  std::string value;
17
17
  std::string name;
18
 
  PolymakeProperty(const string &name_, const string &value_);
 
18
  bool embedded;
 
19
  PolymakeProperty(const string &name_, const string &value_, bool embedded_=true);
19
20
};
20
21
 
21
22
class PolymakeFile
22
23
{
 
24
  static bool xmlForced;
23
25
  string application,type;
24
26
  string fileName;
25
27
  list<PolymakeProperty> properties;
26
28
  list<PolymakeProperty>::iterator findProperty(const char *p);
27
 
  void writeProperty(const char *p, const string &data);
 
29
  void writeProperty(const char *p, const string &data, bool embedded=false);
 
30
  bool isXml;
28
31
 public:
 
32
   bool isXmlFormat()const{return isXml;}
 
33
   /**
 
34
    * This function takes the Gfan property names and maps them to the corresponding names in
 
35
    * polymake type SymmetricFan (if the file is an xml file). This preserves compatibility with old
 
36
    * Gfan files. Maybe Gfan should switch completely to polymake names in the future.
 
37
    */
 
38
   const char *mapToPolymakeNames(const char *s);
 
39
/**
 
40
 * Calling this function will set the xmlForced flag, with the consequence that every subsequently
 
41
 * created PolymakeFile is output in XML format no matter with what parameters it is created.
 
42
 */
 
43
  static void forceXml(){xmlForced=true;}
29
44
  void open(const char *fileName_);
30
 
  void create(const char *fileName_, const char *application_, const char *type_);
 
45
  void create(const char *fileName_, const char *application_, const char *type_, bool isXml_=false);
31
46
  void writeStream(ostream &file);
32
47
  void close();
33
 
  bool hasProperty(const char *p);
 
48
  bool hasProperty(const char *p, bool doAssert=false);
34
49
 
35
50
  // The following could be part of a subclass to avoid dependencies on gfan
36
51
  int readCardinalProperty(const char *p);
40
55
  void writeBooleanProperty(const char *p, bool n);
41
56
 
42
57
  IntegerMatrix readMatrixProperty(const char *p, int height, int width);
43
 
  void writeMatrixProperty(const char *p, const IntegerMatrix &m, bool indexed=false);
 
58
  void writeMatrixProperty(const char *p, const IntegerMatrix &m, bool indexed=false, const vector<string> *comments=0);
 
59
 
 
60
  IntegerMatrix readArrayArrayIntProperty(const char *p, int width);
 
61
  void writeArrayArrayIntProperty(const char *p, const IntegerMatrix &m);
44
62
 
45
63
  vector<list<int> > readMatrixIncidenceProperty(const char *p);
46
 
  void writeIncidenceMatrixProperty(const char *p, const vector<list<int> > &m);
 
64
  void writeIncidenceMatrixProperty(const char *p, const vector<list<int> > &m, int baseSetSize);
47
65
 
48
66
  IntegerVector readCardinalVectorProperty(const char *p);
49
67
  void writeCardinalVectorProperty(const char *p, IntegerVector const &v);