summaryrefslogtreecommitdiff
path: root/math/graphthing
diff options
context:
space:
mode:
authorTilman Keskinoz <arved@FreeBSD.org>2002-10-30 13:57:19 +0000
committerTilman Keskinoz <arved@FreeBSD.org>2002-10-30 13:57:19 +0000
commitfed0a6af8ade7cec1e6431d78fe4c944da0a8e63 (patch)
tree1e45e46e65e5a9efcce259ccbf2fc5c84a99b497 /math/graphthing
parentFix build by removing declaration for deprecated and unreferenced (diff)
Fix Build on -CURRENT
Notes
Notes: svn path=/head/; revision=69163
Diffstat (limited to 'math/graphthing')
-rw-r--r--math/graphthing/files/patch-src-edge.cc11
-rw-r--r--math/graphthing/files/patch-src-edge.h11
-rw-r--r--math/graphthing/files/patch-src-factory.cc10
-rw-r--r--math/graphthing/files/patch-src-graph.cc37
-rw-r--r--math/graphthing/files/patch-src-graph.h25
-rw-r--r--math/graphthing/files/patch-src-graph2.cc29
-rw-r--r--math/graphthing/files/patch-src-gt-bison.y10
-rw-r--r--math/graphthing/files/patch-src-gui_cb.cc13
-rw-r--r--math/graphthing/files/patch-src-matrix.cc19
-rw-r--r--math/graphthing/files/patch-src-polynomial.cc29
-rw-r--r--math/graphthing/files/patch-src-polynomial.h20
-rw-r--r--math/graphthing/files/patch-src-string.cc32
-rw-r--r--math/graphthing/files/patch-src-string.h38
-rw-r--r--math/graphthing/files/patch-src-unit_test.cc53
-rw-r--r--math/graphthing/files/patch-src-vertex.h27
15 files changed, 364 insertions, 0 deletions
diff --git a/math/graphthing/files/patch-src-edge.cc b/math/graphthing/files/patch-src-edge.cc
new file mode 100644
index 000000000000..c658586159b4
--- /dev/null
+++ b/math/graphthing/files/patch-src-edge.cc
@@ -0,0 +1,11 @@
+--- src/edge.cc.orig Fri Oct 25 13:39:36 2002
++++ src/edge.cc Fri Oct 25 13:40:19 2002
+@@ -13,7 +13,7 @@
+ weight (wt), directed (dir), selected (false)
+ {
+ if (a == b)
+- throw invalid_argument ("Loops not yet supported.");
++ throw std::invalid_argument ("Loops not yet supported.");
+ }
+
+ Edge::Edge (const Edge &other) : v (other.v), w (other.w),
diff --git a/math/graphthing/files/patch-src-edge.h b/math/graphthing/files/patch-src-edge.h
new file mode 100644
index 000000000000..cb55f316469e
--- /dev/null
+++ b/math/graphthing/files/patch-src-edge.h
@@ -0,0 +1,11 @@
+--- src/edge.h.orig Tue Feb 12 05:49:28 2002
++++ src/edge.h Fri Oct 25 15:44:14 2002
+@@ -26,7 +26,7 @@
+
+ Edge &operator= (const Edge &other);
+ bool operator== (const Edge &other) const;
+- friend ostream &operator<< (ostream &o, const Edge &e);
++ friend std::ostream &operator<< (std::ostream &o, const Edge &e);
+
+ bool incident_to (const Vertex *v1) const;
+ bool incident_to (const Vertex *v1, const Vertex *v2) const;
diff --git a/math/graphthing/files/patch-src-factory.cc b/math/graphthing/files/patch-src-factory.cc
new file mode 100644
index 000000000000..572b5f270dcb
--- /dev/null
+++ b/math/graphthing/files/patch-src-factory.cc
@@ -0,0 +1,10 @@
+--- src/factory.cc.orig Fri Oct 25 13:49:05 2002
++++ src/factory.cc Fri Oct 25 13:49:31 2002
+@@ -3,6 +3,7 @@
+ */
+
+ #include <math.h>
++#include <iostream>
+ #include "edge.h"
+ #include "factory.h"
+ #include "graph.h"
diff --git a/math/graphthing/files/patch-src-graph.cc b/math/graphthing/files/patch-src-graph.cc
new file mode 100644
index 000000000000..69640b74d54c
--- /dev/null
+++ b/math/graphthing/files/patch-src-graph.cc
@@ -0,0 +1,37 @@
+--- src/graph.cc.orig Tue Feb 12 05:51:39 2002
++++ src/graph.cc Fri Oct 25 17:16:21 2002
+@@ -82,8 +82,14 @@
+ }
+
+ /* We don't want anything skipped */
+- fs.setf (0);
+-
++#if __FreeBSD__
++#include <osreldate.h>
++#if __FreeBSD_version >= 500035
++ fs.setf(std::ios_base::fmtflags(0));
++#else
++ fs.setf(0);
++#endif
++#endif
+ new_graph = new Graph ();
+ yy_gt_fs = &fs;
+ success = (yy_gt_parse () == 0);
+@@ -105,7 +111,7 @@
+ fs.open (fname, std::fstream::out);
+ if (!fs.is_open ()) {
+ /* std::cerr << "*** Couldn't open \"" << fname << "\"\n"; */
+- throw runtime_error ("Couldn't open file.");
++ throw std::runtime_error ("Couldn't open file.");
+ }
+
+ fs << *this;
+@@ -128,7 +134,7 @@
+ fs.open (fname, std::fstream::out);
+ if (!fs.is_open ()) {
+ /* std::cerr << "*** Couldn't open \"" << fname << "\"\n"; */
+- throw runtime_error ("Couldn't open file.");
++ throw std::runtime_error ("Couldn't open file.");
+ }
+
+ minx = miny = 999999;
diff --git a/math/graphthing/files/patch-src-graph.h b/math/graphthing/files/patch-src-graph.h
new file mode 100644
index 000000000000..d9d0ebd53a6d
--- /dev/null
+++ b/math/graphthing/files/patch-src-graph.h
@@ -0,0 +1,25 @@
+--- src/graph.h.orig Fri Oct 25 13:50:30 2002
++++ src/graph.h Fri Oct 25 13:52:29 2002
+@@ -20,16 +20,16 @@
+ class Graph
+ {
+ private:
+- vector<Edge *> E;
+- vector<Vertex *> V;
++ std::vector<Edge *> E;
++ std::vector<Vertex *> V;
+
+
+ public:
+
+- typedef vector<Edge *>::iterator e_iterator;
+- typedef vector<Vertex *>::iterator v_iterator;
+- typedef vector<Edge *>::const_iterator e_const_iterator;
+- typedef vector<Vertex *>::const_iterator v_const_iterator;
++ typedef std::vector<Edge *>::iterator e_iterator;
++ typedef std::vector<Vertex *>::iterator v_iterator;
++ typedef std::vector<Edge *>::const_iterator e_const_iterator;
++ typedef std::vector<Vertex *>::const_iterator v_const_iterator;
+
+
+ Edge *e_selected_head;
diff --git a/math/graphthing/files/patch-src-graph2.cc b/math/graphthing/files/patch-src-graph2.cc
new file mode 100644
index 000000000000..c2d6f278ce25
--- /dev/null
+++ b/math/graphthing/files/patch-src-graph2.cc
@@ -0,0 +1,29 @@
+--- src/graph2.cc.orig Fri Oct 25 15:30:29 2002
++++ src/graph2.cc Fri Oct 25 15:39:39 2002
+@@ -248,7 +248,7 @@
+ {
+ Graph::e_const_iterator eit;
+ Graph::v_iterator vit;
+- queue<Vertex *> vq;
++ std::queue<Vertex *> vq;
+ int cnt = 1;
+
+ /* Set all marks to 0 */
+@@ -379,7 +379,7 @@
+ }
+
+ /* Remove degree 0 vertices */
+- queue<Vertex *> vq;
++ std::queue<Vertex *> vq;
+ int cnt = 0;
+ for (vit = v_begin (); vit != v_end (); ++vit)
+ if ((*vit)->degree () == 0)
+@@ -395,7 +395,7 @@
+ /* Remove degree 1 vertices */
+ int tot = 0;
+ do {
+- queue<Vertex *> vq;
++ std::queue<Vertex *> vq;
+ cnt = 0;
+ for (vit = v_begin (); vit != v_end (); ++vit)
+ if ((*vit)->degree () == 1)
diff --git a/math/graphthing/files/patch-src-gt-bison.y b/math/graphthing/files/patch-src-gt-bison.y
new file mode 100644
index 000000000000..27757727d8d8
--- /dev/null
+++ b/math/graphthing/files/patch-src-gt-bison.y
@@ -0,0 +1,10 @@
+--- src/gt-bison.y.orig Fri Oct 25 16:16:17 2002
++++ src/gt-bison.y Fri Oct 25 16:16:37 2002
+@@ -1,6 +1,7 @@
+ %{
+ #include <stdio.h>
+ #include <string.h>
++#include <iostream>
+ #include "edge.h"
+ #include "graph.h"
+ #include "vertex.h"
diff --git a/math/graphthing/files/patch-src-gui_cb.cc b/math/graphthing/files/patch-src-gui_cb.cc
new file mode 100644
index 000000000000..419a35744f26
--- /dev/null
+++ b/math/graphthing/files/patch-src-gui_cb.cc
@@ -0,0 +1,13 @@
+--- src/gui_cb.cc.orig Fri Oct 25 15:50:57 2002
++++ src/gui_cb.cc Fri Oct 25 15:52:46 2002
+@@ -253,8 +253,8 @@
+
+ void GUI::cb_Graph_Statistics_DegreeSequence ()
+ {
+- vector<int> seq;
+- vector<int>::iterator it1, it2;
++ std::vector<int> seq;
++ std::vector<int>::iterator it1, it2;
+ Graph::v_const_iterator vit;
+
+ if (graph->order () < 1) {
diff --git a/math/graphthing/files/patch-src-matrix.cc b/math/graphthing/files/patch-src-matrix.cc
new file mode 100644
index 000000000000..09aa7e748f47
--- /dev/null
+++ b/math/graphthing/files/patch-src-matrix.cc
@@ -0,0 +1,19 @@
+--- src/matrix.cc.orig Fri Oct 25 16:02:15 2002
++++ src/matrix.cc Fri Oct 25 15:58:21 2002
+@@ -166,14 +166,14 @@
+ {
+ unsigned int i, j;
+
+- o << '/' << string (mat.rep->columns * 2, '-') << "-\\\n";
++ o << '/' << std::string (mat.rep->columns * 2, '-') << "-\\\n";
+ for (j = 0; j < mat.rep->rows; ++j) {
+ o << "| ";
+ for (i = 0; i < mat.rep->columns; ++i)
+ o << mat (i, j) << ' ';
+ o << "|\n";
+ }
+- o << '\\' << string (mat.rep->columns * 2, '-') << "-/\n";
++ o << '\\' << std::string (mat.rep->columns * 2, '-') << "-/\n";
+
+ return o;
+ }
diff --git a/math/graphthing/files/patch-src-polynomial.cc b/math/graphthing/files/patch-src-polynomial.cc
new file mode 100644
index 000000000000..97c4579c55b6
--- /dev/null
+++ b/math/graphthing/files/patch-src-polynomial.cc
@@ -0,0 +1,29 @@
+--- src/polynomial.cc.orig Fri Oct 25 16:00:00 2002
++++ src/polynomial.cc Fri Oct 25 16:01:50 2002
+@@ -23,7 +23,7 @@
+
+ void Polynomial::minimise ()
+ {
+- vector<int>::iterator it;
++ std::vector<int>::iterator it;
+
+ for (it = rep->data.end () - 1; it != rep->data.begin (); --it)
+ if (*it)
+@@ -142,7 +142,7 @@
+
+ int Polynomial::eval (int x) const
+ {
+- vector<int>::reverse_iterator it;
++ std::vector<int>::reverse_iterator it;
+ int val;
+
+ val = 0;
+@@ -200,7 +200,7 @@
+
+ std::ostream &operator<< (std::ostream &o, const Polynomial &p)
+ {
+- vector<int>::reverse_iterator it;
++ std::vector<int>::reverse_iterator it;
+ int pow, val;
+ bool sp;
+
diff --git a/math/graphthing/files/patch-src-polynomial.h b/math/graphthing/files/patch-src-polynomial.h
new file mode 100644
index 000000000000..2f36f68b6cec
--- /dev/null
+++ b/math/graphthing/files/patch-src-polynomial.h
@@ -0,0 +1,20 @@
+--- src/polynomial.h.orig Tue Feb 12 05:56:44 2002
++++ src/polynomial.h Fri Oct 25 15:56:13 2002
+@@ -16,7 +16,7 @@
+ class PolynomialRep
+ {
+ public:
+- vector<int> data;
++ std::vector<int> data;
+ unsigned int ref;
+
+ PolynomialRep ();
+@@ -52,7 +52,7 @@
+ int operator() (int x) const;
+ Polynomial &operator= (const Polynomial &other);
+
+- friend ostream &operator<< (ostream &o, const Polynomial &p);
++ friend std::ostream &operator<< (std::ostream &o, const Polynomial &p);
+ friend bool operator== (const Polynomial &p1,
+ const Polynomial &p2);
+ void operator+= (const Polynomial &other);
diff --git a/math/graphthing/files/patch-src-string.cc b/math/graphthing/files/patch-src-string.cc
new file mode 100644
index 000000000000..d15107e8754a
--- /dev/null
+++ b/math/graphthing/files/patch-src-string.cc
@@ -0,0 +1,32 @@
+--- src/string.cc.orig Fri Oct 25 16:04:09 2002
++++ src/string.cc Fri Oct 25 16:09:45 2002
+@@ -38,7 +38,7 @@
+ strcpy (data, s);
+ }
+
+-String::StringRep::StringRep (const string &s)
++String::StringRep::StringRep (const std::string &s)
+ {
+ len = s.size ();
+ size = (len + 8) & ~7;
+@@ -71,7 +71,7 @@
+ ++rep->ref;
+ }
+
+-String::String (const string &s)
++String::String (const std::string &s)
+ {
+ rep = new StringRep (s);
+ ++rep->ref;
+@@ -156,9 +156,9 @@
+ return rep->data;
+ }
+
+-string String::std_str () const
++std::string String::std_str () const
+ {
+- return string (rep->data);
++ return std::string (rep->data);
+ }
+
+ bool String::empty () const
diff --git a/math/graphthing/files/patch-src-string.h b/math/graphthing/files/patch-src-string.h
new file mode 100644
index 000000000000..7f1d6385a623
--- /dev/null
+++ b/math/graphthing/files/patch-src-string.h
@@ -0,0 +1,38 @@
+--- src/string.h.orig Tue Feb 12 05:28:42 2002
++++ src/string.h Fri Oct 25 13:44:29 2002
+@@ -23,7 +23,7 @@
+ StringRep ();
+ StringRep (unsigned int n);
+ StringRep (const char *s);
+- StringRep (const string &s);
++ StringRep (const std::string &s);
+ ~StringRep ();
+ };
+
+@@ -34,7 +34,7 @@
+ public:
+ String ();
+ String (const char *s);
+- String (const string &s);
++ String (const std::string &s);
+ String (const String &s);
+ ~String ();
+
+@@ -43,7 +43,7 @@
+ int compare (const char *s) const;
+ int compare (const String &s) const;
+ const char *c_str () const;
+- string std_str () const;
++ std::string std_str () const;
+ bool empty () const;
+
+ String &operator= (const String &other);
+@@ -57,7 +57,7 @@
+ char &operator[] (unsigned int i);
+ const char &operator[] (unsigned int i) const;
+
+- friend ostream &operator<< (ostream &o, const String &s);
++ friend std::ostream &operator<< (std::ostream &o, const String &s);
+ };
+
+
diff --git a/math/graphthing/files/patch-src-unit_test.cc b/math/graphthing/files/patch-src-unit_test.cc
new file mode 100644
index 000000000000..3b7067149e14
--- /dev/null
+++ b/math/graphthing/files/patch-src-unit_test.cc
@@ -0,0 +1,53 @@
+--- src/unit_test.cc.orig Fri Oct 25 16:15:51 2002
++++ src/unit_test.cc Fri Oct 25 16:21:23 2002
+@@ -19,14 +19,14 @@
+
+
+ #define TEST_FAIL \
+- cout << "\t* Failure at line " << __LINE__ << '\n'
++ std::cout << "\t* Failure at line " << __LINE__ << '\n'
+ #define TEST(test) \
+ ++subtests; \
+ if (!(test)) { ++errors; TEST_FAIL; }
+ #define START_TEST(name) \
+ ++tests; \
+ test_name = (name); \
+- cout << "Running test " << tests << ": '" << test_name \
++ std::cout << "Running test " << tests << ": '" << test_name \
+ << "'\n"
+
+
+@@ -37,9 +37,9 @@
+ char *test_name;
+
+
+- cout << "-----------------------------\n";
+- cout << " GraphThing unit testing\n";
+- cout << "-----------------------------\n";
++ std::cout << "-----------------------------\n";
++ std::cout << " GraphThing unit testing\n";
++ std::cout << "-----------------------------\n";
+
+
+ /**************** START OF TESTS ****************/
+@@ -107,13 +107,13 @@
+
+ /**************** END OF TESTS ****************/
+
+- cout << "\n";
+- cout << "-----------------------------\n";
+- cout << "Total tests: " << tests << '\n';
+- cout << " Errors: " << errors << '\n';
+- cout << '\n';
+- cout << " (Subtests: " << subtests << ")\n";
+- cout << "-----------------------------\n";
++ std::cout << "\n";
++ std::cout << "-----------------------------\n";
++ std::cout << "Total tests: " << tests << '\n';
++ std::cout << " Errors: " << errors << '\n';
++ std::cout << '\n';
++ std::cout << " (Subtests: " << subtests << ")\n";
++ std::cout << "-----------------------------\n";
+
+ return 0;
+ }
diff --git a/math/graphthing/files/patch-src-vertex.h b/math/graphthing/files/patch-src-vertex.h
new file mode 100644
index 000000000000..eeb61900221b
--- /dev/null
+++ b/math/graphthing/files/patch-src-vertex.h
@@ -0,0 +1,27 @@
+--- src/vertex.h.orig Tue Feb 12 05:47:23 2002
++++ src/vertex.h Fri Oct 25 16:13:18 2002
+@@ -15,12 +15,12 @@
+ class Vertex
+ {
+ private:
+- vector<Edge *> edges; /* Edges adjacent to this vertex */
++ std::vector<Edge *> edges; /* Edges adjacent to this vertex */
+
+ public:
+
+- typedef vector<Edge *>::iterator e_iterator;
+- typedef vector<Edge *>::const_iterator e_const_iterator;
++ typedef std::vector<Edge *>::iterator e_iterator;
++ typedef std::vector<Edge *>::const_iterator e_const_iterator;
+
+ String label;
+ int x;
+@@ -45,7 +45,7 @@
+ void unhook (Edge *e);
+
+ Vertex &operator= (const Vertex &other);
+- friend ostream &operator<< (ostream &o, const Vertex &v);
++ friend std::ostream &operator<< (std::ostream &o, const Vertex &v);
+ };
+
+ #endif /* __VERTEX_H__ */