예제 #1
0
 public Graph(int vertices, IEnumerable <Tuple <int, int> > edges, bool directed)
 {
     graph = new igraph_t();
     DllImporter.igraph_empty(graph, vertices, directed);
     foreach (var e in edges)
     {
         DllImporter.igraph_add_edge(graph, e.Item1, e.Item2);
     }
 }
예제 #2
0
 public void Dispose()
 {
     if (graph == null)
     {
         return;
     }
     DllImporter.igraph_destroy(graph);
     graph = null;
     GC.SuppressFinalize(this);
 }
예제 #3
0
 public Graph(int vertices, bool directed)
 {
     graph = new igraph_t();
     DllImporter.igraph_empty(graph, vertices, directed);
 }