comparison mayachemtools/docs/modules/man3/Path.3 @ 0:73ae111cf86f draft

Uploaded
author deepakjadmin
date Wed, 20 Jan 2016 11:55:01 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:73ae111cf86f
1 .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.22)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings. \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 . ds -- \(*W-
28 . ds PI pi
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
31 . ds L" ""
32 . ds R" ""
33 . ds C` ""
34 . ds C' ""
35 'br\}
36 .el\{\
37 . ds -- \|\(em\|
38 . ds PI \(*p
39 . ds L" ``
40 . ds R" ''
41 'br\}
42 .\"
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
44 .ie \n(.g .ds Aq \(aq
45 .el .ds Aq '
46 .\"
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD. Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
51 .ie \nF \{\
52 . de IX
53 . tm Index:\\$1\t\\n%\t"\\$2"
54 ..
55 . nr % 0
56 . rr F
57 .\}
58 .el \{\
59 . de IX
60 ..
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear. Run. Save yourself. No user-serviceable parts.
65 . \" fudge factors for nroff and troff
66 .if n \{\
67 . ds #H 0
68 . ds #V .8m
69 . ds #F .3m
70 . ds #[ \f1
71 . ds #] \fP
72 .\}
73 .if t \{\
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 . ds #V .6m
76 . ds #F 0
77 . ds #[ \&
78 . ds #] \&
79 .\}
80 . \" simple accents for nroff and troff
81 .if n \{\
82 . ds ' \&
83 . ds ` \&
84 . ds ^ \&
85 . ds , \&
86 . ds ~ ~
87 . ds /
88 .\}
89 .if t \{\
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 . \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 . \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 . \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 . ds : e
114 . ds 8 ss
115 . ds o a
116 . ds d- d\h'-1'\(ga
117 . ds D- D\h'-1'\(hy
118 . ds th \o'bp'
119 . ds Th \o'LP'
120 . ds ae ae
121 . ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "PATH 1"
127 .TH PATH 1 "2015-03-29" "perl v5.14.2" "MayaChemTools"
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 Path \- Path class
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 use Graph::Path;
137 .PP
138 use Graph::Path qw(:all);
139 .SH "DESCRIPTION"
140 .IX Header "DESCRIPTION"
141 \&\fBPath\fR class provides the following methods:
142 .PP
143 new, AddVertex, AddVertices, Copy, GetCommonVertices, GetEdges, GetEndVertex,
144 GetLength, GetStartVertex, GetTerminalVertices, GetVertex, GetVertices, IsCycle,
145 IsIndependentCyclicPath, IsIndependentPath, IsPath, Join, JoinAtVertex, PopVertex,
146 PushVertex, PushVertices, Reverse, ShiftVertex, StringifyPath, UnshiftVertex,
147 UnshiftVertices
148 .PP
149 Path is a sequential list of vertices with an edge between two successive vertices. The path
150 becomes a cycle when start vertex and end vertex are the same.
151 .PP
152 The following operators are overloaded:
153 .PP
154 .Vb 1
155 \& "" == eq
156 .Ve
157 .SS "\s-1METHODS\s0"
158 .IX Subsection "METHODS"
159 .IP "\fBnew\fR" 4
160 .IX Item "new"
161 .Vb 2
162 \& $NewPath = new Path();
163 \& $NewPath = new Path(@VertexIDs);
164 .Ve
165 .Sp
166 Using specified \fIVertexIDs\fR, \fBnew\fR method creates a new \fBPath\fR object and returns
167 newly created \fBPath\fR object.
168 .IP "\fBAddVertex\fR" 4
169 .IX Item "AddVertex"
170 .Vb 1
171 \& $Path\->AddVertex($VertexID);
172 .Ve
173 .Sp
174 Adds \fIVertexID\fR to \fIPath\fR and returns \fIPath\fR.
175 .IP "\fBAddVertices\fR" 4
176 .IX Item "AddVertices"
177 .Vb 1
178 \& $Path\->AddVertices(@VertexIDs);
179 .Ve
180 .Sp
181 Adds vertices using \fIVertexIDs\fR to \fIPath\fR and returns \fIGraph\fR.
182 .IP "\fBCopy\fR" 4
183 .IX Item "Copy"
184 .Vb 1
185 \& $Return = $Path\->Copy();
186 .Ve
187 .Sp
188 Copies \fIPath\fR and its associated data using \fBStorable::dclone\fR and returns a new
189 \&\fBPath\fR object.
190 .IP "\fBGetCommonVertices\fR" 4
191 .IX Item "GetCommonVertices"
192 .Vb 2
193 \& @CommonVertices = $Path\->GetCommonVertices($OtherPath);
194 \& $NumOfCommonVertices = $Path\->GetCommonVertices($OtherPath);
195 .Ve
196 .Sp
197 Returns an array containing common vertex IDs between two paths. In scalar context, number
198 of common vertices is returned.
199 .IP "\fBGetEdges\fR" 4
200 .IX Item "GetEdges"
201 .Vb 2
202 \& @EdgesVertexIDs = $Path\->GetEdges();
203 \& $NumOfEdges = $Path\->GetEdges();
204 .Ve
205 .Sp
206 Returns an array containg successive paris of vertex IDs corresponding to all edges in \fIPath\fR.
207 In scalar context, the number of edges is returned.
208 .IP "\fBGetEndVertex\fR" 4
209 .IX Item "GetEndVertex"
210 .Vb 1
211 \& $VertexID = $Path\->GetEndVertex();
212 .Ve
213 .Sp
214 Returns \fBVertexID\fR of end vertex in \fIPath\fR.
215 .IP "\fBGetLength\fR" 4
216 .IX Item "GetLength"
217 .Vb 1
218 \& $Length = $Path\->GetLength();
219 .Ve
220 .Sp
221 Returns \fBLength\fR of \fIPath\fR corresponding to number of vertices in \fIPath\fR.
222 .IP "\fBGetStartVertex\fR" 4
223 .IX Item "GetStartVertex"
224 .Vb 1
225 \& $VertexID = $Path\->GetStartVertex();
226 .Ve
227 .Sp
228 Returns \fBVertexID\fR of start vertex in \fIPath\fR.
229 .IP "\fBGetTerminalVertices\fR" 4
230 .IX Item "GetTerminalVertices"
231 .Vb 1
232 \& ($StartVertexID, $EndVertexID) = $Path\->GetTerminalVertices();
233 .Ve
234 .Sp
235 Returns vertex IDs of start and end vertices in \fIPath\fR.
236 .IP "\fBGetVertex\fR" 4
237 .IX Item "GetVertex"
238 .Vb 1
239 \& $VertexID = $Path\->GetVertex($Index);
240 .Ve
241 .Sp
242 Returns specific vertex \s-1ID\s0 from \fIPath\fR corresponding to \fIIndex\fR with indicies starting from 0.
243 .IP "\fBGetVertices\fR" 4
244 .IX Item "GetVertices"
245 .Vb 2
246 \& @Vertices = $Path\->GetVertices();
247 \& $NumOfVertices = $Path\->GetVertices();
248 .Ve
249 .Sp
250 Returns an array containing all vertex IDs in \fIPath\fR. In scalar context, number of vertices
251 is returned.
252 .IP "\fBIsCycle\fR" 4
253 .IX Item "IsCycle"
254 .Vb 1
255 \& $Status = $Path\->IsCycle();
256 .Ve
257 .Sp
258 Returns 1 or 0 based on whether \fIPath\fR is a \fBCyclicPath\fR which has the same start and
259 end vertex IDs.
260 .IP "\fBIsIndependentCyclicPath\fR" 4
261 .IX Item "IsIndependentCyclicPath"
262 .Vb 1
263 \& $Status = $Path\->IsIndependentCyclicPath();
264 .Ve
265 .Sp
266 Returns 1 or 0 based on whether \fIPath\fR is an independent \fBCyclicPath\fR. For a \fIPath\fR to be
267 an independent cyclic path, it must be a cyclic path and have unique vertices.
268 .IP "\fBIsIndependentPath\fR" 4
269 .IX Item "IsIndependentPath"
270 .Vb 1
271 \& $Status = $Path\->IsIndependentPath();
272 .Ve
273 .Sp
274 Returns 1 or 0 based on whether \fIPath\fR is an independent \fBPath\fR. For a \fIPath\fR to be
275 an independent path, it must have unique vertices.
276 .IP "\fBIsPath\fR" 4
277 .IX Item "IsPath"
278 .Vb 1
279 \& $Status = Graph::Path::IsPath();
280 .Ve
281 .Sp
282 Returns 1 or 0 based on whether \fIObject\fR is a \fBPath\fR object
283 .IP "\fBJoin\fR" 4
284 .IX Item "Join"
285 .Vb 2
286 \& $NewPath = $Path\->Join($OtherPath);
287 \& $NewPath = $Path\->Join(@VertexIDs);
288 .Ve
289 .Sp
290 Joins existing \fIPath\fR with a new path specified as a \fIOtherPath\fR object or an array of \fIVertexIDs\fR
291 and returns \fINewPath\fR.
292 .Sp
293 In order to successfully join two paths, terminal vertices must have a common vertex. Based on the
294 common terminal vertex found, additional path vertices are added to the current \fIPath\fR in one of
295 the following four ways:
296 .Sp
297 .Vb 2
298 \& . EndVertex = NewStartVertex: New path at end of current path with
299 \& same vertices order
300 \&
301 \& . EndVertex = NewEndVertex: New path at end of current path with
302 \& reversed vertices order
303 \&
304 \& . StartVertex = NewEndVertex: New path at front of current path
305 \& with same vertices order
306 \&
307 \& . StartVertex = NewStartVertex: New path at front of current path
308 \& with reversed vertices order
309 .Ve
310 .IP "\fBJoinAtVertex\fR" 4
311 .IX Item "JoinAtVertex"
312 .Vb 1
313 \& $NewPath = $Path\->JoinAtVertex($OtherPath, $CenterVertexID);
314 .Ve
315 .Sp
316 Joins existing \fIPath\fR with \fIOtherPath\fR at a specified \fICeterVertexID\fR and returns a \fINewPath\fR.
317 .IP "\fBPopVertex\fR" 4
318 .IX Item "PopVertex"
319 .Vb 1
320 \& $Path\->PopVertex();
321 .Ve
322 .Sp
323 Removes end vertex from \fIPath\fR and returns \fIPath\fR.
324 .IP "\fBPushVertex\fR" 4
325 .IX Item "PushVertex"
326 .Vb 1
327 \& $Path\->PushVertex($VertexID);
328 .Ve
329 .Sp
330 Adds \fIVertexID\fR to \fIPath\fR after end vertex and returns \fIPath\fR.
331 .IP "\fBPushVertices\fR" 4
332 .IX Item "PushVertices"
333 .Vb 1
334 \& $Path\->PushVertices(@VertexIDs);
335 .Ve
336 .Sp
337 Adds \fIVertexIDs\fR to \fIPath\fR after end vertex and returns \fIPath\fR.
338 .IP "\fBReverse\fR" 4
339 .IX Item "Reverse"
340 .Vb 1
341 \& $Path\->Reverse();
342 .Ve
343 .Sp
344 Reverses order of vertices in \fIPath\fR and returns \fIPath\fR.
345 .IP "\fBShiftVertex\fR" 4
346 .IX Item "ShiftVertex"
347 .Vb 1
348 \& $Path\->ShiftVertex();
349 .Ve
350 .Sp
351 Removes start vertex from \fIPath\fR and returns \fIPath\fR.
352 .IP "\fBStringifyPath\fR" 4
353 .IX Item "StringifyPath"
354 .Vb 1
355 \& $String = $Path\->StringifyPath();
356 .Ve
357 .Sp
358 Returns a string containing information about \fIPath\fR object.
359 .IP "\fBUnshiftVertex\fR" 4
360 .IX Item "UnshiftVertex"
361 .Vb 1
362 \& $Path\->UnshiftVertex($VertexID);
363 .Ve
364 .Sp
365 Adds \fIVertexID\fR to \fIPath\fR before start vertex and returns \fIPath\fR.
366 .IP "\fBUnshiftVertices\fR" 4
367 .IX Item "UnshiftVertices"
368 .Vb 1
369 \& $Path\->UnshiftVertices(@VertexIDs);
370 .Ve
371 .Sp
372 Adds \fIVertexIDs\fR to \fIPath\fR before start vertex and returns \fIPath\fR.
373 .SH "AUTHOR"
374 .IX Header "AUTHOR"
375 Manish Sud <msud@san.rr.com>
376 .SH "SEE ALSO"
377 .IX Header "SEE ALSO"
378 PathGraph.pm, PathsTraversal.pm
379 .SH "COPYRIGHT"
380 .IX Header "COPYRIGHT"
381 Copyright (C) 2015 Manish Sud. All rights reserved.
382 .PP
383 This file is part of MayaChemTools.
384 .PP
385 MayaChemTools is free software; you can redistribute it and/or modify it under
386 the terms of the \s-1GNU\s0 Lesser General Public License as published by the Free
387 Software Foundation; either version 3 of the License, or (at your option)
388 any later version.