<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,6 +9,25 @@ Graph::~Graph() {
 		delete (*i).second;
 }
 
+/**
+ * Method adds a vertex to the graph
+ *
+ * @param int
+ * @param int
+ * @param int
+ *
+ */
+void Graph::addVertex(unsigned int k, double x, double y) {
+	vertex_map::iterator i = vmap.find(k);
+
+	if (i == vmap.end() ) {
+		Vertex *new_vertex = new Vertex(x, k);
+		vmap[ k ] = new_vertex;
+		return new_vertex;
+	}
+
+	return (*i).second;
+}
 
 /**
  * getVertex method
@@ -18,8 +37,7 @@ Graph::~Graph() {
  * @param int
  * @return Vertex*
  */
-
-Graph::getVertex(int v) {
+Vertex* Graph::getVertex(int v) {
 	vertex_map::iterator i = vmap.find(v);
 
 	if (i == vmap.end() ) {</diff>
      <filename>graf.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -16,8 +16,8 @@
 class Vertex 
 {
 public:
-	unsigned int x;		// Vertex x coordinate
-	unsigned int y;		// Vertex y cooridnate	
+	double x;		// Vertex x coordinate
+	double y;		// Vertex y cooridnate	
 	vector&lt;Edge&gt; adj;	// Vector of adjacent vert.
 	double	dist;		// to compute dist in finding shortest path alg.
 	Vertex	*prev;		// Previous Vertex on the path - to help print it
@@ -30,7 +30,7 @@ public:
 	 *	@para	int
 	 *
 	 */
-	Vertex ( int xco, int yco ) : x(xco), y(yco) {
+	Vertex ( double xco, double yco ) : x(xco), y(yco) {
 		reset();
 	}
 private:
@@ -104,6 +104,7 @@ public:
 	Graph() {}
 	~Graph();
 
+	void addVertex (int key, double x, double y);
 	void addEdge (int from, int to, double cost);
 	void printPath (int to) const;
 	void unweighted (int from);</diff>
      <filename>graf.h</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7fac74fbf49cdde2b2a5082da85a977f5457aa24</id>
    </parent>
  </parents>
  <author>
    <name>Pawel Ptaszynski</name>
    <email>pptaszynski@gmail.com</email>
  </author>
  <url>http://github.com/pptaszynski/aisdi-graf/commit/34248a334ccae0c4a340c0468e5bf9b9692c1028</url>
  <id>34248a334ccae0c4a340c0468e5bf9b9692c1028</id>
  <committed-date>2008-06-11T18:24:48-07:00</committed-date>
  <authored-date>2008-06-11T18:24:48-07:00</authored-date>
  <message>Added addVertex method. Changed type of x and y fields in Vertex class, so it fits the specification</message>
  <tree>7441e0efb87d8c430d2788f5abd2cd5185ced91e</tree>
  <committer>
    <name>Pawel Ptaszynski</name>
    <email>pptaszynski@gmail.com</email>
  </committer>
</commit>
