Public Member Functions
AdjacencyMatrixImport (AlgorithmContext context)
bool formatError (const char *s, int curLine)
bool import (const string &name)
vector< node > nodes
AdjacencyMatrixImport.cpp - Import a graph coded with matrix.
This plugin enables to import a graph coded with a matrix
The input format of this plugin is an ascii file where each line represents a row of the matrix. In each row, cells must be separated by a space.
Let M(i,j) be a cell of the matrix :
- if i==j we define the value of a node.
- if i!=j we define a directed edge between node[i] and node[j]
If M(i,j) is real value (0, .0, -1, -1.0), it is stored in the viewMetric property of the graph.
If M(i,j) is a string, it is stored in the viewLabel property of the graph.
Use & to set the viewMetric and viewLabel properties of a node or edge in the same time. If M(i,j) == @ an edge will be created without value
If M(i,j) == # no edge will be created between node[i] and node[j]
EXEMPLE 1 :
# # C
Define a graph with 3 nodes (with labels A B C) and without edge.
EXEMPLE 2 :
@ @ C
Define a simple complete graph with 3 nodes (with labels A B C) and no label (or value) on its edges
EXEMPLE 3 :
A # E & 5
# @ C
Define a graph with 3 nodes and 3 edges, the edge between A and C is named E and has the value 5
Version 1.0: First version replace old adjacency matrix format included in Tulip (no more supported)
Add tests in order to prevent bad file format.
David Auber University of Bordeaux I (LaBRI) France
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Constructor & Destructor Documentation
AdjacencyMatrixImport::AdjacencyMatrixImport (AlgorithmContext context) [inline]
AdjacencyMatrixImport::~AdjacencyMatrixImport () [inline]
Member Function Documentation
bool AdjacencyMatrixImport::formatError (const char * s, int curLine) [inline]
bool AdjacencyMatrixImport::import (const string & name) [inline]
Member Data Documentation
Generated automatically by Doxygen for Tulip Plugins Library from the source code.