Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/graph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-10-13 19:32:39 +0300
committerGitHub <noreply@github.com>2016-10-13 19:32:39 +0300
commitf6062bc79455cb5da77601f7b6ed6f919c735a89 (patch)
treed7b7c9134e42b7e29b03f519fccd743b35c6e2a2
parent34d712890badbb9f9d05a46d073ff1d91af0f6ee (diff)
parentb0728f6a62a3f360200a0937a0389bea720e2b18 (diff)
Merge pull request #28 from BTNC/master
change to work on windows
-rw-r--r--graphviz.lua6
-rw-r--r--test/test_graph.lua8
-rw-r--r--test/test_graphviz.lua5
-rw-r--r--test/test_old.lua2
4 files changed, 10 insertions, 11 deletions
diff --git a/graphviz.lua b/graphviz.lua
index 8588f75..535ce83 100644
--- a/graphviz.lua
+++ b/graphviz.lua
@@ -36,12 +36,14 @@ if ffiOk then
FILE * fopen ( const char * filename, const char * mode );
int fclose ( FILE * stream );
]]
- graphvizOk, graphviz = pcall(function() return ffi.load('libgvc', true) end)
+ local libgvc = ffi.os == 'Windows' and 'gvc' or 'libgvc'
+ graphvizOk, graphviz = pcall(function() return ffi.load(libgvc, true) end)
if not graphvizOk then
graphvizOk, graphviz = pcall(function() return ffi.load('libgvc.so.6', true) end)
end
- cgraphOk, cgraph = pcall(function() return ffi.load('libcgraph', true) end)
+ local libcgraph = ffi.os == 'Windows' and 'cgraph' or 'libcgraph'
+ cgraphOk, cgraph = pcall(function() return ffi.load(libcgraph, true) end)
if not cgraphOk then
cgraphOk, cgraph = pcall(function() return ffi.load('libcgraph.so.6', true) end)
end
diff --git a/test/test_graph.lua b/test/test_graph.lua
index 7f33581..34857b3 100644
--- a/test/test_graph.lua
+++ b/test/test_graph.lua
@@ -1,9 +1,7 @@
-
require 'graph'
-require 'totem'
-
-local tester = totem.Tester()
-local tests = {}
+require 'torch'
+local tester = torch.Tester()
+local tests = torch.TestSuite()
local function create_graph(nlayers, ninputs, noutputs, nhiddens, droprate)
local g = graph.Graph()
diff --git a/test/test_graphviz.lua b/test/test_graphviz.lua
index 1d344a9..e3fd711 100644
--- a/test/test_graphviz.lua
+++ b/test/test_graphviz.lua
@@ -1,8 +1,7 @@
-require 'totem'
require 'graph'
require 'torch'
-local tester = totem.Tester()
-local tests = {}
+local tester = torch.Tester()
+local tests = torch.TestSuite()
function tests.layout()
local g = graph.Graph()
diff --git a/test/test_old.lua b/test/test_old.lua
index 17ae596..0415cf4 100644
--- a/test/test_old.lua
+++ b/test/test_old.lua
@@ -10,7 +10,7 @@ g:add(graph.Edge(root,n2))
nend = graph.Node(20)
g:add(graph.Edge(n1,nend))
g:add(graph.Edge(n2,nend))
-g:add(graph.Edge(nend,root))
+-- g:add(graph.Edge(nend,root))
local i = 0
print('======= BFS ==========')