Comparing version 1.0.4 to 1.1.0
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var bellmanFord; |
@@ -1,4 +0,4 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
var Graph, bf, e, file, g, i, j, k, l, len, len1, len2, len3, ref, ref1, ref2, res; | ||
var Graph, bf, e, error, file, g, i, j, k, l, len, len1, len2, len3, ref, ref1, ref2, res; | ||
@@ -38,4 +38,4 @@ Graph = require("../Graph"); | ||
} | ||
} catch (_error) { | ||
e = _error; | ||
} catch (error) { | ||
e = error; | ||
console.log("Exception:", e); | ||
@@ -42,0 +42,0 @@ console.log(" ... that's ok, we expected it"); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var dfs; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, dfs, g, testGraphEdges; |
@@ -1,19 +0,7 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
var dijkstra, pad, trieFactory; | ||
var dijkstra, trieFactory; | ||
trieFactory = require("trie-array"); | ||
pad = function(number, size) { | ||
var res; | ||
res = "" + number; | ||
while (res.length < size) { | ||
res = "0" + res; | ||
} | ||
if (res.length === size) { | ||
return res; | ||
} | ||
throw "Number " + number + " is not correctly stringified"; | ||
}; | ||
dijkstra = function(graph, weightFn) { | ||
@@ -28,11 +16,16 @@ var edges, toStrFn; | ||
toStrFn = (function() { | ||
var e, j, len, maxLen; | ||
var e, j, len, maxLen, maxPrec, maxPrex, prec, ref; | ||
maxLen = 0; | ||
maxPrex = 0; | ||
for (j = 0, len = edges.length; j < len; j++) { | ||
e = edges[j]; | ||
prec = ((ref = weightFn(e).toString().split(".")[1]) != null ? ref.length : void 0) || 0; | ||
if (prec > maxPrec) { | ||
maxPrec = prec; | ||
} | ||
maxLen = maxLen + weightFn(e); | ||
} | ||
maxLen = ("" + maxLen).length; | ||
maxLen = maxLen.toString().split(".")[0].length; | ||
return function(x) { | ||
return pad(x.distance, maxLen); | ||
return trieFactory.numToStr(maxLen, maxPrec, x.distance); | ||
}; | ||
@@ -39,0 +32,0 @@ })(); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, dijkstra, g, testGraphEdges, weight; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var dfs, findPath; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, findPath, g, g2, testGraphEdges; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, ld; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, findPath, ld, maxFlow; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, flowFn, g, maxFlow, testGraphEdges; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var ajson, exampleData, minCost; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var Graph, MultiCommodityFlow, capacityFn, costFn, dijkstra, ld, maxFlow, minimumCost; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -62,3 +62,3 @@ var Graph, MultiCommodityFlow, findGE, ld, nextPoint; | ||
function MultiCommodityFlow(topo1, demand) { | ||
var link; | ||
var l, len, link, ref; | ||
this.topo = topo1 != null ? topo1 : []; | ||
@@ -90,2 +90,9 @@ this.demand = demand != null ? demand : []; | ||
}, {}); | ||
ref = this.topo; | ||
for (l = 0, len = ref.length; l < len; l++) { | ||
link = ref[l]; | ||
link.bandwidth.sort(function(x, y) { | ||
return x.cost - y.cost; | ||
}); | ||
} | ||
} | ||
@@ -92,0 +99,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var CommodityFlow, bw, costData, demand, minCost, ring; |
{ | ||
"name": "libgraph", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "graph lib in js/coffee", | ||
@@ -18,8 +18,8 @@ "main": "Graph.js", | ||
"lodash": "~2.4.1", | ||
"trie-array": "^1.1.1" | ||
"trie-array": "^1.1.3" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "^1.9.2", | ||
"coffee-script": "^1.10.0", | ||
"dag-json": "^1.0.2" | ||
} | ||
} |
@@ -1,6 +0,6 @@ | ||
// Generated by CoffeeScript 1.9.2 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
var i, len, test, tests; | ||
tests = ["./max-flow/test.coffee", "./minimum-cost-multi-commodity-flow/test.coffee", "./dfs/test.coffee", "./find-path/test.coffee", "./dijkstra/test.coffee", "./bellman-ford/test.coffee"]; | ||
tests = ["./max-flow/test.coffee", "./minimum-cost-multi-commodity-flow/test.coffee", "./dfs/test.coffee", "./find-path/test.coffee", "./dijkstra/test.coffee", "./bellman-ford/test.coffee", "./topo-order/test.coffee"]; | ||
@@ -7,0 +7,0 @@ for (i = 0, len = tests.length; i < len; i++) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1198
0
75397
52
Updatedtrie-array@^1.1.3