zadt 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf2ef5172d8110a1e4ba6f60c3a0900f333fe3ec
|
4
|
+
data.tar.gz: 3d79501d0d498ebd7fc84a5c14b670571b6602a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e981402ce45178ce4f4d6038c70c65740502a9458139f8ecf478625fdbe382944fe05f031e6f20430960b4c737cd2623dff057ec960934408a7dd6b4e23133
|
7
|
+
data.tar.gz: 423da023a5a1763b4e105d106e507129be6255cfde3c1233f495e27b2f7996612826e6f5d1ff249d5ba7c12d237db09520aa204f616c019b2bf0485fa12c8878
|
@@ -16,7 +16,7 @@ module Zadt
|
|
16
16
|
puts "-FaceGraph, a sub-class of Graph which includes Faces"
|
17
17
|
puts "--Face, a space surrounded by Edges. Consists of Vertices and the Edges connecting them"
|
18
18
|
puts ""
|
19
|
-
puts "Each data type also has a help function. Type Zadt::Stack::help for a list of Stack
|
19
|
+
puts "Each data type also has a help function. Type Zadt::Stack::help or Zadt::Stack::methods for a list of Stack methods, and so on for each data type."
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -13,20 +13,20 @@ module Zadt
|
|
13
13
|
|
14
14
|
def self.help
|
15
15
|
puts "Here are the functions for FaceGraph:"
|
16
|
-
puts "#add_face(edges_array)"
|
17
|
-
puts "#make_original_face(num_edges)"
|
18
|
-
puts "#add_attached_face(vertex_array, num_edges)"
|
19
|
-
puts "#
|
20
|
-
puts "#
|
21
|
-
puts "
|
22
|
-
puts "#
|
23
|
-
puts "
|
16
|
+
puts "#add_face(edges_array), makes a face with the given edges (must be cyclicly connected)"
|
17
|
+
puts "#make_original_face(num_edges), which makes a standard disconnected face"
|
18
|
+
puts "#add_attached_face(vertex_array, num_edges), which adds a face connected to the vertex_array"
|
19
|
+
puts "#find_neighbors(vertex_array), lists all faces containing the given vertices"
|
20
|
+
puts "#find_face_neighbors(vertex_array), which finds all neighbors of the given face"
|
21
|
+
puts "--a neighbor of a face is defined as one that shares a vertex (not necessarily an edge)"
|
22
|
+
puts "#make_vertex_line(vertex_array), reorders a list of connected vertices by connection sequence"
|
23
|
+
puts ""
|
24
24
|
puts "FaceGraph also inherits the following functions from Graph:"
|
25
25
|
puts "#add_vertex"
|
26
26
|
puts "#remove_vertex(vertex)"
|
27
|
-
puts "#make_connection(v1,v2)"
|
27
|
+
puts "#make_connection(v1,v2), adds an edge between two vertices"
|
28
28
|
puts "#break_connection(v1,v2)"
|
29
|
-
puts "#find_connection(v1,v2)"
|
29
|
+
puts "#find_connection(v1,v2), returns edge connecting two given vertices"
|
30
30
|
puts "#is_connected?(v1,v2)"
|
31
31
|
end
|
32
32
|
|
@@ -134,6 +134,14 @@ module Zadt
|
|
134
134
|
neighbors.uniq
|
135
135
|
end
|
136
136
|
|
137
|
+
# Return all neighbors of the given faces
|
138
|
+
# Neighbor is defined as sharing a vertex,
|
139
|
+
# not necessarily sharing an edge.
|
140
|
+
def find_face_neighbors(face)
|
141
|
+
neighbors = find_neighbors(face.vertices)
|
142
|
+
neighbors - face
|
143
|
+
end
|
144
|
+
|
137
145
|
def make_vertex_line(vertex_array)
|
138
146
|
connection_line = []
|
139
147
|
connection_line << vertex_array.first
|
@@ -150,7 +158,7 @@ module Zadt
|
|
150
158
|
end
|
151
159
|
connection_line
|
152
160
|
end
|
153
|
-
|
161
|
+
private
|
154
162
|
def make_neighbors(face1, face2)
|
155
163
|
face1.add_neighbor(face2)
|
156
164
|
face2.add_neighbor(face1)
|
@@ -16,9 +16,9 @@ module Zadt
|
|
16
16
|
puts "Here are the functions for Graph:"
|
17
17
|
puts "#add_vertex"
|
18
18
|
puts "#remove_vertex(vertex)"
|
19
|
-
puts "#make_connection(v1,v2)"
|
19
|
+
puts "#make_connection(v1,v2), adds an edge between two vertices"
|
20
20
|
puts "#break_connection(v1,v2)"
|
21
|
-
puts "#find_connection(v1,v2)"
|
21
|
+
puts "#find_connection(v1,v2), returns edge connecting two given vertices"
|
22
22
|
puts "#is_connected?(v1,v2)"
|
23
23
|
end
|
24
24
|
|
data/lib/zadt/version.rb
CHANGED