1. 17 Dec, 2007 1 commit
    • Tiago Peixoto's avatar
      Fix visibility/RTTI problem with run_action() · 0c1f0df2
      Tiago Peixoto authored
      Some visibility voodoo is necessary to ensure that RTTI work properly
      across DSO boundaries, which is necessary to properly handle dynamic
      property maps and such. Additionally, the action template must have a
      different name each time the action code changes, to avoid additional
      weirdness.
      
      This also adds some other utility functions/typedefs to make writing
      "inline" c++ code easier.
      0c1f0df2
  2. 14 Dec, 2007 2 commits
    • Tiago Peixoto's avatar
      Fix add_edge_property() · 5b45d806
      Tiago Peixoto authored
      add_edge_property() should return a edge property not a vertex_property
      5b45d806
    • Tiago Peixoto's avatar
      Add support for running arbitrary C++ code from python · 866bb994
      Tiago Peixoto authored
      It is now possible to run arbitrary "inline" C++ code from python, using
      scipy.weave, as such:
      
              g = graph_tool.Graph()
              g.load("foo.xml")
              value = 2.0
              g.run_action('cout << num_vertices(g) << " " << value << endl;',
                           ["value"]);
      
      The code gets compiled the first time, and is reused after that. Python
      local and global variables can be passed to C++, as shown above, by
      specifying a list of passed variables as the second argument.
      866bb994
  3. 13 Dec, 2007 1 commit
  4. 06 Dec, 2007 2 commits
    • Tiago Peixoto's avatar
      Fix edit_{vertex|edge|graph}_property() · db440664
      Tiago Peixoto authored
      The graph object passed to the edit function is now a instance of the
      Graph class which wraps GraphInterface, not a GraphInterface instance.
      db440664
    • Tiago Peixoto's avatar
      Implement lazy loading of graphs · de0a0a8e
      Tiago Peixoto authored
      Graphs can now be loaded "lazily" with the lazy_load() function, which
      works just like load(), but doesn't actually load the graph, which is
      delayed until the graph is accessed for the first time, e.g.
      
          import graph_tool
      
          g = graph_tool.Graph()
          g.lazy_load("example.xml")
      
          g.number_of_vertices()  # <- the graph is only loaded here
      de0a0a8e
  5. 03 Dec, 2007 6 commits
  6. 30 Nov, 2007 2 commits
    • Tiago Peixoto's avatar
      Merge branch 'rewiring' · d0cf197c
      Tiago Peixoto authored
      Improve formatting of src/graph/graph_rewiring.cc (line breaks at column
      80, typedefs, trailing whitespace removal, etc)
      
      Conflicts:
      
      	src/graph-tool
      	src/graph/graph_bind.cc
      d0cf197c
    • Tiago Peixoto's avatar
      Further improvements of the python interface · 1a0e9b5f
      Tiago Peixoto authored
      Property maps can now be obtained as such:
      
               weight = g.edge_properties['weight']
               print weight[v] # v is a Vertex object
               weight[v] = 2.0
               # and so on...
      
      The list of properties is obtained from g.vertex_properties,
      g.edge_properties and g.graph_properties, which can be read as
      dictionaries. The last can be set also, as such:
      
               g.graph_properties = {foo:"bar", baz:42}
      
      Functions to add and remove vertices or adges were also added
      (add_{vertex|edge}, remove_{vertex|edgge}).
      
      Vertex and Edge types can also now be printed for convenience, as such:
      
             for v in g.vertices():
                 print v
             for e in g.edges():
                 print e
      
      which results, for example, in:
      0
      1
      2
      3
      4
      5
      6
      (0,1)
      (1,2)
      (2,6)
      (3,4)
      (4,5)
      (4,2)
      (5,6)
      (6,1)
      
      (this also adds the forgotten graph_tool.py file, which was previously
      on .gitignore)
      1a0e9b5f
  7. 28 Nov, 2007 1 commit
  8. 26 Nov, 2007 3 commits
  9. 20 Nov, 2007 1 commit
    • Tiago Peixoto's avatar
      Complete re-factoring of python module and command line tool · 8b32d7fc
      Tiago Peixoto authored
      The program was split in two parts:
      
          1. A python module, graph_tool.py, which encapsulates the graph
             manipulation under a Graph class. Now the following can be done:
      
                    import graph_tool
                    g1 = graph_tool.Graph()
                    g2 = graph_tool.Graph()
                    g1.load("foo.xml")
                    g2.load("bar.xml")
                    print g1.number_of_vertices(), g2.number_of_vertices()
      
          2. A standalone command line tool, graph-tool, which imports
             graph_tool.py, and exposes the Graph methods as command line
             options.
      
      The whole command line engine was thus (once again) entirely
      rewritten. It is now Crack-Free, and simply mirrors the methods of the
      Graph class as command line options, using, for this, the beauty of
      function decorators. It classifies now, I believe, as Pythonic.
      8b32d7fc
  10. 11 Nov, 2007 1 commit
  11. 10 Nov, 2007 2 commits
  12. 05 Nov, 2007 1 commit
    • Ale Abdo's avatar
      Correlated random rewiring functional · 0b15235f
      Ale Abdo authored
      Several changes in the random rewiring code, making it fully
      functional for the correlated case.
      The reshuffling operations lag in efficiency, even though already
      the algorithm runs in little time.
      0b15235f
  13. 04 Nov, 2007 4 commits
  14. 27 Oct, 2007 1 commit
  15. 24 Oct, 2007 7 commits
  16. 23 Oct, 2007 4 commits
  17. 15 Oct, 2007 1 commit