diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-08 21:09:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-08 21:09:31 +0000 |
commit | 3de6683607c3042def19b77ca8a338814d0a1575 (patch) | |
tree | 106d17a816c9eb899d2943cbadb33aa9b627f4ca /Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib | |
parent | 3e178d666f929257b38c4d6857bccf4076145c29 (diff) |
pgf revert again to r49607, after mistaken update
git-svn-id: svn://tug.org/texlive/trunk@51047 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib')
10 files changed, 73 insertions, 73 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua index e4fe21d9422..292f9e56bf2 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua @@ -13,7 +13,7 @@ --- -- This library offers a number of methods for working with Bezi\'er --- curves. +-- curves. local Bezier = {} @@ -29,7 +29,7 @@ local Coordinate = require 'pgf.gd.model.Coordinate' --- -- Compute a point ``along a curve at a time''. You provide the four -- coordinates of the curve and a time. You get a point on the curve --- as return value as well as the two support vector for curve +-- as return value as well as the two suport vector for curve -- before this point and two support vectors for the curve after the -- point. -- @@ -115,7 +115,7 @@ function Bezier.supportsForPointsAtTime(from, p1, t1, p2, t2, to) local f1b = t1 * s1^2 * 3 local f1c = t1^2 * s1 * 3 local f1d = t1^3 - + local f2a = s2^3 local f2b = t2 * s2^2 * 3 local f2c = t2^2 * s2 * 3 @@ -127,7 +127,7 @@ function Bezier.supportsForPointsAtTime(from, p1, t1, p2, t2, to) -- -- p1.y - from.y * f1a - to.y * f1d = sup1.y * f1b + sup2.y * f1c -- p2.y - from.y * f2a - to.y * f2d = sup1.y * f2b + sup2.y * f2c - + local a = f1b local b = f1c local c = p1.x - from.x * f1a - to.x * f1d @@ -138,16 +138,16 @@ function Bezier.supportsForPointsAtTime(from, p1, t1, p2, t2, to) local det = a*e - b*d local x1 = -(b*f - e*c)/det local x2 = -(c*d - a*f)/det - + local c = p1.y - from.y * f1a - to.y * f1d local f = p2.y - from.y * f2a - to.y * f2d - + local det = a*e - b*d local y1 = -(b*f - e*c)/det local y2 = -(c*d - a*f)/det return Coordinate.new(x1,y1), Coordinate.new(x2,y2) - + end diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua index 81728a1a444..aaad047c702 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua @@ -30,12 +30,12 @@ local Digraph = require "pgf.gd.model.Digraph" -- arrows. For instance, while "a <- b" will cause an arc from a to be -- to be added to the syntactic digraph, calling this function will -- return a digraph in which there is an arc from b to a rather than --- the other way round. In detail, "a <- b" is translated as just +-- the other way round. In detail, "a <- b" is tranlated as just -- described, "a -> b" yields an arc from a to b as expected, "a <-> b" -- and "a -- b" yield arcs in both directions and, finally, "a -!- b" -- yields no arc at all. -- --- @param syntactic_digraph A syntactic digraph, usually the "input" +-- @param syntactic_digraph A syntacitic digraph, usually the "input" -- graph as specified syntactically be the user. -- -- @return A new "semantic" digraph object. @@ -49,12 +49,12 @@ function Direct.digraphFromSyntacticDigraph(syntactic_digraph) for _,m in ipairs(a.syntactic_edges) do local direction = m.direction if direction == "->" then - digraph:connect(a.tail, a.head) + digraph:connect(a.tail, a.head) elseif direction == "<-" then - digraph:connect(a.head, a.tail) + digraph:connect(a.head, a.tail) elseif direction == "--" or direction == "<->" then - digraph:connect(a.tail, a.head) - digraph:connect(a.head, a.tail) + digraph:connect(a.tail, a.head) + digraph:connect(a.head, a.tail) end -- Case -!-: No edges... end @@ -92,4 +92,4 @@ end -- Done -return Direct +return Direct
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua index 880796ce973..952f37796eb 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua @@ -19,7 +19,7 @@ -- arcs, and a digraph object representing this graph get -- constructed. However, even though syntactic annotations such as -- options for the vertices and arcs are attached to them and can be --- accessed through the graph objects, some syntactic information is +-- accessed through the graph objects, some syntactic inforamtion is -- neither represented in the digraph object nor in the vertices and -- the arcs. A typical example is a ``missing'' node in a tree: Since -- it is missing, there is neither a vertex object nor arc objects @@ -35,37 +35,37 @@ -- -- The following events are created during the parsing process by the -- standard parsers of \tikzname: --- % +-- -- \begin{itemize} --- \item[|node|] When a node of the input graph has been parsed and --- a |Vertex| object has been created for it, an event with kind --- |node| is created. The |parameter| of this event is the --- just-created vertex. +-- \item[|node|] When a node of the input graph has been parsed and +-- a |Vertex| object has been created for it, an event with kind +-- |node| is created. The |parameter| of this event is the +-- just-created vertex. -- --- The same kind of event is used to indicate ``missing'' nodes. In --- this case, the |parameters| field is |nil|. --- \item[|edge|] When an edge of the input graph has been parsed, an --- event is created of kind |edge|. The |parameters| field will store --- an array with two entries: The first is the |Arc| object whose --- |syntactic_edges| field stores the |edge|. The second is the index --- of the edge inside the |syntactic_edges| field. --- \item[|begin|] --- Signals the beginning of a group, which will be ended with a --- corresponding |end| event later on. The |parameters| field will --- indicate the kind of group. Currently, only the string --- |"descendants"| is used as |parameters|, indicating the start of --- several nodes that are descendants of a given node. This --- information can be used by algorithms for reconstructing the --- input structure of trees. --- \item[|end|] Signals the end of a group begun by a |begin| event --- earlier on. +-- The same kind of event is used to indicate ``missing'' nodes. In +-- this case, the |parameters| field is |nil|. +-- \item[|edge|] When an edge of the input graph has been parsed, an +-- event is created of kind |edge|. The |parameters| field will store +-- an array with two entries: The first is the |Arc| object whose +-- |syntactic_edges| field stores the |edge|. The second is the index +-- of the edge inside the |syntactic_edges| field. +-- \item[|begin|] +-- Signals the beginning of a group, which will be ended with a +-- corresponding |end| event later on. The |parameters| field will +-- indicate the kind of group. Currently, only the string +-- |"descendants"| is used as |parameters|, indicating the start of +-- several nodes that are descendants of a given node. This +-- information can be used by algorithms for reconstructing the +-- input structure of trees. +-- \item[|end|] Signals the end of a group begun by a |begin| event +-- earlier on. -- \end{itemize} --- --- @field kind A string representing the kind of the events. +-- +-- @field kind A string representing the kind of the events. -- @field parameters Kind-specific parameters. -- @field index A number that stores the events logical position in -- the sequence of events. The number need not be an integer array --- index. +-- index. -- local Event = {} Event.__index = Event diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua index fc2043d5237..0014c94a375 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua @@ -13,7 +13,7 @@ --- -- This table provides two utility functions for managing ``lookup --- tables''. Such a table is a mixture of an array and a hashtable: +-- tables.'' Such a table is a mixture of an array and a hashtable: -- It stores (only) tables. Each table is stored once in a normal -- array position. Additionally, the lookup table is also indexed at -- the position of the table (used as a key) and this position is set @@ -30,7 +30,7 @@ require("pgf.gd.lib").LookupTable = LookupTable --- -- Add all elements in the |array| to a lookup table. If an element of -- the array is already present in the table, it will not be added --- again. +-- again. -- -- This operation takes time $O(|\verb!array!|)$. -- @@ -50,7 +50,7 @@ end --- -- Add one element to a lookup table. If it is already present in the --- table, it will not be added again. +-- table, it will not be added again. -- -- This operation takes time $O(1)$. -- diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua index 4bfa896ef95..05b480713b0 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua @@ -27,11 +27,11 @@ local PriorityQueue = require "pgf.gd.lib.PriorityQueue" --- --- Performs the Dijkstra algorithm to solve the single-source shortest path problem. +-- Performs the Dijkstra algorithm to solve the single-source shortes path problem. -- --- The algorithm computes the shortest paths from |source| to all nodes --- in the graph. It also generates a table with distance level sets, each of --- which contain all nodes that have the same corresponding distance to +-- The algorithm computes the shortest paths from |source| to all nodes +-- in the graph. It also generates a table with distance level sets, each of +-- which contain all nodes that have the same corresponding distance to -- |source|. Finally, a mapping of nodes to their parents along the -- shortest paths is generated to allow the reconstruction of the paths -- that were chosen by the Dijkstra algorithm. @@ -39,7 +39,7 @@ local PriorityQueue = require "pgf.gd.lib.PriorityQueue" -- @param graph The graph to compute the shortest paths for. -- @param source The node to compute the distances to. -- --- @return A mapping of nodes to their distance to |source|. +-- @return A mapping of nodes to their distance to |source|. -- @return An array of distance level sets. The set at index |i| contains -- all nodes that have a distance of |i| to |source|. -- @return A mapping of nodes to their parents to allow the reconstruction @@ -95,7 +95,7 @@ end --- --- Performs the Floyd-Warshall algorithm to solve the all-source shortest path problem. +-- Performs the Floyd-Warshall algorithm to solve the all-source shortes path problem. -- -- @param graph The graph to compute the shortest paths for. -- diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua index 3fd29cdb748..378800fbf5b 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua @@ -107,7 +107,7 @@ end --- Internals: An implementation of Fibonacci heaps. +-- Internals: An implementation of fibonacci heaps. FibonacciHeap.__index = FibonacciHeap @@ -200,7 +200,7 @@ function FibonacciHeap:decreaseValue(node, value) assert(value <= node.value) node.value = value - + if node.value < node.parent.value then local parent = node.parent self:cutFromParent(node) @@ -231,7 +231,7 @@ end function FibonacciHeap:linkRoots(root, child) child.root = root child.parent = root - + child = self:removeTableElement(self.trees, child) table.insert(root.children, child) diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua index bcb72761909..abb428b8725 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua @@ -12,7 +12,7 @@ --- The Simplifiers class is a singleton object. --- Its methods allow implement methods for simplifying graphs, for instance +-- Its methods allow implement methods for simplifing graphs, for instance -- for removing loops or multiedges or computing spanning trees. local Simplifiers = {} @@ -104,7 +104,7 @@ function Simplifiers:classifyEdges(graph) completed[node] = true pop() else - for i=#edges_to_traverse,1,-1 do + for i=#edges_to_traverse,1,-1 do local neighbour = edges_to_traverse[i]:getNeighbour(node) discovered[neighbour] = true push(neighbour) @@ -199,9 +199,9 @@ function Simplifiers:collapseMultiedgesOldModel(algorithm, collapse_action) collapsed_edges[multiedge[neighbour]] = {} end - if collapse_action then - collapse_action(multiedge[neighbour], edge, graph) - end + if collapse_action then + collapse_action(multiedge[neighbour], edge, graph) + end table.insert(collapsed_edges[multiedge[neighbour]], edge) end @@ -251,12 +251,12 @@ function Simplifiers:expandMultiedgesOldModel(algorithm) -- Copy bend points for _,p in ipairs(multiedge.bend_points) do - edge.bend_points[#edge.bend_points+1] = p:copy() + edge.bend_points[#edge.bend_points+1] = p:copy() end -- Copy options for k,v in pairs(multiedge.algorithmically_generated_options) do - edge.algorithmically_generated_options[k] = v + edge.algorithmically_generated_options[k] = v end for _,node in ipairs(edge.nodes) do @@ -276,4 +276,4 @@ end -- Done -return Simplifiers +return Simplifiers
\ No newline at end of file diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua index 75084b6e38b..dfab15697de 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua @@ -13,7 +13,7 @@ --- A Stack is a very simple wrapper around an array -- --- +-- local Stack = {} Stack.__index = Stack diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua index e029fdf7ff8..eb520e77452 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua @@ -19,12 +19,12 @@ -- storage. Also, you can specify that for each object of the storage -- you store a table. In this case, there is no need to initialize -- this table for each object; rather, when you write into such a --- table and it does not yet exist, it is created ``on the fly''. +-- table and it does not yet exist, it is created ``on the fly''. -- -- The typical way you use storages is best explained with the -- following example: Suppose you want to write a depth-first search -- algorithm for a graph. This algorithm might wish to mark all nodes --- it has visited. It could just say |v.marked = true|, but this might +-- it has visisted. It could just say |v.marked = true|, but this might -- clash with someone else also using the |marked| key. The solution is -- to create a |marked| storage. The algorithm can first say --\begin{codeexample}[code only, tikz syntax=false] @@ -40,13 +40,13 @@ -- no longer in use get removed automatically. You can also make it a -- member variable of the algorithm class, which allows you make the -- information about which objects are marked globally --- accessible. +-- accessible. -- -- Now suppose the algorithm would like to store even more stuff in -- the storage. For this, we might use a table and can use the fact -- that a storage will automatically create a table when necessary: --\begin{codeexample}[code only, tikz syntax=false] ---local info = Storage.newTableStorage() +--local info = Storage.newTableStorage() -- --info[v].marked = true -- the "info[v]" table is -- -- created automatically here @@ -66,7 +66,7 @@ require("pgf.gd.lib").Storage = Storage local SimpleStorageMetaTable = { __mode = "k" } --- The advanced metatable for table storages: +-- The adcanved metatable for table storages: local TableStorageMetaTable = { __mode = "k", @@ -91,7 +91,7 @@ end --- -- Create a new storage object which will install a table for every --- entry automatically. +-- entry automatilly. -- -- @return A new |Storage| instance. diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua index 7695b1b2395..1f81b269202 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua @@ -42,7 +42,7 @@ function Transform.new(a,b,c,d,x,y) end ---- Creates a new transformation object that represents a shift. +--- Creates a new transformation object that represents a shift. -- -- @param x An x-shift -- @param y A y-shift @@ -54,7 +54,7 @@ function Transform.new_shift(x,y) end ---- Creates a new transformation object that represents a rotation. +--- Creates a new transformation object that represents a rotation. -- -- @param angle An angle -- @@ -67,7 +67,7 @@ function Transform.new_rotation(angle) end ---- Creates a new transformation object that represents a scaling. +--- Creates a new transformation object that represents a scaling. -- -- @param x The horizontal scaling -- @param y The vertical scaling (if missing, the horizontal scaling is used) @@ -94,8 +94,8 @@ function Transform.concat(a,b) local a1, a2, a3, a4, a5, a6, b1, b2, b3, b4, b5, b6 = a[1], a[2], a[3], a[4], a[5], a[6], b[1], b[2], b[3], b[4], b[5], b[6] return { a1*b1 + a2*b3, a1*b2 + a2*b4, - a3*b1 + a4*b3, a3*b2 + a4*b4, - a1*b5 + a2*b6 + a5, a3*b5 + a4*b6 + a6 } + a3*b1 + a4*b3, a3*b2 + a4*b4, + a1*b5 + a2*b6 + a5, a3*b5 + a4*b6 + a6 } end @@ -117,4 +117,4 @@ end -- Done -return Transform +return Transform
\ No newline at end of file |